-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Hey, thank you very much for providing a way to customize configuration files that require some sops-managed passwords!
This is exactly what I've been looking for! ❤️
Though, I am having some issues and am relatively new to NixOS so sorry for not being able to provide a minimal example.
- When I execute the container there is no issue
- But when I call it via my flake configuration, I get the following issues:
rm: refusing to remove '.' or '..' directory: skipping '/run/scalpel/.`
rm: refusing to remove '.' or '..' directory: skipping '/run/scalpel/..`
Activation script snippet 'scalpelCreateStore' failed (1)
Looking at the code, the issue seems to come from
scalpel/modules/scalpel/default.nix
Lines 113 to 124 in 16c2103
| config = mkIf (cfg.trafos != { }) { | |
| system.activationScripts.scalpelCreateStore = { | |
| text = '' | |
| echo "[scalpel] Ensuring existance of ${cfg.secretsDir}" | |
| mkdir -p ${cfg.secretsDir} | |
| grep -q "${cfg.secretsDir} ramfs" /proc/mounts || mount -t ramfs none "${cfg.secretsDir}" -o nodev,nosuid,mode=0751 | |
| echo "[scalpel] Clearing old secrets from ${cfg.secretsDir}" | |
| rm -rf ${cfg.secretsDir}/{*,.*} | |
| ''; | |
| deps = [ "specialfs" ]; | |
| }; |
Where the shell is safeguarding recursively deleting . and ..
I've cloned this repository and changed it to:
system.activationScripts.scalpelCreateStore = {
text = ''
echo "[scalpel] Ensuring existance of ${cfg.secretsDir}"
mkdir -p ${cfg.secretsDir}
grep -q "${cfg.secretsDir} ramfs" /proc/mounts || mount -t ramfs none "${cfg.secretsDir}" -o nodev,nosuid,mode=0751
echo "[scalpel] Clearing old secrets from ${cfg.secretsDir}"
find . -name . -o -prune -exec rm -rf -- {} +
'';
deps = [ "specialfs" ];
};
With inspiration from: https://unix.stackexchange.com/a/77313
Which allowed me to run the flake without any issues. :)
I would be happy to open a PR if you think this change would fix it.
Metadata
Metadata
Assignees
Labels
No labels