about summary refs log tree commit diff
path: root/nixos/modules/programs/ecryptfs.nix
blob: ced5eb26fb9a2682bbb33184473985b967ac6829 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ config, lib, pkgs, ... }:

with lib;

let
  cfg = config.programs.ecryptfs;

in {
  options.programs.ecryptfs = {
    enable = mkEnableOption "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";
      };

    };
  };
}