feat(flake): move to withSystem & implement defaults system input

This commit is contained in:
ooks-io 2024-06-16 15:40:41 +12:00
parent 2152c91101
commit f9a2e83e74
4 changed files with 64 additions and 72 deletions

View file

@ -1,64 +1,66 @@
{ inputs, self, ... }:
{ inputs, self, withSystem, ... }:
let
inherit (inputs.nixpkgs.lib) nixosSystem;
inherit (self) keys;
hm = inputs.home-manager.nixosModules.home-manager;
nixarr = inputs.nixarr.nixosModules.default;
agenix = inputs.agenix.nixosModules.default;
nixosModules = "${self}/nixos";
hosts = "${self}/hosts";
specialArgs = {inherit inputs self;};
specialArgs = {inherit withSystem keys inputs self;};
in
{
flake.nixosConfigurations = {
ooksdesk = nixosSystem {
inherit specialArgs;
system = "x86_64-linux";
modules = [
"${hosts}/ooksdesk"
hm
nixosModules
];
};
ookst480s = nixosSystem {
inherit specialArgs;
system = "x86_64-linux";
modules = [
"${hosts}/ookst480s"
hm
nixosModules
];
};
ooksmedia = nixosSystem {
inherit specialArgs;
system = "x86_64-linux";
modules = [
"${hosts}/ooksmedia"
hm
nixosModules
nixarr
];
};
ooksmicro = nixosSystem {
inherit specialArgs;
system = "x86_64-linux";
modules = [
"${hosts}/ooksmicro"
hm
nixosModules
];
};
ooksx1 = nixosSystem {
inherit specialArgs;
system = "x86_64-linux";
modules = [
"${hosts}/ooksx1"
hm
nixosModules
];
};
ooksdesk = nixosSystem {
inherit specialArgs;
system = "x86_64-linux";
modules = [
"${hosts}/ooksdesk"
hm
agenix
nixosModules
];
};
ookst480s = nixosSystem {
inherit specialArgs;
system = "x86_64-linux";
modules = [
"${hosts}/ookst480s"
hm
nixosModules
];
};
ooksmedia = nixosSystem {
inherit specialArgs;
system = "x86_64-linux";
modules = [
"${hosts}/ooksmedia"
hm
nixosModules
nixarr
];
};
ooksmicro = nixosSystem {
inherit specialArgs;
system = "x86_64-linux";
modules = [
"${hosts}/ooksmicro"
hm
nixosModules
];
};
ooksx1 = nixosSystem {
inherit specialArgs;
system = "x86_64-linux";
modules = [
"${hosts}/ooksx1"
hm
nixosModules
];
};
}

View file

@ -1,7 +0,0 @@
{ pkgs ? (import ./nixpkgs.nix) { } }: {
default = pkgs.mkShell {
# Enable experimental features without having to specify the argument
NIX_CONFIG = "experimental-features = nix-command flakes";
nativeBuildInputs = with pkgs; [ nix home-manager git neovim ];
};
}