Is there a way to create a root folder if it does not exist in configuraion.nix
?
I found this 2017 post on the maillist, suggesting to use either ExecBefore
or system.activationScripts
. I cannot find any mentioning of ExecBefore
in the github nixos repo.
I use btrbk service
services.btrbk.instances."btrbk" = {
onCalendar = "*:0:0:0";
settings = {
snapshot_preserve_min = "2d";
snapshot_preserve = "48h 20d 6m";
volume = {
"/.subvols" = {
subvolume = "@home";
snapshot_dir = "snapshots";
};
};
};
};
How would you ensure /.subvols/snapshots
exist? Like
system.activationScripts.script.text = ''
mkdir -p /.subvols/snapshots
''