modularizing modules ig

This commit is contained in:
martyTF 2025-12-16 16:50:47 +01:00
parent 9c0b46c7d3
commit 3d09e64139
6 changed files with 83 additions and 18 deletions

View file

@ -10,7 +10,10 @@
}: }:
{ {
nix.settings.experimental-features = [ "flakes" "nix-command" ]; nix.settings.experimental-features = [
"flakes"
"nix-command"
];
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix

View file

@ -22,22 +22,25 @@
marty-pc = nixpkgs.lib.nixosSystem { marty-pc = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./configuration.nix
./marty-pc.nix ./marty-pc.nix
./configuration.nix
]; ];
}; };
marty-server = nixpkgs.lib.nixosSystem { marty-server = nixpkgs.lib.nixosSystem {
system = "x86_64"; system = "x86_64";
modules = [ modules = [
./configuration.nix
./marty-server.nix ./marty-server.nix
./configuration.nix
]; ];
}; };
marty-latitude = nixpkgs.lib.nixosSystem { marty-latitude = nixpkgs.lib.nixosSystem {
system = "x86_64"; system = "x86_64";
modules = [ modules = [
./configuration.nix
./marty-latitude.nix ./marty-latitude.nix
./configuration.nix
]; ];
}; };
}; };

View file

@ -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 = [ imports = modules;
./system/imports.nix
./modules/imports.nix
];
} }

View file

@ -5,10 +5,31 @@
... ...
}: }:
let
modules =
if config.networking.hostName == "marty-pc" then
[
./git.nix
./vscodium.nix
./window_manager/imports.nix
]
else if config.networking.hostName == "marty-latitude" then
[
./git.nix
./vscodium.nix
./window_manager/imports.nix
]
else if config.networking.hostName == "marty-server" then
[
./git.nix
]
else
[ ];
in
{ {
imports = [ imports = modules;
./window_manager/imports.nix
./git.nix
./vscodium.nix
];
} }

View file

@ -5,9 +5,26 @@
... ...
}: }:
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 = [ imports = modules;
./hyprland.nix
./waybar.nix
];
} }

View file

@ -5,7 +5,7 @@
... ...
}: }:
{ ./system/imports.nix ./modules/imports.nix {
imports = [ imports = [
./boot.nix ./boot.nix
]; ];