Skip to content

Instantly share code, notes, and snippets.

@lheckemann
Last active September 11, 2020 07:31
Show Gist options
  • Select an option

  • Save lheckemann/e12031648241ed9d99a1d1faaa24534c to your computer and use it in GitHub Desktop.

Select an option

Save lheckemann/e12031648241ed9d99a1d1faaa24534c to your computer and use it in GitHub Desktop.
{
fileSystems."/scratch" = { fsType = "zfs"; device = "ordnungsamd/scratch"; };
systemd.services.clear-scratch = {
script = ''
/run/booted-system/sw/bin/zfs rollback ordnungsamd/scratch@empty
# dropbox is exposed write-only via samba to allow transferring files to my laptop from windows machines
install -dm0700 -o linus /scratch/dropbox
setfacl -m u:dropper:wx /scratch/dropbox
'';
path = [ pkgs.acl ];
};
systemd.timers.clear-scratch = {
timerConfig.OnCalendar = "03:00";
timerConfig.Persistent = true;
wantedBy = ["multi-user.target"];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment