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