blob: 0e0e257602b78981aea2a492e9908fe37152445f [file] [log] [blame]
TheCodedProfbdc23452023-06-14 13:39:10 -04001{ lib, config, ... }:
2let
Skyler Greya78aa672023-05-20 13:48:18 +02003 cfg = config.scalpel;
TheCodedProfbdc23452023-06-14 13:39:10 -04004in
5{
Skyler Greya78aa672023-05-20 13:48:18 +02006 system.activationScripts.scalpelCreateStore.text = lib.mkForce ''
7 echo "[scalpel] Ensuring existance of ${cfg.secretsDir}"
8 mkdir -p ${cfg.secretsDir}
9 grep -q "${cfg.secretsDir} ramfs" /proc/mounts || mount -t ramfs none "${cfg.secretsDir}" -o nodev,nosuid,mode=0751
10
11 echo "[scalpel] Clearing old secrets from ${cfg.secretsDir}"
12 find '${cfg.secretsDir}' -wholename '${cfg.secretsDir}' -o -prune -exec rm -rf -- {} +
13 '';
14}