nixos-config/hosts
2023-06-13 13:20:00 +08:00
..
bootstrap hosts: remove extra module for installers 2022-12-04 08:55:06 +08:00
graphical-installer hosts/graphical-installer: force wireless networking setup 2022-12-10 18:48:23 +08:00
ni hosts/ni: update Wireguard "client" config again 2023-06-11 12:28:36 +08:00
plover hosts/plover: update Wireguard firewall rules 2023-06-13 13:20:00 +08:00
void hosts/void: add host 2022-09-26 08:35:10 +08:00
README.adoc docs: update 2022-09-19 10:56:06 +08:00

These are NixOS configurations that are specific to a machine (e.g., desktop, servers, VMs, containers, installation media). 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 shouldnt be imported manually from the host as this is already taken care of from the flake definition.

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 (see man configuration.nix.5).

  • If you intend to import users from the ../users/nixos/, you can simply import them through imports in the system module.

    For a convenient option, there is the function getUsers defined from the private custom library. You can use it as follows:

    imports = [ # Your modules ]
        # Import the following NixOS users.
        ++ (lib.attrValues (lib.getUsers "nixos" [ "foo-dogsquared" "polski" ]));
  • You could also easily map one of my home-manager configurations into one of the users for a NixOS system with lib.mapHomeManagerUser which accepts two arguments: a name from of the home-manager user folder and the user config as if configuration with users.users.<name>.

    Heres an example to easily get my main home-manager config to be one of the users of the system.

    lib.mapHomeManagerUser "foo-dogsquared" {
      extraGroups = [ "audio" "docker" ];
      password = "what";
      createHome = true;
      home = "/home/foo-dogsquared";
    }