2

At work we tend to keep our large code workspaces under a /scratch folder. Is there a NixOS option to declare such a folder/file should exist?

I know about environment.etc which will setup symlink from /etc into the nix store.

Otherwise I'd have to resort to declare some systemd boot-up script, doing mkdir -p and so on - which feels ugly.

2 Answers 2

3

I would probably use systemd.tmpfiles.rules. See its entry in docs, e.g. man configuration.nix.

0

example from How to auto mount / permanently mount external devices on NixOS:

 systemd.tmpfiles.rules = [ # create /media directory for udisks2-rules-share-mounts "d /media 0755 root root 99999y" ]; 

99999y is the cleanup-age, see also man tmpfiles.d

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.