189 lines
5.9 KiB
Nix
189 lines
5.9 KiB
Nix
{ inputs, config, lib, pkgs, username, variant, ... }:
|
|
{
|
|
|
|
imports = [
|
|
./lf.nix
|
|
./fish.nix
|
|
./ui.nix
|
|
./terminal-software.nix
|
|
./gui-software.nix
|
|
./gaming.nix
|
|
./additional-software.nix
|
|
];
|
|
|
|
# Home Manager needs a bit of information about you and the paths it should
|
|
# manage.
|
|
home.username = username;
|
|
home.homeDirectory = "/home/${config.home.username}";
|
|
|
|
home.stateVersion = "23.05"; # Please read the comment before changing.
|
|
|
|
home.packages = with pkgs; [
|
|
nh
|
|
python3
|
|
python3Packages.virtualenv
|
|
# bluez
|
|
go-mtpfs
|
|
xdg-utils
|
|
davfs2
|
|
sshfs
|
|
];
|
|
|
|
|
|
home.file = {
|
|
".config/kitty/light.conf".source = dotfiles/kitty/light.conf;
|
|
".config/kitty/dark.conf".source = dotfiles/kitty/dark.conf;
|
|
|
|
".config/rofi/colors-dark.rasi".source = dotfiles/rofi/colors-dark.rasi;
|
|
".config/rofi/colors-light.rasi".source = dotfiles/rofi/colors-light.rasi;
|
|
".config/rofi/theme.rasi".source = dotfiles/rofi/theme.rasi;
|
|
|
|
".config/keepmenu/config.ini".source = dotfiles/keepmenu.ini;
|
|
|
|
".bin/runmenu".source = pkgs.writers.writeBash "runmenu" ''
|
|
${config.programs.rofi.package}/bin/rofi -matching normal -sort -show run
|
|
'';
|
|
|
|
".bin/window_dir".source = pkgs.writers.writeBash "window_dir" ''
|
|
PID=$(${pkgs.hyprland}/bin/hyprctl activewindow | grep pid | cut -d' ' -f 2)
|
|
PID=$(echo $(ps --ppid $PID -o pid | tail -n1))
|
|
cwd=$(readlink /proc/"$PID"/cwd)
|
|
echo "$cwd"
|
|
'';
|
|
|
|
".bin/exec_on_stdin_newline".source = pkgs.writers.writePython3 "exec_on_stdin_newline" {} ''
|
|
# run command whjen a newline is added to stdin
|
|
import subprocess
|
|
from sys import stdin, argv
|
|
cmd = argv[1:]
|
|
subprocess.call(cmd, shell=True)
|
|
while stdin.readline():
|
|
subprocess.call(cmd, shell=True)
|
|
'';
|
|
|
|
".bin/screenshot".source = (import ./bin/screenshot.nix) pkgs;
|
|
|
|
".bin/ocrzone".source = pkgs.writers.writeBash "ocrzone" ''
|
|
${pkgs.pkgs.sway-contrib.grimshot}/bin/grimshot save area - | \
|
|
${pkgs.tesseract}/bin/tesseract -l fra - - | \
|
|
${pkgs.wl-clipboard}/bin/wl-copy
|
|
'';
|
|
|
|
".bin/wifi-toggle".source = pkgs.writers.writeBash "wifi-toggle" ''
|
|
if [[ $(nmcli radio wifi) == "enabled" ]]; then
|
|
nmcli radio wifi off
|
|
else
|
|
nmcli radio wifi on
|
|
fi
|
|
'';
|
|
|
|
".bin/rofi-udisk".source = pkgs.writers.writeBash "rofi-udisk" ''
|
|
device=$(${pkgs.udiskie}/bin/udiskie-info -a -o "{ui_label} {in_use}" -f is_filesystem | \
|
|
${pkgs.gnused}/bin/sed 's/True$/[Mounted]/' | \
|
|
${pkgs.gnused}/bin/sed 's/False$//' | \
|
|
${config.programs.rofi.package}/bin/rofi -dmenu | \
|
|
${pkgs.coreutils}/bin/cut -d':' -f1)
|
|
|
|
if [ -n "$device" ] ; then
|
|
if ${pkgs.mount}/bin/mount | ${pkgs.gnugrep}/bin/grep "$device" ; then
|
|
${pkgs.libnotify}/bin/notify-send "Unmounting $device..."
|
|
output=$(${pkgs.udisks}/bin/udisksctl unmount -b $device 2>&1)
|
|
if [ $? -eq 0 ] ; then
|
|
${pkgs.libnotify}/bin/notify-send "Device successfully unmounted."
|
|
else
|
|
${pkgs.libnotify}/bin/notify-send "Failed to unmount device" "$output"
|
|
fi
|
|
else
|
|
${pkgs.libnotify}/bin/notify-send "Mounting $device..."
|
|
output=$(${pkgs.udisks}/bin/udisksctl mount -b $device 2>&1)
|
|
if [ $? -eq 0 ] ; then
|
|
${pkgs.libnotify}/bin/notify-send "Device successfully mounted."
|
|
else
|
|
${pkgs.libnotify}/bin/notify-send "Failed to mount device" "$output"
|
|
fi
|
|
fi
|
|
fi
|
|
'';
|
|
|
|
".bin/mount-android".source = pkgs.writers.writeBash "mount-android" ''
|
|
if ${pkgs.mount}/bin/mount | ${pkgs.gnugrep}/bin/grep $(realpath ~/android); then
|
|
umount $(realpath ~/android)
|
|
${pkgs.libnotify}/bin/notify-send "Android unmounted"
|
|
elif ${pkgs.simple-mtpfs}/bin/simple-mtpfs $(realpath ~/android); then
|
|
${pkgs.libnotify}/bin/notify-send "Android mounted in ~/android"
|
|
else
|
|
${pkgs.libnotify}/bin/notify-send "Can't find Android device"
|
|
fi
|
|
'';
|
|
|
|
".bin/dark".source = (import ./bin/dark.nix) pkgs; # deprecated, prefer darkman
|
|
};
|
|
|
|
|
|
home.sessionPath = [
|
|
"$HOME/.local/bin"
|
|
"$HOME/.bin"
|
|
];
|
|
|
|
home.sessionVariables = {
|
|
GOPATH = "${config.home.homeDirectory}/.local/share/go";
|
|
GOMODCACHE = "${config.home.homeDirectory}/.cache/go/pkg/mod";
|
|
|
|
NIXOS_OZONE_WL = "1";
|
|
GDK_BACKEND = "wayland,x11";
|
|
QT_QPA_PLATFORM = "wayland;xcb";
|
|
CLUTTER_BACKEND = "wayland";
|
|
XDG_CURRENT_DESKTOP = "Hyprland";
|
|
XDG_SESSION_TYPE = "wayland";
|
|
XDG_SESSION_DESKTOP = "Hyprland";
|
|
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
|
|
WLR_NO_HARDWARE_CURSORS = "0";
|
|
XCURSOR_SIZE = "24";
|
|
} // (if variant == "allegro" then {
|
|
TMPDIR = "/home/${username}/tmp";
|
|
GSETTINGS_SCHEMA_DIR = "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/gsettings-desktop-schemas-47.1/glib-2.0/schemas";
|
|
} else {});
|
|
|
|
home.keyboard.options = [
|
|
"caps:escape"
|
|
];
|
|
|
|
xdg = {
|
|
enable = true;
|
|
systemDirs.data = [ "${config.home.homeDirectory}/.local/share" ];
|
|
userDirs = {
|
|
enable = true;
|
|
createDirectories = false;
|
|
download = "${config.home.homeDirectory}/downloads";
|
|
templates = "${config.home.homeDirectory}/templates";
|
|
|
|
desktop = "${config.home.homeDirectory}";
|
|
documents = "${config.home.homeDirectory}";
|
|
music = "${config.home.homeDirectory}";
|
|
pictures = "${config.home.homeDirectory}";
|
|
publicShare = "${config.home.homeDirectory}";
|
|
videos = "${config.home.homeDirectory}";
|
|
};
|
|
|
|
mimeApps = {
|
|
enable = true;
|
|
};
|
|
};
|
|
|
|
services.darkman = {
|
|
enable = true;
|
|
lightModeScripts = {
|
|
rm-file-indicator = "rm $XDG_STATE_HOME/darkmode";
|
|
};
|
|
|
|
darkModeScripts = {
|
|
set-file-indicator = "touch $XDG_STATE_HOME/darkmode";
|
|
};
|
|
};
|
|
|
|
|
|
services.gnome-keyring.enable = true;
|
|
services.syncthing.enable = true;
|
|
services.kdeconnect.enable = variant != "allegro";
|
|
programs.home-manager.enable = true;
|
|
}
|