fix: make flake work for aarch64 and darwin

This commit is contained in:
Tim Schubert 2025-08-10 21:39:42 +02:00
parent 0cbd36088f
commit d83955f001
No known key found for this signature in database
2 changed files with 40 additions and 11 deletions

8
flake.lock generated
View file

@ -2,16 +2,16 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1754498491, "lastModified": 1754800730,
"narHash": "sha256-erbiH2agUTD0Z30xcVSFcDHzkRvkRXOQ3lb887bcVrs=", "narHash": "sha256-HfVZCXic9XLBgybP0318ym3cDnGwBs/+H5MgxFVYF4I=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c2ae88e026f9525daf89587f3cbee584b92b6134", "rev": "641d909c4a7538f1539da9240dedb1755c907e40",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-unstable", "ref": "nixpkgs-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View file

@ -1,13 +1,42 @@
{ {
description = "Repo RS"; description = "repo-rs";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable";
}; };
outputs = { self, nixpkgs }: { outputs =
devShells.x86_64-linux.default = import ./shell.nix { pkgs = nixpkgs.legacyPackages.x86_64-linux; }; { self, nixpkgs }:
packages.x86_64-linux.repo-rs = nixpkgs.legacyPackages.x86_64-linux.callPackage ./. { }; let
packages.x86_64-linux.default = self.packages.x86_64-linux.repo-rs; systems = [
}; "aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
eachSystem =
f:
nixpkgs.lib.genAttrs systems (
system:
f rec {
inherit system;
pkgs = nixpkgs.legacyPackages.${system};
}
);
in
{
devShells = eachSystem (
{ pkgs, ... }:
{
default = import ./shell.nix { inherit pkgs; };
}
);
packages = eachSystem (
{ pkgs, system, ... }:
{
repo-rs = pkgs.callPackage ./. { };
default = self.packages.${system}.repo-rs;
}
);
};
} }