Compare commits

...

2 Commits

Author SHA1 Message Date
579259b156
nixos config refactor 2024-08-03 10:49:41 +02:00
fa2081dab1
let nixos modules handle deps 2024-08-03 10:37:55 +02:00
2 changed files with 13 additions and 8 deletions

View File

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

View File

@ -1,4 +1,4 @@
top@{ moduleWithSystem, ... }: {
top@{ inputs, moduleWithSystem, ... }: {
flake.nixosModules = {
grub = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: {
boot = {
@ -13,6 +13,7 @@ top@{ moduleWithSystem, ... }: {
};
});
base = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: {
imports = [ inputs.hosts.nixosModule ];
system.stateVersion = top.config.flake.stateVersion;
nix = { extraOptions = ''experimental-features = nix-command flakes''; };
i18n.supportedLocales = [ "all" ];
@ -35,6 +36,7 @@ top@{ moduleWithSystem, ... }: {
environment.systemPackages = with pkgs; [ pwvucontrol ];
});
music = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: {
imports = [ inputs.musnix.nixosModules.musnix ];
environment.systemPackages = with pkgs; [ guitarix ];
services.pipewire = {
jack.enable = true;
@ -128,6 +130,7 @@ top@{ moduleWithSystem, ... }: {
};
ivand = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }:
let homeMods = top.config.flake.homeManagerModules; in {
imports = [ inputs.home-manager.nixosModules.default ];
home-manager = {
backupFileExtension = "bak";
useUserPackages = true;