Skip Navigation
nixos @lemmy.ml gomp @lemmy.ml

Recommended way to generate scripts from configuration.nix?

I'm migrating my NAS to nixos, and I got to the point of setting up my restic backups.

services.restic.backups is great, but -- on top of the systemd timers/services -- I also want some helper scripts (eg. one to easily mount the backups, stuff that with ansible I currently generate into /usr/local/sbin).

These scripts would be entirely generated from the services.restic.backups config and would reference sops secrets also from configuration.nix, so... I don't think it would make sense to make a package out of them?

What should I use to make these scripts? Should I use nixpkgs.writeShellApplication and then alter the PATH?

0
0 comments