diff --git a/configuration.nix b/configuration.nix index 98deeb3..3fec801 100644 --- a/configuration.nix +++ b/configuration.nix @@ -10,7 +10,10 @@ }: { - nix.settings.experimental-features = [ "flakes" "nix-command" ]; + nix.settings.experimental-features = [ + "flakes" + "nix-command" + ]; imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix diff --git a/flake.nix b/flake.nix index ed971fa..6d6eba1 100644 --- a/flake.nix +++ b/flake.nix @@ -22,22 +22,25 @@ marty-pc = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - ./configuration.nix ./marty-pc.nix + ./configuration.nix + ]; }; marty-server = nixpkgs.lib.nixosSystem { system = "x86_64"; modules = [ - ./configuration.nix ./marty-server.nix + ./configuration.nix + ]; }; marty-latitude = nixpkgs.lib.nixosSystem { system = "x86_64"; modules = [ - ./configuration.nix ./marty-latitude.nix + ./configuration.nix + ]; }; }; diff --git a/imports.nix b/imports.nix index 5881ab0..3795046 100644 --- a/imports.nix +++ b/imports.nix @@ -5,9 +5,30 @@ ... }: +let + modules = + if config.networking.hostName == "marty-pc" then + [ + ./system/import_system.nix + ./modules/imports.nix + + ] + else if config.networking.hostName == "marty-latitude" then + [ + ./system/import_system.nix + ./modules/imports.nix + + ] + else if config.networking.hostName == "marty-server" then + [ + ./system/import_system.nix + ./modules/imports.nix + + ] + else + [ ]; +in + { - imports = [ - ./system/imports.nix - ./modules/imports.nix - ]; + imports = modules; } diff --git a/modules/git.nix b/modules/development/git.nix similarity index 100% rename from modules/git.nix rename to modules/development/git.nix diff --git a/modules/development/import_development.nix b/modules/development/import_development.nix new file mode 100644 index 0000000..e2b16b0 --- /dev/null +++ b/modules/development/import_development.nix @@ -0,0 +1,33 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + modules = + if config.networking.hostName == "marty-pc" then + [ + ./git.nix + ./vscodium.nix + + ] + else if config.networking.hostName == "marty-latitude" then + [ + ./git.nix + ./vscodium.nix + + ] + else if config.networking.hostName == "marty-server" then + [ + ./git.nix + + ] + else + [ ]; +in + +{ + imports = modules; +} diff --git a/modules/vscodium.nix b/modules/development/vscodium.nix similarity index 63% rename from modules/vscodium.nix rename to modules/development/vscodium.nix index efe0543..3bfc7a4 100644 --- a/modules/vscodium.nix +++ b/modules/development/vscodium.nix @@ -5,21 +5,11 @@ ... }: -let - enable_vscode = - if config.networking.hostName == "marty-pc" - then true - else if config.networking.hostName == "marty-latitude" - then true - else false; -in - - { programs.vscode = { - enable = enable_vscode; + enable = true; package = pkgs.vscodium; - defaultEditor = enable_vscode; + defaultEditor = true; extensions = with pkgs.vscode-extensions; [ catppuccin.catppuccin-vsc catppuccin.catppuccin-vsc-icons diff --git a/modules/import_modules.nix b/modules/import_modules.nix new file mode 100644 index 0000000..7062de3 --- /dev/null +++ b/modules/import_modules.nix @@ -0,0 +1,14 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + imports = [ + ./development/import_development.nix + ./window_manager/import_wm.nix + + ]; +} diff --git a/modules/imports.nix b/modules/imports.nix deleted file mode 100644 index aeaf08c..0000000 --- a/modules/imports.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: - -{ - imports = [ - ./window_manager/imports.nix - ./git.nix - ./vscodium.nix - ]; -} diff --git a/modules/window_manager/hyprland.nix b/modules/window_manager/hyprland.nix index ba9ee16..d4409a5 100644 --- a/modules/window_manager/hyprland.nix +++ b/modules/window_manager/hyprland.nix @@ -5,23 +5,14 @@ ... }: -let - enable_hyprland = - if config.networking.hostName == "marty-pc" - then true - else if config.networking.hostName == "marty-latitude" - then true - else false; -in - { programs = { hyprland = { - enable = enable_hyprland; - xwayland.enable = enable_hyprland; + enable = true; + xwayland.enable = true; }; hyprlock = { - enable = enable_hyprland; + enable = true; }; }; } diff --git a/modules/window_manager/import_wm.nix b/modules/window_manager/import_wm.nix new file mode 100644 index 0000000..ffd5a01 --- /dev/null +++ b/modules/window_manager/import_wm.nix @@ -0,0 +1,30 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + modules = + if config.networking.hostName == "marty-pc" then + [ + ./hyprland.nix + ./waybar.nix + ] + else if config.networking.hostName == "marty-latitude" then + [ + ./hyprland.nix + ./waybar.nix + ] + else if config.networking.hostName == "marty-server" then + [ + + ] + else + [ ]; +in + +{ + imports = modules; +} diff --git a/modules/window_manager/imports.nix b/modules/window_manager/imports.nix deleted file mode 100644 index 387d7b1..0000000 --- a/modules/window_manager/imports.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: - -{ - imports = [ - ./hyprland.nix - ./waybar.nix - ]; -} diff --git a/modules/window_manager/waybar.nix b/modules/window_manager/waybar.nix index 16308a1..1a45ab0 100644 --- a/modules/window_manager/waybar.nix +++ b/modules/window_manager/waybar.nix @@ -5,19 +5,10 @@ ... }: -let - enable_waybar = - if config.networking.hostName == "marty-pc" - then true - else if config.networking.hostName == "marty-latitude" - then true - else false; -in - { programs = { waybar = { - enable = enable_waybar; + enable = true; }; }; } diff --git a/system/imports.nix b/system/import_system.nix similarity index 98% rename from system/imports.nix rename to system/import_system.nix index 3d1ec92..808ae98 100644 --- a/system/imports.nix +++ b/system/import_system.nix @@ -8,5 +8,6 @@ { imports = [ ./boot.nix + ]; }