What is the NixOS-way to put a configuration file in /etc?
E.g. I want to drop /etc/nanorc. I found discussions about programming it into /etc/nixos/configuration.nix...
To create a file in /etc on NixOS, use environment.etc in configuration.nix. Here's an example:
environment.etc = { # Creates /etc/nanorc nanorc = { text = '' whatever you want to put in the file goes here. ''; # The UNIX file mode bits mode = "0440"; }; }; Additionally, you can also add a file from a path with:
environment.etc = { somerc.source = /etc/somerc; }; Or a directory:
environment.etc = { aDir.source = ./aDir; }; Or a package path:
environment.etc = { "X11/xorg.conf.d/90-super.conf".source = "${pkgs.displayfix}/share/displayfix/data/90-super.conf"; }; /etc/somerc point to itself? /path/to/file instead?