nixosConfigurations abstraction

This commit is contained in:
Gerg-L 2023-04-21 13:43:55 -04:00
parent 4f9c434347
commit a37cdcab5d
2 changed files with 31 additions and 42 deletions

View file

@ -43,56 +43,42 @@
self, self,
unstable, unstable,
flake-utils, flake-utils,
nvim-flake,
nixos-generators, nixos-generators,
... ...
}: }: let
lib = unstable.lib;
mkSystems = system: names:
lib.genAttrs names (
name:
lib.nixosSystem {
inherit system;
specialArgs = {
inherit self;
};
modules = [
(import ./modules inputs)
(import ./systems + name inputs)
];
}
);
in
{ {
nixosConfigurations = { nixosConfigurations =
gerg-desktop = unstable.lib.nixosSystem { mkSystems
system = "x86_64-linux"; "x86_64-linux"
specialArgs = { [
inherit self; "gerg-desktop"
}; "game-laptop"
modules = [ "moms-laptop"
(import ./modules inputs) ];
(import ./systems/gerg-desktop inputs)
{
nixpkgs.overlays = [
nvim-flake.overlays.default
];
}
];
};
game-laptop = unstable.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit self;
};
modules = [
(import ./modules inputs)
(import ./systems/game-laptop inputs)
];
};
moms-laptop = unstable.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit self;
};
modules = [
(import ./modules inputs)
(import ./systems/moms-laptop inputs)
];
};
};
} }
// flake-utils.lib.eachDefaultSystem ( // flake-utils.lib.eachDefaultSystem (
system: let system: let
pkgs = import unstable {inherit system;}; pkgs = import unstable {inherit system;};
in { in {
formatter = pkgs.alejandra; formatter = pkgs.alejandra;
devShells = rec { devShells = {
nix = pkgs.mkShell { default = pkgs.mkShell {
packages = [ packages = [
pkgs.sops pkgs.sops
pkgs.nil pkgs.nil
@ -101,7 +87,6 @@
pkgs.statix pkgs.statix
]; ];
}; };
default = nix;
}; };
packages = packages =
{ {

View file

@ -45,6 +45,10 @@ inputs: {
"steam-original" "steam-original"
]; ];
nixpkgs.overlays = [
inputs.nvim-flake.overlays.default
];
environment.systemPackages = [ environment.systemPackages = [
pkgs.bitwarden #store stuff pkgs.bitwarden #store stuff
pkgs.qbittorrent #steal stuff pkgs.qbittorrent #steal stuff