diff --git a/modules/desktop/desktop.nix b/modules/desktop/desktop.nix index c4f079c32..8f4aad2c9 100644 --- a/modules/desktop/desktop.nix +++ b/modules/desktop/desktop.nix @@ -17,16 +17,20 @@ in { xwayland.enable = true; systemd.enable = true; - settings = lib.mkMerge [ - (import ./hyprland/hypr/keybinds.nix {inherit config pkgs;}) - (import ./hyprland/hypr/exec.nix {inherit config pkgs;}) - (import ./hyprland/hypr/rules.nix {inherit config pkgs;}) - (import ./hyprland/hypr/env.nix {inherit config pkgs;}) - (import ./hyprland/hypr/colours.nix {inherit config pkgs;}) - ]; + settings = lib.mkIf cfg.settings.hyprland.useNixForConf ( + lib.mkMerge [ + # These imports must be functions that return an attribute set. + (import ./hyprland/hypr/keybinds.nix {inherit config pkgs;}) + (import ./hyprland/hypr/exec.nix {inherit config pkgs;}) + (import ./hyprland/hypr/rules.nix {inherit config pkgs;}) + (import ./hyprland/hypr/env.nix {inherit config pkgs;}) + (import ./hyprland/hypr/colours.nix {inherit config pkgs;}) + ] + ); }; home.file = lib.mkMerge [ + # The home.file configuration is now split into two mutually exclusive blocks. (lib.mkIf cfg.settings.hyprland.useNixForConf { ".config/hypr/scripts" = { source = builtins.path { @@ -41,8 +45,6 @@ in { path = ../../.config/hypr; }; }; - }) - { ".config/quickshell".source = builtins.path {path = ../../.config/quickshell;}; ".config/kitty".source = builtins.path {path = ../../.config/kitty;}; ".config/foot".source = builtins.path {path = ../../.config/foot;}; @@ -52,7 +54,7 @@ in { ".config/wlogout".source = builtins.path {path = ../../.config/wlogout;}; ".config/Kvantum".source = builtins.path {path = ../../.config/Kvantum;}; ".config/xdg-desktop-portal".source = builtins.path {path = ../../.config/xdg-desktop-portal;}; - } + }) ]; home.packages = diff --git a/modules/desktop/hyprland/hypr/env.nix b/modules/desktop/hyprland/hypr/env.nix index 2abc57bd5..5e847a0a2 100644 --- a/modules/desktop/hyprland/hypr/env.nix +++ b/modules/desktop/hyprland/hypr/env.nix @@ -1,8 +1,4 @@ { - config, - pkgs, - ... -}: { # This file only defines the `env` attribute, which is a part of the settings. env = [ "QT_IM_MODULE, fcitx" diff --git a/modules/desktop/hyprland/hypr/general.nix b/modules/desktop/hyprland/hypr/general.nix index 78d3349d1..91a23135e 100644 --- a/modules/desktop/hyprland/hypr/general.nix +++ b/modules/desktop/hyprland/hypr/general.nix @@ -1,8 +1,4 @@ { - config, - pkgs, - ... -}: { monitor = [ ",preferred,auto,1,transform, 0" # "HDMI-A-1,1920x1080@60,1920x0,1,mirror,eDP-1" diff --git a/modules/desktop/hyprland/hypr/keybinds.nix b/modules/desktop/hyprland/hypr/keybinds.nix index f7150993b..5475fe2bc 100644 --- a/modules/desktop/hyprland/hypr/keybinds.nix +++ b/modules/desktop/hyprland/hypr/keybinds.nix @@ -1,8 +1,4 @@ { - config, - pkgs, - ... -}: { # Shell keybinds bindi = [ "Super, Super_L, Toggle overview, global, quickshell:overviewToggleRelease" diff --git a/modules/desktop/hyprland/hypr/rules.nix b/modules/desktop/hyprland/hypr/rules.nix index 8c908ca43..d537fd0e0 100644 --- a/modules/desktop/hyprland/hypr/rules.nix +++ b/modules/desktop/hyprland/hypr/rules.nix @@ -1,8 +1,4 @@ { - config, - pkgs, - ... -}: { windowrulev2 = [ # Uncomment to apply global transparency to all windows: # "opacity 0.89 override 0.89 override, class:.*"