nixos config refactor

This commit is contained in:
Ivan Kirilov Dimitrov 2024-08-03 10:49:41 +02:00
parent fa2081dab1
commit 579259b156
No known key found for this signature in database
GPG Key ID: 0BDAD4B211C49294

View File

@ -24,20 +24,22 @@ let
hardware.cpu.intel.updateMicrocode = lib.mkForce false; hardware.cpu.intel.updateMicrocode = lib.mkForce false;
}; };
}; };
essential = [ hardwareConfigurations.nova ] ++ (with mods; [ grub base sound wayland security ivand wireless wireguard ]); essential = with mods; [ grub base security wireless wireguard ];
systemWithModules = modules: withSystem system (ctx@{ config, inputs', pkgs, ... }: inputs.nixpkgs.lib.nixosSystem { desktop = with mods; [ sound wayland ];
configWithModules = { hardware, modules }: withSystem system (ctx@{ config, inputs', pkgs, ... }: inputs.nixpkgs.lib.nixosSystem {
specialArgs = { specialArgs = {
inherit inputs inputs' pkgs; inherit inputs inputs' pkgs;
packages = config.packages; packages = config.packages;
}; };
modules = modules; modules = [ hardware ] ++ modules;
}); });
novaConfig = mods: configWithModules { hardware = hardwareConfigurations.nova; modules = essential ++ desktop ++ mods; };
in in
{ {
flake.nixosConfigurations = { flake.nixosConfigurations = {
nixos = systemWithModules essential; nixos = novaConfig [ mods.ivand ];
music = systemWithModules (essential ++ [ mods.music ]); music = novaConfig (with mods; [ music ivand ]);
nonya = systemWithModules (essential ++ (with mods; [ anon cryptocurrency ])); nonya = novaConfig (with mods; [ anon cryptocurrency ivand ]);
ai = systemWithModules (essential ++ (with mods; [ ai ])); ai = novaConfig (with mods; [ ai ivand ]);
}; };
} }