Add programs.ecryptfs for mount wrappers.

The `ecryptfs` package refers to the setuid wrapper paths, but they do
not exist so far in NixOS.
This commit is contained in:
Niklas Hambüchen 2022-09-12 17:32:56 +02:00
parent 3c15feef77
commit 5d778d1f03
2 changed files with 32 additions and 0 deletions

View file

@ -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

View file

@ -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";
};
};
};
}