diff --git a/hosts/common/home.nix b/hosts/common/home.nix index 3b6b93a..46a435d 100644 --- a/hosts/common/home.nix +++ b/hosts/common/home.nix @@ -6,6 +6,7 @@ ../../modules/home-manager/webapps.nix ../../modules/home-manager/lf/lf.nix ../../modules/home-manager/kitty.nix + ../../modules/home-manager/hyprland.nix ]; smayzy.webapps.enable = true; @@ -27,15 +28,6 @@ recursive = true; force = true; }; - ".config/mako/config" = { - source = builtins.toPath ../../dotfiles/mako/config; - force = true; - }; - ".config/wofi" = { - source = builtins.toPath ../../dotfiles/wofi; - recursive = true; - force = true; - }; "wallpaper" = { source = builtins.toPath ../../wallpapers; recursive = true; diff --git a/hosts/desktop1/home.nix b/hosts/desktop1/home.nix index bc25781..d7c74ec 100644 --- a/hosts/desktop1/home.nix +++ b/hosts/desktop1/home.nix @@ -10,21 +10,6 @@ ]; home.file = { - ".config/hypr" = { - source = builtins.toPath ../../dotfiles/hypr-desk; - recursive = true; - force = true; - }; - ".config/waybar" = { - source = builtins.toPath ../../dotfiles/waybar-desk; - recursive = true; - force = true; - }; - ".config/wlogout" = { - source = builtins.toPath ../../dotfiles/wlogout-desk; - recursive = true; - force = true; - }; - }; + }; } diff --git a/hosts/laptop1/configuration.nix b/hosts/laptop1/configuration.nix index f2a041d..8d61725 100644 --- a/hosts/laptop1/configuration.nix +++ b/hosts/laptop1/configuration.nix @@ -14,7 +14,10 @@ }; home-manager = { - extraSpecialArgs = { inherit inputs; }; + extraSpecialArgs = { + inherit inputs; + smayzy = config.smayzy; + }; users = { smayzy = import ./home.nix; }; diff --git a/hosts/laptop1/home.nix b/hosts/laptop1/home.nix index 0ac3325..17d0e15 100644 --- a/hosts/laptop1/home.nix +++ b/hosts/laptop1/home.nix @@ -10,20 +10,5 @@ ]; home.file = { - ".config/hypr" = { - source = builtins.toPath ../../dotfiles/hypr-lap; - recursive = true; - force = true; - }; - ".config/waybar" = { - source = builtins.toPath ../../dotfiles/waybar-lap; - recursive = true; - force = true; - }; - ".config/wlogout" = { - source = builtins.toPath ../../dotfiles/wlogout-lap; - recursive = true; - force = true; - }; }; } diff --git a/modules/home-manager/hyprland.nix b/modules/home-manager/hyprland.nix new file mode 100644 index 0000000..a9ae39c --- /dev/null +++ b/modules/home-manager/hyprland.nix @@ -0,0 +1,59 @@ +{ lib, config, pkgs, smayzy, ... }: +let + mkIf = lib.mkIf; +in +{ + config = mkIf smayzy.hyprland.enable { + + home.file = builtins.foldl' lib.recursiveUpdate {} [ + { + ".config/mako/config" = { + source = builtins.toPath ../../dotfiles/mako/config; + force = true; + }; + ".config/wofi" = { + source = builtins.toPath ../../dotfiles/wofi; + recursive = true; + force = true; + }; + } + + (mkIf smayzy.desktop.enable { + ".config/hypr" = { + source = builtins.toPath ../../dotfiles/hypr-desk; + recursive = true; + force = true; + }; + ".config/waybar" = { + source = builtins.toPath ../../dotfiles/waybar-desk; + recursive = true; + force = true; + }; + ".config/wlogout" = { + source = builtins.toPath ../../dotfiles/wlogout-desk; + recursive = true; + force = true; + }; + }) + + (mkIf smayzy.laptop.enable { + ".config/hypr" = { + source = builtins.toPath ../../dotfiles/hypr-lap; + recursive = true; + force = true; + }; + ".config/waybar" = { + source = builtins.toPath ../../dotfiles/waybar-lap; + recursive = true; + force = true; + }; + ".config/wlogout" = { + source = builtins.toPath ../../dotfiles/wlogout-lap; + recursive = true; + force = true; + }; + }) + ]; + }; +} +