Skip to content

Commit 784af41

Browse files
committed
refactor(flake): Update Flake usage to avoid Nix warnings
1 parent d1b0f95 commit 784af41

File tree

1 file changed

+16
-26
lines changed

1 file changed

+16
-26
lines changed

flake.nix

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,31 @@
1212
cargoToml = (builtins.fromTOML (builtins.readFile ./Cargo.toml));
1313
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
1414
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
15+
pkgsFor = forAllSystems (system:
16+
import nixpkgs {
17+
inherit system;
18+
overlays = [ self.overlays.default ];
19+
});
1520
in
1621
{
1722
overlays.default = final: prev: {
1823
"${cargoToml.package.name}" = final.callPackage ./. { inherit naersk; };
1924
};
20-
packages = forAllSystems (system:
25+
packages = forAllSystems (system: {
26+
default = pkgsFor.${system}.${cargoToml.package.name};
27+
${cargoToml.package.name} = pkgsFor.${system}.${cargoToml.package.name};
28+
});
29+
devShells = forAllSystems (system:
2130
let
22-
pkgs = import nixpkgs {
23-
inherit system;
24-
overlays = [
25-
self.overlays.default
26-
];
27-
};
31+
pkgs = pkgsFor.${system};
2832
in
2933
{
30-
"${cargoToml.package.name}" = pkgs."${cargoToml.package.name}";
31-
});
32-
defaultPackage = forAllSystems (system: (import nixpkgs {
33-
inherit system;
34-
overlays = [ self.overlays.default ];
35-
})."${cargoToml.package.name}");
36-
devShell = forAllSystems (system:
37-
let
38-
pkgs = import nixpkgs {
39-
inherit system;
40-
overlays = [ self.overlays.default ];
34+
default = pkgs.mkShell {
35+
inputsFrom = [ pkgs.${cargoToml.package.name} ];
36+
buildInputs = with pkgs; [
37+
libgit2
38+
];
4139
};
42-
in
43-
pkgs.mkShell {
44-
inputsFrom = with pkgs; [
45-
pkgs."${cargoToml.package.name}"
46-
];
47-
buildInputs = with pkgs; [
48-
libgit2
49-
];
5040
});
5141
};
5242
}

0 commit comments

Comments
 (0)