Skip to content

Commit 58e00c9

Browse files
committed
flake: move in to a let
1 parent 9ad333e commit 58e00c9

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

flake.nix

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,32 @@
2323
)
2424
);
2525
in
26-
inputs.utils.lib.eachDefaultSystem (system: {
27-
bundlers = {
28-
default = inputs.self.bundlers.${system}.nix-bundle;
29-
nix-bundle =
30-
drv:
26+
inputs.utils.lib.eachDefaultSystem (
27+
system:
28+
let
29+
nix-bundle-fun =
30+
{
31+
drv,
32+
programPath ? getExe drv,
33+
}:
3134
let
32-
program = getExe drv;
3335
nixpkgs = inputs.nixpkgs.legacyPackages.${system};
3436
nix-bundle = import inputs.self { inherit nixpkgs; };
3537
script = nixpkgs.writeScript "startup" ''
3638
#!/bin/sh
37-
.${nix-bundle.nix-user-chroot}/bin/nix-user-chroot -n ./nix -- ${program} "$@"
39+
.${nix-bundle.nix-user-chroot}/bin/nix-user-chroot -n ./nix -- ${programPath} "$@"
3840
'';
3941
in
4042
nix-bundle.makebootstrap {
4143
targets = [ script ];
4244
startup = ".${builtins.unsafeDiscardStringContext script} '\"$@\"'";
4345
};
44-
};
45-
});
46+
in
47+
{
48+
bundlers = {
49+
default = inputs.self.bundlers.${system}.nix-bundle;
50+
nix-bundle = drv: nix-bundle-fun { inherit drv; };
51+
};
52+
}
53+
);
4654
}

0 commit comments

Comments
 (0)