Add multi-arch support using flake-utils

This commit is contained in:
Oleks
2026-03-13 01:00:27 +02:00
parent defab066bd
commit 2e91b76026
2 changed files with 64 additions and 26 deletions
+30 -26
View File
@@ -4,6 +4,7 @@
inputs = {
fleet-pins.url = "git+https://git.oleks.space/oleks/fleet-pins?ref=main";
nixpkgs.follows = "fleet-pins/nixpkgs-projects";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
@@ -11,34 +12,37 @@
self,
nixpkgs,
fleet-pins,
flake-utils,
...
}:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in
{
packages.${system} = rec {
hello-world = pkgs.callPackage ./packages/hello-world.nix { };
xonsh = pkgs.callPackage ./packages/xonsh.nix { };
default = hello-world;
};
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
in
{
packages = rec {
hello-world = pkgs.callPackage ./packages/hello-world.nix { };
xonsh = pkgs.callPackage ./packages/xonsh.nix { };
default = hello-world;
};
overlays.default = final: prev: {
hello-world = final.callPackage ./packages/hello-world.nix { };
xonsh = final.callPackage ./packages/xonsh.nix { };
};
overlays.default = final: prev: {
hello-world = final.callPackage ./packages/hello-world.nix { };
xonsh = final.callPackage ./packages/xonsh.nix { };
};
devShells.${system}.default = pkgs.mkShell {
name = "oleks-hub-shell";
buildInputs = [ self.packages.${system}.hello-world ];
nativeBuildInputs = with pkgs; [
nix
fmt
];
shellHook = ''
echo "Welcome to the oleks Flake hub development shell."
'';
};
};
devShells.default = pkgs.mkShell {
name = "oleks-hub-shell";
buildInputs = [ self.packages.${system}.default ];
nativeBuildInputs = with pkgs; [
nix
fmt
];
shellHook = ''
echo "Welcome to the oleks Flake hub development shell."
'';
};
}
);
}