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