nix: switch to crane for incramental builds

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia5ab2f512ffac20722966b605d7eaf156a6a6964
This commit is contained in:
raf 2025-10-31 22:55:30 +03:00
commit 57b739ddbe
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
3 changed files with 50 additions and 24 deletions

View file

@ -1,9 +1,13 @@
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
crane.url = "github:ipetkov/crane";
};
outputs = {
self,
nixpkgs,
crane,
}: let
systems = ["x86_64-linux" "aarch64-linux"];
forEachSystem = nixpkgs.lib.genAttrs systems;
@ -14,8 +18,10 @@
default = self.nixosModules.eris;
};
packages = forEachSystem (system: {
eris = pkgsForEach.${system}.callPackage ./nix/package.nix {};
packages = forEachSystem (system: let
craneLib = crane.mkLib pkgsForEach.${system};
in {
eris = pkgsForEach.${system}.callPackage ./nix/package.nix {inherit craneLib;};
default = self.packages.${system}.eris;
});