Where do people keep their `configuration.nix`

I define all my systems via nixops in a common git repo and add a few rc-files I symlink to that I don’t want to inline in Nix, namely ~/.emacs.d/init.el -> ./init.el and ~/.stumpwm.d/init.lisp -> stumpwm.lisp. I never got nixops(1) to replicate some features of nixos-rebuild(8) so I include my laptop.nix from the repo on my local system via

# /etc/nixos/configuration.nix
{ lib, pkgs, config, ... } @args:

let
  deployment-path = /home/tmplt/nixops/laptop.nix;
  system-name = "perscitia";
in lib.filterAttrs (n: v: n != "deployment") ((import deployment-path).${system-name} { inherit args pkgs config lib; } )

Somewhat messy, and the repo could use some trimming. Eventually I want to be able to fully declare everything in my system in a set of files so I can easily bootstrap from an install medium, but I’m not there yet.

1 Like