flake: allow overriding flake-parts systems

This commit is contained in:
raf 2024-07-22 00:33:41 +03:00
parent e6c84d0f29
commit 512639d692
Signed by: NotAShelf
GPG key ID: AF26552424E53993
2 changed files with 27 additions and 5 deletions

View file

@ -66,7 +66,23 @@
"inputs": {
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"systems": "systems"
}
},
"systems": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
}
},

View file

@ -4,6 +4,7 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
systems.url = "github:nix-systems/default-linux";
flake-compat = {
url = "github:edolstra/flake-compat";
@ -12,15 +13,15 @@
};
outputs = {
self,
nixpkgs,
flake-parts,
self,
...
} @ inputs: let
pins = import ./npins;
in
flake-parts.lib.mkFlake {inherit inputs self;} {
systems = ["x86_64-linux" "aarch64-linux"];
systems = import inputs.systems;
imports = [flake-parts.flakeModules.easyOverlay];
perSystem = {
@ -43,8 +44,13 @@
directory = ./pkgs;
};
formatter = pkgs.alejandra;
devShells.default = with pkgs; mkShell {buildInputs = [npins];};
formatter = config.packages.alejandra-custom;
devShells = {
default = self.devShells.${system}.npins;
npins = pkgs.mkShellNoCC {
packages = [pkgs.npins];
};
};
};
};
}