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

View file

@ -1,13 +1,42 @@
{
description = "Repo RS";
description = "repo-rs";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable";
};
outputs = { self, nixpkgs }: {
devShells.x86_64-linux.default = import ./shell.nix { pkgs = nixpkgs.legacyPackages.x86_64-linux; };
packages.x86_64-linux.repo-rs = nixpkgs.legacyPackages.x86_64-linux.callPackage ./. { };
packages.x86_64-linux.default = self.packages.x86_64-linux.repo-rs;
};
outputs =
{ self, nixpkgs }:
let
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;
}
);
};
}