flake: replace forAllSystems with eachSystem

This commit is contained in:
Jacob Birkett 2024-02-01 23:37:05 -07:00
parent f5aef0b4d2
commit 35b4ac836b
2 changed files with 25 additions and 6 deletions

View file

@ -93,7 +93,8 @@
"root": {
"inputs": {
"alejandra": "alejandra",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_2",
"systems": "systems"
}
},
"rust-analyzer-src": {
@ -112,6 +113,21 @@
"repo": "rust-analyzer",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View file

@ -14,10 +14,13 @@
alejandra,
}: let
inherit (nixpkgs.lib) genAttrs;
forAllSystems = f:
genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
eachSystem = fn:
genAttrs (import systems) (system: let
pkgs = import nixpkgs {localSystem.system = system;};
in
fn system pkgs);
in {
packages = forAllSystems (pkgs:
packages = eachSystem (_: pkgs:
with pkgs; {
default = stdenv.mkDerivation {
name = "monolisa-nerdfont-patch";
@ -40,11 +43,11 @@
};
});
devShells = forAllSystems (pkgs:
devShells = eachSystem (_: pkgs:
with pkgs; {
default = mkShell {buildInputs = [fontforge python3 pre-commit];};
});
formatter.x86_64-linux = alejandra.packages.x86_64-linux.default;
formatter = eachSystem (system: _: alejandra.packages.${system}.default);
};
}