From 66755e8a78211ed38c8d6b282d5221d97f0fe664 Mon Sep 17 00:00:00 2001 From: Simon Parri Date: Tue, 27 May 2025 22:02:57 -0500 Subject: hosts/ades: Add initial version of live ISO with ades' configuration --- hosts/ades/thin-shim.nix | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 hosts/ades/thin-shim.nix (limited to 'hosts/ades/thin-shim.nix') diff --git a/hosts/ades/thin-shim.nix b/hosts/ades/thin-shim.nix new file mode 100644 index 0000000..a9f931b --- /dev/null +++ b/hosts/ades/thin-shim.nix @@ -0,0 +1,41 @@ +pkgs: +let + inherit (builtins) + map elem; + + inherit (pkgs) stdenv; +in +pkg: inst: +stdenv.mkDerivation { + pname = pkg.pname + "-shim"; + version = pkg.version; + nativeBuildInputs = [pkg]; + dontUnpack = true; + buildPhase = '' +if [ -d ${pkg}/bin ]; then + mkdir -p "$out/bin" + for exe in $(ls "${pkg}/bin/"); do + cat >"$out/bin/$exe" </dev/null 2>&1 || term=xterm + +if [ "\$DISPLAY" ]; then + \$term -e nix shell '${inst}' --command '$exe' \$* +else + nix shell '${inst}' --command '$exe' \$* +fi +EOF + chmod +x "$out/bin/$exe" + done +fi + +for dir in "share/applications" "share/icons"; do + if [ -d "${pkg}/$dir" ]; then + mkdir -p "$out/$dir" + cp -a "${pkg}/$dir/"* "$out/$dir" + fi +done +''; +} -- cgit v1.2.3