flake: simplify

This commit is contained in:
Guanran Wang 2023-12-17 22:00:56 +08:00
parent 1ee4b0ca9a
commit dce2d0d156
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8

View file

@ -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 @@
];
};
};
};
}