summaryrefslogtreecommitdiff
path: root/sys/boot/fscrypt.nix
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot/fscrypt.nix')
-rw-r--r--sys/boot/fscrypt.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/sys/boot/fscrypt.nix b/sys/boot/fscrypt.nix
new file mode 100644
index 0000000..e6a745c
--- /dev/null
+++ b/sys/boot/fscrypt.nix
@@ -0,0 +1,23 @@
+{ config, lib, pkgs, ... }:
+with lib; let
+ cfg = config.local.boot.fscrypt;
+in
+{
+ options.local.boot.fscrypt = {
+ enable = mkEnableOption "fscrypt support";
+ };
+
+ config = mkIf cfg.enable {
+ environment.systemPackages = [ pkgs.fscrypt-experimental ];
+
+ local.boot.impermanence = {
+ directories = [
+ { directory = "/.fscrypt"; mode = "u=rwx,g=rx,o=rx"; }
+ ];
+
+ files = [
+ "/etc/fscrypt.conf"
+ ];
+ };
+ };
+}