on master help sign in
5 files changed+18−16
since splitsnapshots
unifiedsplit
appdir.nix+2−2 appimagetool.nix+2−2 default.nix+12−10 flake.nix+1−1 nix-bundle.sh+1−1
appdir.nix+2−2
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, muslPkgs, perl, pathsFromGraph, fetchFromGitHub, coreutils, bash }:
1+{ stdenv, lib, fetchurl, muslPkgs, perl, pathsFromGraph, fetchFromGitHub, coreutils, bash }:
22
33let
44 AppRun = targets: muslPkgs.stdenv.mkDerivation {
@@ -8,7 +8,7 @@ let
88
99 buildPhase = ''
1010 CC="$CC -O2 -Wall -Wno-deprecated-declarations -Wno-unused-result -static"
11− $CC ${./AppRun.c} -o AppRun -DENV_PATH='"${stdenv.lib.makeBinPath targets}"'
11+ $CC ${./AppRun.c} -o AppRun -DENV_PATH='"${lib.makeBinPath targets}"'
1212 '';
1313
1414 installPhase = ''
appimagetool.nix+2−2
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, fuse, zlib, squashfsTools, glib }:
1+{ stdenv, lib, fetchurl, fuse, zlib, squashfsTools, glib }:
22
33# This is from some binaries.
44
@@ -37,7 +37,7 @@ in stdenv.mkDerivation rec {
3737 for x in $out/bin/*; do
3838 patchelf \
3939 --set-interpreter ${dynamicLinker} \
40− --set-rpath ${stdenv.lib.makeLibraryPath [ zlib stdenv.glibc.out fuse glib ]} \
40+ --set-rpath ${lib.makeLibraryPath [ zlib stdenv.glibc.out fuse glib ]} \
4141 $x
4242 done
4343 '';
default.nix+12−10
@@ -11,10 +11,11 @@ let
1111 });
1212in rec {
1313 toStorePath = target:
14− # If a store path has been given but is a string, add the missing context
14+ # If a store path has been given but is not a derivation, add the missing context
1515 # to it so it will be propagated properly as a build input.
16− if builtins.isString target && lib.isStorePath target then
17− builtins.appendContext target { "${target}" = { path = true; }; }
16+ if !(lib.isDerivation target) && lib.isStorePath target then
17+ let path = toString target; in
18+ builtins.appendContext path { "${path}" = { path = true; }; }
1819 # Otherwise, add to the store. This takes care of appending the store path
1920 # in the context automatically.
2021 else "${target}";
@@ -44,7 +45,7 @@ in rec {
4445 };
4546
4647 # TODO: eventually should this go in nixpkgs?
47− nix-user-chroot = stdenv.lib.makeOverridable stdenv.mkDerivation {
48+ nix-user-chroot = lib.makeOverridable stdenv.mkDerivation {
4849 name = "nix-user-chroot-2c52b5f";
4950 src = ./nix-user-chroot;
5051
@@ -79,19 +80,20 @@ in rec {
7980 };
8081 };
8182
82− makeStartup = { target, nixUserChrootFlags, nix-user-chroot', run }:
83+ makeStartup = { target, nixUserChrootFlags, nix-user-chroot', run, initScript }:
8384 let
8485 # Avoid re-adding a store path into the store
8586 path = toStorePath target;
8687 in
8788 writeScript "startup" ''
8889 #!/bin/sh
90+ ${initScript}
8991 .${nix-user-chroot'}/bin/nix-user-chroot -n ./nix ${nixUserChrootFlags} -- ${path}${run} "$@"
9092 '';
9193
92− nix-bootstrap = { target, extraTargets ? [], run, nix-user-chroot' ? nix-user-chroot, nixUserChrootFlags ? "" }:
94+ nix-bootstrap = { target, extraTargets ? [], run, nix-user-chroot' ? nix-user-chroot, nixUserChrootFlags ? "", initScript ? "" }:
9395 let
94− script = makeStartup { inherit target nixUserChrootFlags nix-user-chroot' run; };
96+ script = makeStartup { inherit target nixUserChrootFlags nix-user-chroot' run initScript; };
9597 in makebootstrap {
9698 startup = ".${script} '\"$@\"'";
9799 targets = [ "${script}" ] ++ extraTargets;
@@ -108,10 +110,10 @@ in rec {
108110 nix-user-chroot'' = targets: nix-user-chroot.overrideDerivation (o: {
109111 buildInputs = o.buildInputs ++ targets;
110112 makeFlags = o.makeFlags ++ [
111− ''ENV_PATH="${stdenv.lib.makeBinPath targets}"''
113+ ''ENV_PATH="${lib.makeBinPath targets}"''
112114 ];
113− }); in { target, extraTargets ? [], run }: nix-bootstrap {
114− inherit target extraTargets run;
115+ }); in { target, extraTargets ? [], run, initScript ? "" }: nix-bootstrap {
116+ inherit target extraTargets run initScript;
115117 nix-user-chroot' = nix-user-chroot'' extraTargets;
116118 };
117119}
flake.nix+1−1
@@ -13,7 +13,7 @@
1313 nix-bundle = import self { nixpkgs = nixpkgs'; };
1414 script = nixpkgs'.writeScript "startup" ''
1515 #!/bin/sh
16− .${nix-bundle.nix-user-chroot}/bin/nix-user-chroot -n ./nix -- ${program} $@
16+ .${nix-bundle.nix-user-chroot}/bin/nix-user-chroot -n ./nix -- ${program} "$@"
1717 '';
1818 in nix-bundle.makebootstrap {
1919 targets = [ script ];
nix-bundle.sh+1−1
@@ -59,5 +59,5 @@ elif [ -t 1 ]; then
5959 echo "Nix bundle created at $filename."
6060 cp -f "$out" "$filename"
6161else
62− cat "$out"
62+ echo "$out"
6363fi