flake: simplify
This commit is contained in:
parent
1ee4b0ca9a
commit
dce2d0d156
1 changed files with 49 additions and 45 deletions
24
flake.nix
24
flake.nix
|
@ -155,6 +155,18 @@
|
|||
|
||||
outputs = inputs: let
|
||||
inherit (inputs.flake-utils.lib) eachDefaultSystemMap;
|
||||
|
||||
mkNixOS = system: modules:
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
inherit system modules;
|
||||
specialArgs = {inherit inputs;};
|
||||
};
|
||||
|
||||
mkDarwin = system: modules:
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
inherit system modules;
|
||||
specialArgs = {inherit inputs;};
|
||||
};
|
||||
in {
|
||||
formatter = eachDefaultSystemMap (system: inputs.nixpkgs.legacyPackages.${system}.alejandra);
|
||||
packages = eachDefaultSystemMap (system: import ./pkgs inputs.nixpkgs.legacyPackages.${system});
|
||||
|
@ -162,10 +174,7 @@
|
|||
|
||||
### NixOS
|
||||
nixosConfigurations = {
|
||||
"Aristotle" = inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {inherit inputs;};
|
||||
modules = [
|
||||
"Aristotle" = mkNixOS "x86_64-linux" [
|
||||
# OS
|
||||
./nixos/profiles/core
|
||||
./nixos/profiles/device-type/laptop
|
||||
|
@ -194,14 +203,10 @@
|
|||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
### Darwin
|
||||
darwinConfigurations = {
|
||||
"Plato" = inputs.nix-darwin.lib.darwinSystem {
|
||||
system = "x86_64-darwin";
|
||||
specialArgs = {inherit inputs;};
|
||||
modules = [
|
||||
"Plato" = mkDarwin "x86_64-darwin" [
|
||||
./darwin/profiles/core
|
||||
./darwin/profiles/device-type/desktop
|
||||
|
||||
|
@ -218,5 +223,4 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue