let nixos modules handle deps

This commit is contained in:
Ivan Kirilov Dimitrov 2024-08-03 10:37:55 +02:00
parent c09e7674f4
commit fa2081dab1
No known key found for this signature in database
GPG Key ID: 0BDAD4B211C49294
2 changed files with 6 additions and 3 deletions

View File

@ -24,7 +24,7 @@ let
hardware.cpu.intel.updateMicrocode = lib.mkForce false; 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 ]); essential = [ hardwareConfigurations.nova ] ++ (with mods; [ grub base sound wayland security ivand wireless wireguard ]);
systemWithModules = modules: withSystem system (ctx@{ config, inputs', pkgs, ... }: inputs.nixpkgs.lib.nixosSystem { systemWithModules = modules: withSystem system (ctx@{ config, inputs', pkgs, ... }: inputs.nixpkgs.lib.nixosSystem {
specialArgs = { specialArgs = {
inherit inputs inputs' pkgs; inherit inputs inputs' pkgs;
@ -36,7 +36,7 @@ in
{ {
flake.nixosConfigurations = { flake.nixosConfigurations = {
nixos = systemWithModules essential; nixos = systemWithModules essential;
music = systemWithModules (essential ++ [ inputs.musnix.nixosModules.musnix mods.music ]); music = systemWithModules (essential ++ [ mods.music ]);
nonya = systemWithModules (essential ++ (with mods; [ anon cryptocurrency ])); nonya = systemWithModules (essential ++ (with mods; [ anon cryptocurrency ]));
ai = systemWithModules (essential ++ (with mods; [ ai ])); ai = systemWithModules (essential ++ (with mods; [ ai ]));
}; };

View File

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