default hardware

This commit is contained in:
Ivan Kirilov Dimitrov 2024-08-04 15:24:18 +02:00
parent 37b0aee3d2
commit 439c31d2cc
No known key found for this signature in database
GPG Key ID: 0BDAD4B211C49294

View File

@ -5,13 +5,23 @@ let
hardwareConfigurations = toplevel.config.flake.hardwareConfigurations;
essential = with mods; [ grub base shell security wireless wireguard ];
desktop = with mods; [ sound wayland ];
configWithModules = { hardware ? { nixpkgs.hostPlatform = system; }, modules }: withSystem system (ctx@{ config, inputs', pkgs, ... }: inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs inputs' pkgs;
packages = config.packages;
};
modules = [ hardware ] ++ modules;
});
configWithModules =
{ hardware ? (import (
if builtins.pathExists
/mnt/etc/nixos/hardware-configuration.nix
then
/mnt/etc/nixos/hardware-configuration.nix
else
/etc/nixos/hardware-configuration.nix
))
, modules
}: withSystem system (ctx@{ config, inputs', pkgs, ... }: inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs inputs' pkgs;
packages = config.packages;
};
modules = [ hardware ] ++ modules;
});
novaConfig = mods: configWithModules { hardware = hardwareConfigurations.nova; modules = essential ++ desktop ++ mods; };
in
{
@ -22,7 +32,7 @@ in
nova-nonya = novaConfig (with mods; [ ivand anon cryptocurrency ]);
nova-ai = novaConfig (with mods; [ ivand ai ]);
install-iso = configWithModules { modules = (with mods; [ grub base shell wireless ]); };
vps = configWithModules { modules = (with mods; [ base shell security vps ]); };
stara-miner = configWithModules { hardware = import /etc/nixos/hardware-configuration.nix; modules = (with mods; [ base shell security monero-miner ]); };
vps = configWithModules { hardware = { nixpkgs.hostPlatform = system; }; modules = (with mods; [ base shell security vps ]); };
stara-miner = configWithModules { modules = (with mods; [ base shell security monero-miner ]); };
};
}