diff options
author | Niklas Hambüchen <mail@nh2.me> | 2022-09-12 17:32:56 +0200 |
---|---|---|
committer | Niklas Hambüchen <mail@nh2.me> | 2023-09-05 18:56:24 +0000 |
commit | 5d778d1f030ace7e20548a48323120e7c97b7309 (patch) | |
tree | c4b7df2607d20837852bc990d10fa43cd8e5c190 /nixos/modules | |
parent | 3c15feef7770eb5500a4b8792623e2d6f598c9c1 (diff) |
Add `programs.ecryptfs` for mount wrappers.
The `ecryptfs` package refers to the setuid wrapper paths, but they do not exist so far in NixOS.
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/programs/ecryptfs.nix | 31 |
2 files changed, 32 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index abe0847ade21e..d650e5ec76b4c 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -163,6 +163,7 @@ ./programs/direnv.nix ./programs/dmrconfig.nix ./programs/droidcam.nix + ./programs/ecryptfs.nix ./programs/environment.nix ./programs/evince.nix ./programs/extra-container.nix diff --git a/nixos/modules/programs/ecryptfs.nix b/nixos/modules/programs/ecryptfs.nix new file mode 100644 index 0000000000000..63c1a3ad44199 --- /dev/null +++ b/nixos/modules/programs/ecryptfs.nix @@ -0,0 +1,31 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.programs.ecryptfs; + +in { + options.programs.ecryptfs = { + enable = mkEnableOption (lib.mdDoc "ecryptfs setuid mount wrappers"); + }; + + config = mkIf cfg.enable { + security.wrappers = { + + "mount.ecryptfs_private" = { + setuid = true; + owner = "root"; + group = "root"; + source = "${lib.getBin pkgs.ecryptfs}/bin/mount.ecryptfs_private"; + }; + "umount.ecryptfs_private" = { + setuid = true; + owner = "root"; + group = "root"; + source = "${lib.getBin pkgs.ecryptfs}/bin/umount.ecryptfs_private"; + }; + + }; + }; +} |