summary refs log tree commit diff
path: root/nixos/modules/programs
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2022-09-12 17:32:56 +0200
committerNiklas Hambüchen <mail@nh2.me>2023-09-05 18:56:24 +0000
commit5d778d1f030ace7e20548a48323120e7c97b7309 (patch)
treec4b7df2607d20837852bc990d10fa43cd8e5c190 /nixos/modules/programs
parent3c15feef7770eb5500a4b8792623e2d6f598c9c1 (diff)
downloadnixpkgs-5d778d1f030ace7e20548a48323120e7c97b7309.tar
nixpkgs-5d778d1f030ace7e20548a48323120e7c97b7309.tar.gz
nixpkgs-5d778d1f030ace7e20548a48323120e7c97b7309.tar.bz2
nixpkgs-5d778d1f030ace7e20548a48323120e7c97b7309.tar.lz
nixpkgs-5d778d1f030ace7e20548a48323120e7c97b7309.tar.xz
nixpkgs-5d778d1f030ace7e20548a48323120e7c97b7309.tar.zst
nixpkgs-5d778d1f030ace7e20548a48323120e7c97b7309.zip
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/programs')
-rw-r--r--nixos/modules/programs/ecryptfs.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/nixos/modules/programs/ecryptfs.nix b/nixos/modules/programs/ecryptfs.nix
new file mode 100644
index 00000000000..63c1a3ad441
--- /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";
+      };
+
+    };
+  };
+}