diff --git a/nixos/home.nix b/nixos/home.nix index c94ae88..54ab1cd 100644 --- a/nixos/home.nix +++ b/nixos/home.nix @@ -7,19 +7,33 @@ username, inputs, ... -}: let -in { +}: +let +in +{ imports = [ ./modules/fastfetch ./modules/tmux/home.nix ] - ++ lib.optional (hwconfig.useImpermanence) (import ./modules/impermanence/home.nix { - inherit username; - inherit inputs; - }) - ++ lib.optional (config.programs.hyprland.enable) ./modules/hyprland/home.nix - ++ lib.optional (builtins.pathExists ./homes/${username}) (import ./homes/${username} {inherit username;}); + ++ lib.optional (hwconfig.useImpermanence) ( + import ./modules/impermanence/home.nix { + inherit username; + inherit inputs; + } + ) + ++ lib.optional (config.programs.hyprland.enable) ( + import ./modules/hyprland/home.nix { + inherit pkgs; + inherit username; + inherit inputs; + inherit hwconfig; + inherit lib; + } + ) + ++ lib.optional (builtins.pathExists ./homes/${username}) ( + import ./homes/${username} { inherit username; } + ); # Home Manager needs a bit of information about you and the paths it should # manage. home.username = username; diff --git a/nixos/modules/emacs/default.nix b/nixos/modules/emacs/default.nix index 0b188c4..a876d17 100644 --- a/nixos/modules/emacs/default.nix +++ b/nixos/modules/emacs/default.nix @@ -4,20 +4,21 @@ lib, inputs, ... -}: let - emacs = pkgs.emacs; #pkgs.emacs-pgtk; -in { +}: +let + emacs = pkgs.emacs-pgtk; # pkgs.emacs; #pkgs.emacs-pgtk; +in +{ #services.emacs.enable = true; services.emacs.startWithGraphical = true; #services.emacs.install = true; - services.emacs.package = emacs; #pkgs.emacs-unstable + services.emacs.package = emacs; # pkgs.emacs-unstable environment.systemPackages = (import ./packages.nix { inherit pkgs; inherit emacs; - }) - .packages; + }).packages; nixpkgs.overlays = [ inputs.emacs-overlay.overlays.default ]; diff --git a/nixos/modules/hyprland/home.nix b/nixos/modules/hyprland/home.nix index 18a23bf..7557bcd 100644 --- a/nixos/modules/hyprland/home.nix +++ b/nixos/modules/hyprland/home.nix @@ -1,7 +1,18 @@ -{ ... }: { - imports = [ - ./hyprland.nix - #../kando - ]; + pkgs, + username, + lib, + hwconfig, + ... +}: +{ + imports = [ + (import ./hyprland.nix { + inherit pkgs; + inherit lib; + inherit hwconfig; + inherit username; + }) + #../kando + ]; } diff --git a/nixos/modules/hyprland/hyprland.nix b/nixos/modules/hyprland/hyprland.nix index afa8137..5627637 100644 --- a/nixos/modules/hyprland/hyprland.nix +++ b/nixos/modules/hyprland/hyprland.nix @@ -4,10 +4,12 @@ hwconfig, username, ... -}: let +}: +let toggle_monitors = ./toggle_monitors.sh; wallpaper-image = ./wallpaper.jpg; -in { +in +{ imports = [ ./waybar.nix ./hyprlock.nix @@ -18,15 +20,15 @@ in { xwayland.enable = true; settings = { monitor = - if hwconfig.hostname == "kylekrein-homepc" - then [ - "DP-1,2560x1440@75,1600x0,1.6" - "DP-3,2560x1440@75,0x0,1.6" - ] + if hwconfig.hostname == "kylekrein-homepc" then + [ + "DP-1,2560x1440@75,1600x0,1.6" + "DP-3,2560x1440@75,0x0,1.6" + ] else - [",highres,auto,1.6"] + [ ",highres,auto,1.6" ] ++ [ - "FALLBACK,1920x1080@60,auto,1" #to fix crash on hyprlock https://github.com/hyprwm/hyprlock/issues/434#issuecomment-2341710088 + "FALLBACK,1920x1080@60,auto,1" # to fix crash on hyprlock https://github.com/hyprwm/hyprlock/issues/434#issuecomment-2341710088 ]; xwayland = { @@ -34,18 +36,14 @@ in { }; exec-once = [ - "${ - if hwconfig.isLaptop - then "brightnessctl set 25%" - else "" - }" + "${if hwconfig.isLaptop then "brightnessctl set 25%" else ""}" "dbus-update-activation-environment --systemd --all" "${pkgs.waybar}/bin/waybar &" "${pkgs.networkmanagerapplet}/bin/nm-applet &" "${pkgs.swaynotificationcenter}/bin/swaync &" "${pkgs.solaar}/bin/solaar -w hide &" #"${pkgs.hypridle}/bin/hypridle &" - "${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1 &" #https://nixos.wiki/wiki/Polkit + "${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1 &" # https://nixos.wiki/wiki/Polkit "${pkgs.clipse}/bin/clipse -listen &" "${pkgs.swww}/bin/swww-daemon &" "${pkgs.swww}/bin/swww img ${wallpaper-image} &" @@ -58,12 +56,14 @@ in { "$mod" = "SUPER"; "$mainMod" = "$mod"; "$terminal" = "${pkgs.kitty}/bin/kitty"; - "$fileManager" = "$terminal ${pkgs.yazi}/bin/yazi"; + "$emacs" = "emacsclient -c -a 'emacs'"; + "$fileManager" = "$emacs --eval '(dired \"/home/${username}\")'"; # "$terminal ${pkgs.yazi}/bin/yazi"; "$fileManager2" = "${pkgs.kdePackages.dolphin}/bin/dolphin"; "$browser" = "${pkgs.firefox}/bin/firefox"; "$menu" = "${pkgs.wofi}/bin/wofi --show drun"; "$clipboardManager" = "$terminal --class clipse -e 'clipse'"; - "$makeRegionScreenshot" = "${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp -w 0)\" - | ${pkgs.satty}/bin/satty --early-exit --copy-command 'wl-copy' --filename '-' --initial-tool brush"; + "$makeRegionScreenshot" = + "${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp -w 0)\" - | ${pkgs.satty}/bin/satty --early-exit --copy-command 'wl-copy' --filename '-' --initial-tool brush"; bind = [ "$mod, T, exec, $terminal" "$mod, Q, killactive," @@ -123,7 +123,7 @@ in { "$mainMod, P, exec, $makeRegionScreenshot" "$mainMod ALT, L, exec, ${pkgs.hyprlock}/bin/hyprlock" - ''$mainMod, E, exec, emacsclient -c -a "send-notify 'Unable to launch Emacs. Daemon is not running'"'' + ''$mainMod, E, exec, $emacs'' ]; bindm = [ @@ -153,7 +153,7 @@ in { #"GDK_SCALE,1.6" #"QT_SCALE_FACTOR,1.6" - "GSK_RENDERER,ngl" #for satty until https://github.com/NixOS/nixpkgs/issues/359069 is fixed + "GSK_RENDERER,ngl" # for satty until https://github.com/NixOS/nixpkgs/issues/359069 is fixed ]; cursor = {