flake: formatter: use genAttrs

This commit is contained in:
Guanran Wang 2023-12-03 16:41:22 +08:00
parent 887c187cb0
commit 82d46b221e
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8
2 changed files with 29 additions and 10 deletions

View file

@ -191,7 +191,7 @@
"nixpkgs" "nixpkgs"
], ],
"systems": [ "systems": [
"systems" "systems-linux"
], ],
"wlroots": [ "wlroots": [
"wlroots" "wlroots"
@ -240,7 +240,7 @@
"nixpkgs" "nixpkgs"
], ],
"systems": [ "systems": [
"systems" "systems-linux"
] ]
}, },
"locked": { "locked": {
@ -517,6 +517,7 @@
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"spicetify-nix": "spicetify-nix", "spicetify-nix": "spicetify-nix",
"systems": "systems", "systems": "systems",
"systems-linux": "systems-linux",
"wlroots": "wlroots", "wlroots": "wlroots",
"xdph": "xdph" "xdph": "xdph"
} }
@ -591,6 +592,21 @@
} }
}, },
"systems": { "systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems-linux": {
"locked": { "locked": {
"lastModified": 1689347949, "lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
@ -632,7 +648,7 @@
"nixpkgs" "nixpkgs"
], ],
"systems": [ "systems": [
"systems" "systems-linux"
] ]
}, },
"locked": { "locked": {

View file

@ -25,7 +25,7 @@
url = "github:hyprwm/Hyprland"; url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.hyprland-protocols.follows = "hyprland-protocols"; inputs.hyprland-protocols.follows = "hyprland-protocols";
inputs.systems.follows = "systems"; inputs.systems.follows = "systems-linux";
inputs.wlroots.follows = "wlroots"; inputs.wlroots.follows = "wlroots";
inputs.xdph.follows = "xdph"; inputs.xdph.follows = "xdph";
}; };
@ -70,6 +70,8 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils"; inputs.flake-utils.follows = "flake-utils";
}; };
systems.url = "github:nix-systems/default";
systems-linux.url = "github:nix-systems/default-linux";
### De-dupe ### De-dupe
crane = { crane = {
@ -99,7 +101,7 @@
hyprland-protocols = { hyprland-protocols = {
url = "github:hyprwm/hyprland-protocols"; url = "github:hyprwm/hyprland-protocols";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.systems.follows = "systems"; inputs.systems.follows = "systems-linux";
}; };
nvfetcher = { nvfetcher = {
url = "github:berberman/nvfetcher"; url = "github:berberman/nvfetcher";
@ -120,7 +122,7 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils"; inputs.flake-utils.follows = "flake-utils";
}; };
systems.url = "github:nix-systems/default-linux";
wlroots = { wlroots = {
type = "gitlab"; type = "gitlab";
host = "gitlab.freedesktop.org"; host = "gitlab.freedesktop.org";
@ -132,7 +134,7 @@
url = "github:hyprwm/xdg-desktop-portal-hyprland"; url = "github:hyprwm/xdg-desktop-portal-hyprland";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.hyprland-protocols.follows = "hyprland-protocols"; inputs.hyprland-protocols.follows = "hyprland-protocols";
inputs.systems.follows = "systems"; inputs.systems.follows = "systems-linux";
}; };
# TODO: Unused, Soon(TM) # TODO: Unused, Soon(TM)
@ -150,9 +152,10 @@
}; };
}; };
outputs = inputs: { outputs = inputs: let
formatter.x86_64-linux = inputs.nixpkgs.legacyPackages.x86_64-linux.alejandra; eachSystem = inputs.nixpkgs.lib.genAttrs (import inputs.systems);
formatter.x86_64-darwin = inputs.nixpkgs.legacyPackages.x86_64-darwin.alejandra; in {
formatter = eachSystem (system: inputs.nixpkgs.legacyPackages.${system}.alejandra);
### NixOS ### NixOS
nixosConfigurations = { nixosConfigurations = {