diff --git a/.github/workflows/compare-nix.yml b/.github/workflows/compare-nix.yml index 27e6f40..70df69a 100644 --- a/.github/workflows/compare-nix.yml +++ b/.github/workflows/compare-nix.yml @@ -63,8 +63,7 @@ jobs: nix profile install \ 'nixpkgs#sqlite^bin,out,dev' \ 'nixpkgs#pkg-config' \ - "$selfURI#profile-base" \ - "$selfURI#profile-common-paths" \ + "$selfURI#etc-profiles" \ ; export FLOX_ENV="$HOME/.nix-profile"; diff --git a/.github/workflows/trivial-test.yml b/.github/workflows/trivial-test.yml index 9351284..f77ed6e 100644 --- a/.github/workflows/trivial-test.yml +++ b/.github/workflows/trivial-test.yml @@ -90,8 +90,7 @@ jobs: fi echo "selfURI: $selfURI" >&2; echo "Installing locally defined deps" >&2; - flox install -e sqlite-dev "$selfURI#profile-base"; - flox install -e sqlite-dev "$selfURI#profile-common-paths"; + flox install -e sqlite-dev "$selfURI#etc-profiles"; # Have to work around a bunch of unset variables that get us killed # when `set -eu; set -o pipefail;' is active. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4a4b1d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.flox diff --git a/README.org b/README.org index c5fa344..529c178 100644 --- a/README.org +++ b/README.org @@ -40,3 +40,10 @@ Recommended usage: - [[file:./profile.d/0500_node.sh][profile-node]] sets =NODE_PATH=. + Only runs if =node= is in =PATH=, so it is a sane member of a robust =profile.d= collection. + + +* Environment Variables +- flox uses the ~LD_AUDIT~ environment variable as the mechanism + for loading shared libraries from the flox environment. + Define ~LD_FLOXLIB_AUDIT_IMPURE=1~ to view the substitutions + taking place. diff --git a/flake.lock b/flake.lock index 674ce4c..c862f24 100644 --- a/flake.lock +++ b/flake.lock @@ -1,12 +1,903 @@ { "nodes": { + "builtfilter": { + "inputs": { + "flox-floxpkgs": [ + "flox-floxpkgs" + ] + }, + "locked": { + "lastModified": 1683889736, + "narHash": "sha256-Sxn6VNrojAl9Tu0dDy6ZqPUe0GNwRKwzHAkptXM63Wg=", + "owner": "flox", + "repo": "builtfilter", + "rev": "f29903b144bb20e5be80f55d3fafa323c28a2cb0", + "type": "github" + }, + "original": { + "owner": "flox", + "ref": "builtfilter-rs", + "repo": "builtfilter", + "type": "github" + } + }, + "builtfilter_2": { + "inputs": { + "flox-floxpkgs": [ + "ld-floxlib", + "flox-floxpkgs" + ] + }, + "locked": { + "lastModified": 1683889736, + "narHash": "sha256-Sxn6VNrojAl9Tu0dDy6ZqPUe0GNwRKwzHAkptXM63Wg=", + "owner": "flox", + "repo": "builtfilter", + "rev": "f29903b144bb20e5be80f55d3fafa323c28a2cb0", + "type": "github" + }, + "original": { + "owner": "flox", + "ref": "builtfilter-rs", + "repo": "builtfilter", + "type": "github" + } + }, + "capacitor": { + "inputs": { + "nixpkgs": "nixpkgs", + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1675629156, + "narHash": "sha256-55UOZa4MUTgCwyK8jrskwFLATDuMAvXyC7GGcsF45Xg=", + "owner": "flox", + "repo": "capacitor", + "rev": "0694a193660db2cb1a7a6e04949478b25f81d802", + "type": "github" + }, + "original": { + "owner": "flox", + "ref": "v0", + "repo": "capacitor", + "type": "github" + } + }, + "capacitor_2": { + "inputs": { + "nixpkgs": [ + "flox-floxpkgs", + "nixpkgs", + "nixpkgs" + ], + "nixpkgs-lib": "nixpkgs-lib_2" + }, + "locked": { + "lastModified": 1675629156, + "narHash": "sha256-55UOZa4MUTgCwyK8jrskwFLATDuMAvXyC7GGcsF45Xg=", + "owner": "flox", + "repo": "capacitor", + "rev": "0694a193660db2cb1a7a6e04949478b25f81d802", + "type": "github" + }, + "original": { + "owner": "flox", + "repo": "capacitor", + "type": "github" + } + }, + "capacitor_3": { + "inputs": { + "nixpkgs": "nixpkgs_7", + "nixpkgs-lib": "nixpkgs-lib_3" + }, + "locked": { + "lastModified": 1675629156, + "narHash": "sha256-55UOZa4MUTgCwyK8jrskwFLATDuMAvXyC7GGcsF45Xg=", + "owner": "flox", + "repo": "capacitor", + "rev": "0694a193660db2cb1a7a6e04949478b25f81d802", + "type": "github" + }, + "original": { + "owner": "flox", + "ref": "v0", + "repo": "capacitor", + "type": "github" + } + }, + "capacitor_4": { + "inputs": { + "nixpkgs": [ + "ld-floxlib", + "flox-floxpkgs", + "nixpkgs", + "nixpkgs" + ], + "nixpkgs-lib": "nixpkgs-lib_4" + }, + "locked": { + "lastModified": 1675629156, + "narHash": "sha256-55UOZa4MUTgCwyK8jrskwFLATDuMAvXyC7GGcsF45Xg=", + "owner": "flox", + "repo": "capacitor", + "rev": "0694a193660db2cb1a7a6e04949478b25f81d802", + "type": "github" + }, + "original": { + "owner": "flox", + "repo": "capacitor", + "type": "github" + } + }, + "crane": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_2", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1686621798, + "narHash": "sha256-FUwWszmSiDzUdTk8f69xwMoYlhdPaLvDaIYOE/y6VXc=", + "owner": "ipetkov", + "repo": "crane", + "rev": "75f7d715f8088f741be9981405f6444e2d49efdd", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "crane_2": { + "inputs": { + "flake-compat": "flake-compat_3", + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_8", + "rust-overlay": "rust-overlay_2" + }, + "locked": { + "lastModified": 1686621798, + "narHash": "sha256-FUwWszmSiDzUdTk8f69xwMoYlhdPaLvDaIYOE/y6VXc=", + "owner": "ipetkov", + "repo": "crane", + "rev": "75f7d715f8088f741be9981405f6444e2d49efdd", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { + "inputs": { + "systems": "systems_4" + }, + "locked": { + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "floco": { + "inputs": { + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1684245865, + "narHash": "sha256-CJSxo7fvAAjdMaQWALyNG6LKMjOGZC/uxlbX1KuegWU=", + "owner": "aakropotkin", + "repo": "floco", + "rev": "e1231f054258f7d62652109725881767765b1efb", + "type": "github" + }, + "original": { + "owner": "aakropotkin", + "repo": "floco", + "rev": "e1231f054258f7d62652109725881767765b1efb", + "type": "github" + } + }, + "floco_2": { + "inputs": { + "nixpkgs": "nixpkgs_9" + }, + "locked": { + "lastModified": 1684245865, + "narHash": "sha256-CJSxo7fvAAjdMaQWALyNG6LKMjOGZC/uxlbX1KuegWU=", + "owner": "aakropotkin", + "repo": "floco", + "rev": "e1231f054258f7d62652109725881767765b1efb", + "type": "github" + }, + "original": { + "owner": "aakropotkin", + "repo": "floco", + "rev": "e1231f054258f7d62652109725881767765b1efb", + "type": "github" + } + }, + "flox": { + "inputs": { + "crane": "crane", + "floco": "floco", + "flox-floxpkgs": [ + "flox-floxpkgs" + ], + "shellHooks": "shellHooks" + }, + "locked": { + "lastModified": 1686824858, + "narHash": "sha256-29En5YzPyNPTuKbEbc/19R0TjwyS+ZiD+xob+dCocOk=", + "ref": "latest", + "rev": "1ab9bb637a4871c9a8cf9ceaefa1f5b9d8bc8234", + "revCount": 519, + "type": "git", + "url": "ssh://git@github.com/flox/flox" + }, + "original": { + "ref": "latest", + "type": "git", + "url": "ssh://git@github.com/flox/flox" + } + }, + "flox-floxpkgs": { + "inputs": { + "builtfilter": "builtfilter", + "capacitor": "capacitor", + "flox": "flox", + "nixpkgs": "nixpkgs_5", + "tracelinks": "tracelinks" + }, + "locked": { + "lastModified": 1686837422, + "narHash": "sha256-0TEROGrrjVs1zuQ5+7dxHCiThrzhZvg59rzLFjdmIkk=", + "owner": "flox", + "repo": "floxpkgs", + "rev": "58eae1f5e90cd4ce790502ee4b13cddb4f49597f", + "type": "github" + }, + "original": { + "owner": "flox", + "repo": "floxpkgs", + "type": "github" + } + }, + "flox-floxpkgs_2": { + "inputs": { + "builtfilter": "builtfilter_2", + "capacitor": "capacitor_3", + "flox": "flox_2", + "nixpkgs": "nixpkgs_11", + "tracelinks": "tracelinks_2" + }, + "locked": { + "lastModified": 1686828047, + "narHash": "sha256-KgqjjeWoAvwE+4ie27y+E2ZhwNkU2n3pIKqlJatiJqs=", + "owner": "flox", + "repo": "floxpkgs", + "rev": "d12b0310b8fefe279589fd771d194bca0f560f08", + "type": "github" + }, + "original": { + "owner": "flox", + "repo": "floxpkgs", + "type": "github" + } + }, + "flox_2": { + "inputs": { + "crane": "crane_2", + "floco": "floco_2", + "flox-floxpkgs": [ + "ld-floxlib", + "flox-floxpkgs" + ], + "shellHooks": "shellHooks_2" + }, + "locked": { + "lastModified": 1686824858, + "narHash": "sha256-29En5YzPyNPTuKbEbc/19R0TjwyS+ZiD+xob+dCocOk=", + "ref": "latest", + "rev": "1ab9bb637a4871c9a8cf9ceaefa1f5b9d8bc8234", + "revCount": 519, + "type": "git", + "url": "ssh://git@github.com/flox/flox" + }, + "original": { + "ref": "latest", + "type": "git", + "url": "ssh://git@github.com/flox/flox" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "flox-floxpkgs", + "flox", + "shellHooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_2": { + "inputs": { + "nixpkgs": [ + "ld-floxlib", + "flox-floxpkgs", + "flox", + "shellHooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "ld-floxlib": { + "inputs": { + "flox-floxpkgs": "flox-floxpkgs_2" + }, + "locked": { + "lastModified": 1686896430, + "narHash": "sha256-VA9ywbsxHU1vbaTNmVuXaS4Rj2hPCJw9cCpuBVZb97Q=", + "ref": "refs/heads/main", + "rev": "211c74dead2d2f0aff39f46f02d93806630c8fdd", + "revCount": 10, + "type": "git", + "url": "ssh://git@github.com/flox/ld-floxlib" + }, + "original": { + "type": "git", + "url": "ssh://git@github.com/flox/ld-floxlib" + } + }, "nixpkgs": { "locked": { - "lastModified": 1669833724, - "narHash": "sha256-/HEZNyGbnQecrgJnfE8d0WC5c1xuPSD2LUpB6YXlg4c=", + "lastModified": 1684754342, + "narHash": "sha256-plGnjnbnPLoZCTdQX21oT7xliQhFtgcWlkuDHgtEb1o=", + "owner": "flox", + "repo": "nixpkgs", + "rev": "7084250df3d7f9735087d3234407f3c1fc2400e3", + "type": "github" + }, + "original": { + "owner": "flox", + "ref": "stable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1686445117, + "narHash": "sha256-QfbAtKFmh92rv0j1e9d7EDgPLDERn1EY6FGXwKG09SM=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "a08e40a9bc625b7ee428bd7b64cdcff516023c5d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-lib_2": { + "locked": { + "lastModified": 1686445117, + "narHash": "sha256-QfbAtKFmh92rv0j1e9d7EDgPLDERn1EY6FGXwKG09SM=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "a08e40a9bc625b7ee428bd7b64cdcff516023c5d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-lib_3": { + "locked": { + "lastModified": 1686445117, + "narHash": "sha256-QfbAtKFmh92rv0j1e9d7EDgPLDERn1EY6FGXwKG09SM=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "a08e40a9bc625b7ee428bd7b64cdcff516023c5d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-lib_4": { + "locked": { + "lastModified": 1686445117, + "narHash": "sha256-QfbAtKFmh92rv0j1e9d7EDgPLDERn1EY6FGXwKG09SM=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "a08e40a9bc625b7ee428bd7b64cdcff516023c5d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1685801374, + "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { + "locked": { + "lastModified": 1684754342, + "narHash": "sha256-plGnjnbnPLoZCTdQX21oT7xliQhFtgcWlkuDHgtEb1o=", + "owner": "flox", + "repo": "nixpkgs", + "rev": "7084250df3d7f9735087d3234407f3c1fc2400e3", + "type": "github" + }, + "original": { + "owner": "flox", + "ref": "stable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_3": { + "locked": { + "lastModified": 1685801374, + "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_4": { + "locked": { + "lastModified": 1684754342, + "narHash": "sha256-plGnjnbnPLoZCTdQX21oT7xliQhFtgcWlkuDHgtEb1o=", + "owner": "flox", + "repo": "nixpkgs", + "rev": "7084250df3d7f9735087d3234407f3c1fc2400e3", + "type": "github" + }, + "original": { + "owner": "flox", + "ref": "stable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-staging": { + "locked": { + "lastModified": 1684754342, + "narHash": "sha256-plGnjnbnPLoZCTdQX21oT7xliQhFtgcWlkuDHgtEb1o=", + "owner": "flox", + "repo": "nixpkgs", + "rev": "7084250df3d7f9735087d3234407f3c1fc2400e3", + "type": "github" + }, + "original": { + "owner": "flox", + "ref": "staging", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-staging_2": { + "locked": { + "lastModified": 1684754342, + "narHash": "sha256-plGnjnbnPLoZCTdQX21oT7xliQhFtgcWlkuDHgtEb1o=", + "owner": "flox", + "repo": "nixpkgs", + "rev": "7084250df3d7f9735087d3234407f3c1fc2400e3", + "type": "github" + }, + "original": { + "owner": "flox", + "ref": "staging", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1684754342, + "narHash": "sha256-plGnjnbnPLoZCTdQX21oT7xliQhFtgcWlkuDHgtEb1o=", + "owner": "flox", + "repo": "nixpkgs", + "rev": "7084250df3d7f9735087d3234407f3c1fc2400e3", + "type": "github" + }, + "original": { + "owner": "flox", + "ref": "unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable_2": { + "locked": { + "lastModified": 1684754342, + "narHash": "sha256-plGnjnbnPLoZCTdQX21oT7xliQhFtgcWlkuDHgtEb1o=", + "owner": "flox", + "repo": "nixpkgs", + "rev": "7084250df3d7f9735087d3234407f3c1fc2400e3", + "type": "github" + }, + "original": { + "owner": "flox", + "ref": "unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_10": { + "locked": { + "lastModified": 1685866647, + "narHash": "sha256-4jKguNHY/edLYImB+uL8jKPL/vpfOvMmSlLAGfxSrnY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a53a3bec10deef6e1cc1caba5bc60f53b959b1e8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_11": { + "inputs": { + "capacitor": "capacitor_4", + "flox": [ + "ld-floxlib", + "flox-floxpkgs", + "flox" + ], + "flox-floxpkgs": [ + "ld-floxlib", + "flox-floxpkgs" + ], + "nixpkgs": [ + "ld-floxlib", + "flox-floxpkgs", + "nixpkgs", + "nixpkgs-stable" + ], + "nixpkgs-stable": "nixpkgs-stable_4", + "nixpkgs-staging": "nixpkgs-staging_2", + "nixpkgs-unstable": "nixpkgs-unstable_2", + "nixpkgs__flox__aarch64-darwin": "nixpkgs__flox__aarch64-darwin_2", + "nixpkgs__flox__aarch64-linux": "nixpkgs__flox__aarch64-linux_2", + "nixpkgs__flox__i686-linux": "nixpkgs__flox__i686-linux_2", + "nixpkgs__flox__x86_64-darwin": "nixpkgs__flox__x86_64-darwin_2", + "nixpkgs__flox__x86_64-linux": "nixpkgs__flox__x86_64-linux_2" + }, + "locked": { + "lastModified": 1686770319, + "narHash": "sha256-9ffqbrKUa0g2aql8B8SDXTCDzyU8PnW7JI1uisuk0dQ=", + "owner": "flox", + "repo": "nixpkgs-flox", + "rev": "48e8d0cfdc7bc98e9bf4d65a67ea324b3d952ea7", + "type": "github" + }, + "original": { + "owner": "flox", + "repo": "nixpkgs-flox", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1685714850, + "narHash": "sha256-OcvbIJq4CGwwFr9m7M/SQcDPZ64hhR4t77oZgEeh7ZY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c6ffce3d5df7b4c588ce80a0c6e2d2348a611707", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1674236650, + "narHash": "sha256-B4GKL1YdJnII6DQNNJ4wDW1ySJVx2suB1h/v4Ql8J0Q=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "cfb43ad7b941d9c3606fb35d91228da7ebddbfc5", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1685866647, + "narHash": "sha256-4jKguNHY/edLYImB+uL8jKPL/vpfOvMmSlLAGfxSrnY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a53a3bec10deef6e1cc1caba5bc60f53b959b1e8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { + "inputs": { + "capacitor": "capacitor_2", + "flox": [ + "flox-floxpkgs", + "flox" + ], + "flox-floxpkgs": [ + "flox-floxpkgs" + ], + "nixpkgs": "nixpkgs_6", + "nixpkgs-stable": "nixpkgs-stable_2", + "nixpkgs-staging": "nixpkgs-staging", + "nixpkgs-unstable": "nixpkgs-unstable", + "nixpkgs__flox__aarch64-darwin": "nixpkgs__flox__aarch64-darwin", + "nixpkgs__flox__aarch64-linux": "nixpkgs__flox__aarch64-linux", + "nixpkgs__flox__i686-linux": "nixpkgs__flox__i686-linux", + "nixpkgs__flox__x86_64-darwin": "nixpkgs__flox__x86_64-darwin", + "nixpkgs__flox__x86_64-linux": "nixpkgs__flox__x86_64-linux" + }, + "locked": { + "lastModified": 1686770319, + "narHash": "sha256-9ffqbrKUa0g2aql8B8SDXTCDzyU8PnW7JI1uisuk0dQ=", + "owner": "flox", + "repo": "nixpkgs-flox", + "rev": "48e8d0cfdc7bc98e9bf4d65a67ea324b3d952ea7", + "type": "github" + }, + "original": { + "owner": "flox", + "repo": "nixpkgs-flox", + "type": "github" + } + }, + "nixpkgs_6": { + "locked": { + "lastModified": 1684754342, + "narHash": "sha256-plGnjnbnPLoZCTdQX21oT7xliQhFtgcWlkuDHgtEb1o=", + "owner": "flox", + "repo": "nixpkgs", + "rev": "7084250df3d7f9735087d3234407f3c1fc2400e3", + "type": "github" + }, + "original": { + "id": "nixpkgs-stable", + "type": "indirect" + } + }, + "nixpkgs_7": { + "locked": { + "lastModified": 1684754342, + "narHash": "sha256-plGnjnbnPLoZCTdQX21oT7xliQhFtgcWlkuDHgtEb1o=", + "owner": "flox", + "repo": "nixpkgs", + "rev": "7084250df3d7f9735087d3234407f3c1fc2400e3", + "type": "github" + }, + "original": { + "owner": "flox", + "ref": "stable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_8": { + "locked": { + "lastModified": 1685714850, + "narHash": "sha256-OcvbIJq4CGwwFr9m7M/SQcDPZ64hhR4t77oZgEeh7ZY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c6ffce3d5df7b4c588ce80a0c6e2d2348a611707", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_9": { + "locked": { + "lastModified": 1674236650, + "narHash": "sha256-B4GKL1YdJnII6DQNNJ4wDW1ySJVx2suB1h/v4Ql8J0Q=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4d2b37a84fad1091b9de401eb450aae66f1a741e", + "rev": "cfb43ad7b941d9c3606fb35d91228da7ebddbfc5", "type": "github" }, "original": { @@ -14,9 +905,407 @@ "type": "indirect" } }, + "nixpkgs__flox__aarch64-darwin": { + "flake": false, + "locked": { + "host": "catalog.floxsdlc.com", + "lastModified": 1686769905, + "narHash": "sha256-3bTAKno+hbVkaj/7nIuG8CgBuS347E6ksPcwwjcMw78=", + "owner": "flox", + "repo": "nixpkgs-flox", + "rev": "7800311cb0d5c8970021f9f6691115feb0be7c04", + "type": "github" + }, + "original": { + "host": "catalog.floxsdlc.com", + "owner": "flox", + "ref": "aarch64-darwin", + "repo": "nixpkgs-flox", + "type": "github" + } + }, + "nixpkgs__flox__aarch64-darwin_2": { + "flake": false, + "locked": { + "host": "catalog.floxsdlc.com", + "lastModified": 1686769905, + "narHash": "sha256-3bTAKno+hbVkaj/7nIuG8CgBuS347E6ksPcwwjcMw78=", + "owner": "flox", + "repo": "nixpkgs-flox", + "rev": "7800311cb0d5c8970021f9f6691115feb0be7c04", + "type": "github" + }, + "original": { + "host": "catalog.floxsdlc.com", + "owner": "flox", + "ref": "aarch64-darwin", + "repo": "nixpkgs-flox", + "type": "github" + } + }, + "nixpkgs__flox__aarch64-linux": { + "flake": false, + "locked": { + "host": "catalog.floxsdlc.com", + "lastModified": 1686769880, + "narHash": "sha256-t5LMiPoNgzB6UKBvUzMlsC3vcYvKoWT6InPHpTf6QNo=", + "owner": "flox", + "repo": "nixpkgs-flox", + "rev": "234e8b5adf58fe3b1b6a33680f0a6ba8d8b639d0", + "type": "github" + }, + "original": { + "host": "catalog.floxsdlc.com", + "owner": "flox", + "ref": "aarch64-linux", + "repo": "nixpkgs-flox", + "type": "github" + } + }, + "nixpkgs__flox__aarch64-linux_2": { + "flake": false, + "locked": { + "host": "catalog.floxsdlc.com", + "lastModified": 1686769880, + "narHash": "sha256-t5LMiPoNgzB6UKBvUzMlsC3vcYvKoWT6InPHpTf6QNo=", + "owner": "flox", + "repo": "nixpkgs-flox", + "rev": "234e8b5adf58fe3b1b6a33680f0a6ba8d8b639d0", + "type": "github" + }, + "original": { + "host": "catalog.floxsdlc.com", + "owner": "flox", + "ref": "aarch64-linux", + "repo": "nixpkgs-flox", + "type": "github" + } + }, + "nixpkgs__flox__i686-linux": { + "flake": false, + "locked": { + "host": "catalog.floxsdlc.com", + "lastModified": 1686770241, + "narHash": "sha256-2EJ6vCG+iMklp4mcUGhZPJk7brx2fHn2fHUYKjtJI34=", + "owner": "flox", + "repo": "nixpkgs-flox", + "rev": "cd8107202cd66d4047d2f1decb29cf03ad6195cd", + "type": "github" + }, + "original": { + "host": "catalog.floxsdlc.com", + "owner": "flox", + "ref": "i686-linux", + "repo": "nixpkgs-flox", + "type": "github" + } + }, + "nixpkgs__flox__i686-linux_2": { + "flake": false, + "locked": { + "host": "catalog.floxsdlc.com", + "lastModified": 1686770241, + "narHash": "sha256-2EJ6vCG+iMklp4mcUGhZPJk7brx2fHn2fHUYKjtJI34=", + "owner": "flox", + "repo": "nixpkgs-flox", + "rev": "cd8107202cd66d4047d2f1decb29cf03ad6195cd", + "type": "github" + }, + "original": { + "host": "catalog.floxsdlc.com", + "owner": "flox", + "ref": "i686-linux", + "repo": "nixpkgs-flox", + "type": "github" + } + }, + "nixpkgs__flox__x86_64-darwin": { + "flake": false, + "locked": { + "host": "catalog.floxsdlc.com", + "lastModified": 1686770232, + "narHash": "sha256-DFuwK3Vul8z9va99vpcWmz32WBv4Hd5tIT/qWdkG/bo=", + "owner": "flox", + "repo": "nixpkgs-flox", + "rev": "21a6177aae1307aaabc94cacff8f729495fa9df0", + "type": "github" + }, + "original": { + "host": "catalog.floxsdlc.com", + "owner": "flox", + "ref": "x86_64-darwin", + "repo": "nixpkgs-flox", + "type": "github" + } + }, + "nixpkgs__flox__x86_64-darwin_2": { + "flake": false, + "locked": { + "host": "catalog.floxsdlc.com", + "lastModified": 1686770232, + "narHash": "sha256-DFuwK3Vul8z9va99vpcWmz32WBv4Hd5tIT/qWdkG/bo=", + "owner": "flox", + "repo": "nixpkgs-flox", + "rev": "21a6177aae1307aaabc94cacff8f729495fa9df0", + "type": "github" + }, + "original": { + "host": "catalog.floxsdlc.com", + "owner": "flox", + "ref": "x86_64-darwin", + "repo": "nixpkgs-flox", + "type": "github" + } + }, + "nixpkgs__flox__x86_64-linux": { + "flake": false, + "locked": { + "host": "catalog.floxsdlc.com", + "lastModified": 1686770212, + "narHash": "sha256-Nf8RF6JYjlw65DvBQfkEz2Ev6UFyCM38oPJEIXKNfXc=", + "owner": "flox", + "repo": "nixpkgs-flox", + "rev": "209643b52be208bca6eae3a8df22a2e9ea8c175f", + "type": "github" + }, + "original": { + "host": "catalog.floxsdlc.com", + "owner": "flox", + "ref": "x86_64-linux", + "repo": "nixpkgs-flox", + "type": "github" + } + }, + "nixpkgs__flox__x86_64-linux_2": { + "flake": false, + "locked": { + "host": "catalog.floxsdlc.com", + "lastModified": 1686770212, + "narHash": "sha256-Nf8RF6JYjlw65DvBQfkEz2Ev6UFyCM38oPJEIXKNfXc=", + "owner": "flox", + "repo": "nixpkgs-flox", + "rev": "209643b52be208bca6eae3a8df22a2e9ea8c175f", + "type": "github" + }, + "original": { + "host": "catalog.floxsdlc.com", + "owner": "flox", + "ref": "x86_64-linux", + "repo": "nixpkgs-flox", + "type": "github" + } + }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "flox-floxpkgs": "flox-floxpkgs", + "ld-floxlib": "ld-floxlib" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": [ + "flox-floxpkgs", + "flox", + "crane", + "flake-utils" + ], + "nixpkgs": [ + "flox-floxpkgs", + "flox", + "crane", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1685759304, + "narHash": "sha256-I3YBH6MS3G5kGzNuc1G0f9uYfTcNY9NYoRc3QsykLk4=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "c535b4f3327910c96dcf21851bbdd074d0760290", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "rust-overlay_2": { + "inputs": { + "flake-utils": [ + "ld-floxlib", + "flox-floxpkgs", + "flox", + "crane", + "flake-utils" + ], + "nixpkgs": [ + "ld-floxlib", + "flox-floxpkgs", + "flox", + "crane", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1685759304, + "narHash": "sha256-I3YBH6MS3G5kGzNuc1G0f9uYfTcNY9NYoRc3QsykLk4=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "c535b4f3327910c96dcf21851bbdd074d0760290", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "shellHooks": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_2", + "gitignore": "gitignore", + "nixpkgs": "nixpkgs_4", + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1686668298, + "narHash": "sha256-AADh9NqHh6X2LOem4BvI7oCkMm+JPCSCE7iIw5nn0VA=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "5b6b54d3f722aa95cbf4ddbe35390a0af8c0015a", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "shellHooks_2": { + "inputs": { + "flake-compat": "flake-compat_4", + "flake-utils": "flake-utils_4", + "gitignore": "gitignore_2", + "nixpkgs": "nixpkgs_10", + "nixpkgs-stable": "nixpkgs-stable_3" + }, + "locked": { + "lastModified": 1686668298, + "narHash": "sha256-AADh9NqHh6X2LOem4BvI7oCkMm+JPCSCE7iIw5nn0VA=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "5b6b54d3f722aa95cbf4ddbe35390a0af8c0015a", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tracelinks": { + "inputs": { + "flox-floxpkgs": [ + "flox-floxpkgs" + ] + }, + "locked": { + "lastModified": 1683889723, + "narHash": "sha256-h7LMr8tgu4RJecin4oEO50WoTU0rTomAW9+7AJroX0Y=", + "ref": "main", + "rev": "e05561bdd0ed9d10c66e35a1d8e66defab949534", + "revCount": 11, + "type": "git", + "url": "ssh://git@github.com/flox/tracelinks" + }, + "original": { + "ref": "main", + "type": "git", + "url": "ssh://git@github.com/flox/tracelinks" + } + }, + "tracelinks_2": { + "inputs": { + "flox-floxpkgs": [ + "ld-floxlib", + "flox-floxpkgs" + ] + }, + "locked": { + "lastModified": 1683889723, + "narHash": "sha256-h7LMr8tgu4RJecin4oEO50WoTU0rTomAW9+7AJroX0Y=", + "ref": "main", + "rev": "e05561bdd0ed9d10c66e35a1d8e66defab949534", + "revCount": 11, + "type": "git", + "url": "ssh://git@github.com/flox/tracelinks" + }, + "original": { + "ref": "main", + "type": "git", + "url": "ssh://git@github.com/flox/tracelinks" } } }, diff --git a/flake.nix b/flake.nix index d2afd99..d6709bb 100644 --- a/flake.nix +++ b/flake.nix @@ -1,63 +1,8 @@ -# ============================================================================ # -# -# -# -# ---------------------------------------------------------------------------- # - { + description = "Installable /etc/profile.d activation scripts for use with flox"; -# ---------------------------------------------------------------------------- # - - outputs = { nixpkgs, ... }: let - -# ---------------------------------------------------------------------------- # - - eachDefaultSystemMap = let - defaultSystems = [ - "x86_64-linux" "aarch64-linux" "i686-linux" - "x86_64-darwin" "aarch64-darwin" - ]; - in fn: let - proc = system: { name = system; value = fn system; }; - in builtins.listToAttrs ( map proc defaultSystems ); - - -# ---------------------------------------------------------------------------- # - - overlays.etc-profiles = import ./overlay.nix; - overlays.default = overlays.etc-profiles; - - -# ---------------------------------------------------------------------------- # - - legacyPackages = eachDefaultSystemMap ( system: let - nixpkgsFor = builtins.getAttr system nixpkgs.legacyPackages; - pkgsFor = nixpkgsFor.extend overlays.default; - in { - inherit (pkgsFor) etcProfiles mkEtcProfile; - } ); - - -# ---------------------------------------------------------------------------- # - - in { - inherit overlays legacyPackages; - packages = eachDefaultSystemMap ( system: let - profiles = ( builtins.getAttr system legacyPackages ).etcProfiles; - rename = name: value: { name = "profile-" + name; inherit value; }; - in builtins.listToAttrs ( builtins.attrValues ( - builtins.mapAttrs rename profiles - ) ) ); - }; - - -# ---------------------------------------------------------------------------- # + inputs.flox-floxpkgs.url = "github:flox/floxpkgs"; + inputs.ld-floxlib.url = "git+ssh://git@github.com/flox/ld-floxlib"; + outputs = args @ {flox-floxpkgs, ...}: flox-floxpkgs.project args (_: {}); } - - -# ---------------------------------------------------------------------------- # -# -# -# -# ============================================================================ # diff --git a/overlay.nix b/overlay.nix deleted file mode 100644 index 9e9e374..0000000 --- a/overlay.nix +++ /dev/null @@ -1,66 +0,0 @@ -# ============================================================================ # -# -# -# -# ---------------------------------------------------------------------------- # - -final: prev: let - -# ---------------------------------------------------------------------------- # - - splitSname = script: let - sname = baseNameOf script; - m = builtins.match "([^_]*)_(.*).sh" sname; - bname = builtins.elemAt m 1; - in { - inherit sname bname; - priority = builtins.head m; - pname = "profile-" + bname; - }; - - -# ---------------------------------------------------------------------------- # - - mkEtcProfile = import ./mk-profile.nix { - inherit (final) bash coreutils system; - }; - - mkProfileLocal = { - script - , description ? null - , longDescription ? null - , ... - } @ args: let - ss = splitSname script; - in { - name = ss.bname; - value = prev.lib.makeOverridable mkEtcProfile ( - ( removeAttrs ss ["bname"] ) // args - ); - }; - - -# ---------------------------------------------------------------------------- # - - profiles = builtins.listToAttrs ( map mkProfileLocal [ - { script = ./profile.d/0100_common-paths.sh; } - { script = ./profile.d/0500_node.sh; } - { script = ./profile.d/0500_python3.sh; version = "0.1.1"; } - ] ); - - -# ---------------------------------------------------------------------------- # - -in { - inherit mkEtcProfile; - etcProfiles = profiles // { - base = import ./base.nix { inherit (final) bash coreutils system; }; - }; -} - - -# ---------------------------------------------------------------------------- # -# -# -# -# ============================================================================ # diff --git a/base.nix b/pkgs/etc-profiles/base.nix similarity index 65% rename from base.nix rename to pkgs/etc-profiles/base.nix index 4ffdd45..cc1d371 100644 --- a/base.nix +++ b/pkgs/etc-profiles/base.nix @@ -5,18 +5,21 @@ # # ---------------------------------------------------------------------------- # -{ bash, coreutils, system }: let +{ self, version, bash, coreutils, hostPlatform, ld-floxlib, lib, system }: let pname = "profile-base"; - version = "0.1.0"; in ( derivation { inherit system pname version; name = pname + "-" + version; builder = bash.outPath + "/bin/bash"; PATH = coreutils.outPath + "/bin"; - args = ["-eu" "-o" "pipefail" "-c" '' - mkdir -p "$out/etc"; - cp -- ${./profile} "$out/etc/profile"; - '']; + args = ["-eu" "-o" "pipefail" "-c" ('' + mkdir -p "$out/etc" "$out/lib"; + cp -- ${self}/profile "$out/etc/profile"; + '' + lib.optionalString hostPlatform.isLinux '' + for i in ${ld-floxlib}/lib/*; do + ln -s "$i" "$out/lib/$(basename $i)"; + done + '')]; preferLocalBuild = true; allowSubstitutes = system == ( builtins.currentSystem or null ); } ) // { @@ -35,11 +38,16 @@ in ( derivation { packages.nixpkgs-flox.sqlite = { meta.outputsToInstall = ["bin" "out" "dev"]; }; - packages.nixpkgs-flox.pkg-config = {}; - # Provides `/etc/profile' base. - packages."github:flox/etc-profiles".profile-base = {}; - # Adds `0100_common-paths.sh' to `/etc/profile.d/'. - packages."github:flox/etc-profiles".profile-common-paths = {}; + + # Provides developer environment hooks for use with python3. + packages.flox.etc-profiles = { + # Optionally, specify language packages to install. + # Invoke `flox search -c flox etc-profiles -l` to see + # a list of all supported language pack outputs. Please + # note that all/most language packs depend on including + # the "common_paths" output. + meta.outputsToInstall = [ "base" "common_paths" "python3" ]; + }; shell.hook = '${""}' [[ -r "$FLOX_ENV/etc/profile" ]] && . "$FLOX_ENV/etc/profile"; diff --git a/pkgs/etc-profiles/default.nix b/pkgs/etc-profiles/default.nix new file mode 100644 index 0000000..8cf064a --- /dev/null +++ b/pkgs/etc-profiles/default.nix @@ -0,0 +1,63 @@ +{ self, inputs, lib, buildEnv, runCommand, bash, coreutils, hostPlatform, system }: + + +let + pname = "etc-profiles"; + version = "0.1.0-${lib.flox-floxpkgs.getRev self}"; + src = self; + ld-floxlib = inputs.ld-floxlib.packages.ld-floxlib; + + splitSname = script: let + sname = baseNameOf script; + m = builtins.match "([^_]*)_(.*).sh" sname; + bname = builtins.elemAt m 1; + in { + inherit sname bname; + priority = builtins.head m; + pname = "profile-" + bname; + }; + + base = import ./base.nix { + inherit self version bash coreutils hostPlatform ld-floxlib lib system; + }; + + mkEtcProfile = import ./mk-profile.nix { + inherit bash coreutils system; + version = base.version; + }; + + mkProfileLocal = { + script + , description ? null + , longDescription ? null + , ... + } @ args: let + ss = splitSname script; + in { + name = lib.replaceStrings ["-"] ["_"] ss.bname; + value = lib.makeOverridable mkEtcProfile ( + ( removeAttrs ss ["bname"] ) // args + ); + }; + + profiles = builtins.listToAttrs ( map mkProfileLocal [ + { script = src + "/profile.d/0100_common-paths.sh"; } + { script = src + "/profile.d/0500_node.sh"; } + { script = src + "/profile.d/0500_python3.sh"; } + ] ); + + etcProfiles = buildEnv { + name = pname + "-" + version; + paths = [ base ] ++ (builtins.attrValues profiles); + }; + +in runCommand "etc-profiles.${version}" { + inherit pname version; + outputs = [ "out" "base" ] ++ (builtins.attrNames profiles); + meta.description = "Installable /etc/profile.d activation scripts for use with flox"; +} '' + cp -R -- ${etcProfiles}/. $out + cp -R -- ${base}/. $base + ${lib.concatStringsSep "\n" (lib.mapAttrsToList (output: outpath: + "cp -R -- ${outpath}/. \$${output}") profiles)} +'' diff --git a/mk-profile.nix b/pkgs/etc-profiles/mk-profile.nix similarity index 94% rename from mk-profile.nix rename to pkgs/etc-profiles/mk-profile.nix index a529837..658513d 100644 --- a/mk-profile.nix +++ b/pkgs/etc-profiles/mk-profile.nix @@ -17,10 +17,9 @@ let m = builtins.match "profile-(.*)" p; in if m == null then p else builtins.head m; in -{ bash, coreutils, system }: +{ version, bash, coreutils, system }: { script , pname -, version ? "0.1.0" , priority ? null # Integer 0-9999 or `null' , sname ? ( prioToPrefix priority ) + ( npp pname ) , description ? "An `/etc/profile.d/*.sh` script managing ${npp pname}." @@ -30,7 +29,7 @@ in "x86_64-darwin" "aarch64-darwin" ] }: ( derivation { - inherit system pname version script sname; + inherit system pname script sname; name = pname + "-" + version; builder = bash.outPath + "/bin/bash"; PATH = coreutils.outPath + "/bin"; diff --git a/profile.d/0100_common-paths.sh b/profile.d/0100_common-paths.sh index f3f3f4c..3cc8fec 100644 --- a/profile.d/0100_common-paths.sh +++ b/profile.d/0100_common-paths.sh @@ -28,11 +28,18 @@ export \ XDG_DATA_DIRS \ ; -if [ -z "${FLOX_NOSET_LD_LIBRARY_PATH:-}" ]; then - LD_LIBRARY_PATH="$FLOX_ENV/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"; - export LD_LIBRARY_PATH; -fi - +case "$(uname -s)" in +Linux*) + if [ -z "${FLOX_NOSET_LD_AUDIT:-}" -a -e "$FLOX_ENV/lib/ld-floxlib.so" ]; then + LD_AUDIT="$FLOX_ENV/lib/ld-floxlib.so"; + export LD_AUDIT; + fi + ;; +Darwin*) + DYLD_FALLBACK_LIBRARY_PATH="$FLOX_ENV/lib:${DYLD_FALLBACK_LIBRARY_PATH:-/usr/local/lib:/usr/lib}"; + export DYLD_FALLBACK_LIBRARY_PATH; + ;; +esac # ---------------------------------------------------------------------------- # #