From 73391c83177ad96643aa3df5ace4ca7e424b447e Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 24 Mar 2025 11:17:52 +0100 Subject: ... --- modules/envfs.nix | 77 ------------------------------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 modules/envfs.nix (limited to 'modules') diff --git a/modules/envfs.nix b/modules/envfs.nix deleted file mode 100644 index b5b453a5..00000000 --- a/modules/envfs.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ pkgs, config, lib, ... }: - -let - cfg = config.services.envfs; - mounts = { - "/usr/bin" = { - device = "none"; - fsType = "envfs"; - options = [ - "bind-mount=/bin" - "fallback-path=${pkgs.symlinkJoin { - name = "fallback-path"; - inherit (cfg) paths; - }}" - "nofail" - ]; - }; - "/bin" = { - device = "/usr/bin"; - fsType = "none"; - options = [ "bind" "nofail" ]; - }; - }; -in { - disabledModules = [ "tasks/filesystems/envfs.nix" ]; - - options = { - services.envfs = { - enable = lib.mkEnableOption "Envfs filesystem" // { - default = true; - description = '' - Fuse filesystem that returns symlinks to executables based on the PATH - of the requesting process. This is useful to execute shebangs on NixOS - that assume hard coded locations in locations like /bin or /usr/bin - etc. - ''; - }; - - package = lib.mkOption { - type = lib.types.package; - default = pkgs.envfs; - defaultText = lib.literalExpression "pkgs.envfs"; - description = "Which package to use for the envfs."; - }; - - paths = lib.mkOption { - type = lib.types.listOf lib.types.package; - default = [ - (pkgs.runCommand "fallback-path-environment" {} '' - mkdir -p $out - ln -s ${config.environment.usrbinenv} $out/env - ln -s ${config.environment.binsh} $out/sh - '') - ]; - defaultText = lib.literalExpression '' - [ (pkgs.runCommand "fallback-path-environment" {} ''' - mkdir -p $out - ln -s ''${config.environment.usrbinenv} $out/env - ln -s ''${config.environment.binsh} $out/sh - ''') - ] - ''; - description = "Extra packages to join into collection of fallback executables in case not other executable is found"; - }; - }; - }; - - config = lib.mkIf (cfg.enable) { - environment.systemPackages = [ cfg.package ]; - # we also want these mounts in virtual machines. - fileSystems = if config.virtualisation ? qemu then lib.mkVMOverride mounts else mounts; - - # We no longer need those when using envfs - system.activationScripts.usrbinenv = lib.mkForce ""; - system.activationScripts.binsh = lib.mkForce ""; - }; -} -- cgit v1.2.3