summaryrefslogtreecommitdiff
path: root/templates/basic/flake.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2024-05-22 01:29:01 -0400
committerseth <[email protected]>2024-05-22 16:21:31 -0600
commitabde8d6e3ac86811d4333f5491a08576db013dfc (patch)
tree052685685706dbd049a00e17ea293799448b7262 /templates/basic/flake.nix
parent859214cf9ad3fe589c557d560c2ee1acafece4f2 (diff)
templates/basic: minor cleanup
Diffstat (limited to 'templates/basic/flake.nix')
-rw-r--r--templates/basic/flake.nix27
1 files changed, 17 insertions, 10 deletions
diff --git a/templates/basic/flake.nix b/templates/basic/flake.nix
index 56675f3..53ab44b 100644
--- a/templates/basic/flake.nix
+++ b/templates/basic/flake.nix
@@ -10,8 +10,6 @@
nixpkgs,
...
}: let
- inherit (nixpkgs) lib;
-
systems = [
"x86_64-linux"
"aarch64-linux"
@@ -19,27 +17,36 @@
"aarch64-darwin"
];
- forAllSystems = fn: lib.genAttrs systems (sys: fn nixpkgs.legacyPackages.${sys});
+ forAllSystems = fn: nixpkgs.lib.genAttrs systems (sys: fn nixpkgs.legacyPackages.${sys});
+ version = self.shortRev or self.dirtyShortRev or "unknown";
in {
- devShells = forAllSystems (pkgs: {
+ devShells = forAllSystems ({
+ pkgs,
+ system,
+ ...
+ }: {
default = pkgs.mkShell {
packages = with pkgs; [
bash
];
+
+ inputsFrom = [self.packages.${system}.hello];
};
});
formatter = forAllSystems (pkgs: pkgs.alejandra);
- packages = forAllSystems (pkgs: let
- pkgs' = lib.fix (final: self.overlays.default final pkgs);
- in {
- inherit (pkgs') hello;
- default = pkgs'.hello;
+ packages = forAllSystems ({
+ pkgs,
+ system,
+ ...
+ }: {
+ hello = pkgs.callPackage ./. {inherit version;};
+ default = self.packages.${system}.hello;
});
overlays.default = _: prev: {
- foo = prev.callPackage ./. {inherit self;};
+ hello = prev.callPackage ./. {inherit version;};
};
};
}