Setting up a complete OS with some parameters

Hi all,
I really like
https://github.com/mitchellh/nixos-config/ which setups a complete for NixOs as a development environment in a VM.

I am thinking about making this available to developers in my company.

Unfortunately there are some places in the nixos config where the user name is hardcoded (mitchellh).

How can I make the user name a parameter?

I might ship a prebuild NixOs image with a dummy user and then ask the developer to somehow input the OS user name (as well as github name etc) in the Makefile (maybe) and from then switch the whole setup to use that user.
I want to also the support the user to get updates by doing a git pull for the nixos config and run a rebuild

Any suggestions how this could be done?

is you question like Nixos configuration.nix with argument - #4 by jtojnar
(Currently my NixOS gets such meta data via a local .json file which gets read into the configuration.nix and home.nix)

The function mkVM is what created the NixOS configurations, but currently that function is not one of the outputs of the nixos-config flake. If you get the developer to add the function to the flake outputs, then you can have each of your developers create a Nix flake which uses nixos-config as an input and calls mkVM with their own user name.

1 Like
Hosted by Flying Circus.