.. | ||
bootstrap | ||
ni | ||
README.adoc |
These are NixOS configurations that are specific to a machine (e.g., desktop, servers, VM, containers). Ideally, it should be made minimal as much as possible considering you also have to manage your users.
Integrating with custom modules
The host configurations placed here most likely use the custom NixOS modules.
The custom modules shouldn’t be imported manually from the host.
In the case for our flake configuration, the importing of modules are already taken care of — specifically through mkHost
from ../lib/flake-utils.nix
(see the linked file for the implementation).
It is best practice to assume the host configurations make use of the custom NixOS modules, custom packages, and the flake inputs.
In other words, always pay attention to ../flake.nix
.
User management
For managing users, there are multiple ways to manage them with this config:
-
The usual
users.users.${user}
from system configuration (seeman configuration.nix.5
). -
If you intend to import users from the
../users/nixos/
, you can simply import them throughimports
in the system module.For a convenient option, there is the function
getUsers
defined from the custom library. You can use it as follows:imports = [ # Your modules ] # Import the following NixOS users. ++ (lib.attrValues (lib.getUsers "nixos" [ "foo-dogsquared" "polski" ]));
-
modules.users.users.${user}
which is my implementation for managing users from../users/home-manager/
— e.g.,modules.users.users.foo-dogsquared = {}
. This is integrating my home-manager users to map into NixOS users.