os/users
2021-03-23 09:43:37 -07:00
..
modules users: add and export user modules and import them in hosts 2021-03-23 09:43:37 -07:00
nixos users: wire up all user profiles to userSuites and pass to home-manager 2021-03-23 09:43:37 -07:00
profiles create core branch without any profiles 2021-02-03 18:58:58 -07:00
root suites: add users to suites 2021-02-03 13:16:21 -07:00
README.md export homeConfigurations for all user@host pairs and add better home-manager only defaults 2021-03-23 09:43:37 -07:00

Users

Users are a special case of profiles that define system users and home-manager configurations. For your convenience, home manager is wired in by default so all you have to worry about is declaring your users. For a fully fleshed out example, check out the developers personal branch.

Basic Usage

users/myuser/default.nix:

{ ... }:
{
  users.users.myuser = {
    isNormalUser = true;
  };

  home-manager.users.myuser = {
    programs.mpv.enable = true;
  };
}

External Usage

You can easily use the defined home-manager configurations outside of NixOS using the hmActivations meta-package defined in the flakes legacyPackages output. The flk helper script makes this even easier.

This is great for keeping your environment consistent across Unix systems, including OSX.

From within the projects devshell:

# builds the nixos user defined in the NixOS host
flk home NixOS nixos

# build and activate
flk home NixOS nixos switch

Manually from outside the project:

# build
nix build "github:divnix/devos#homeConfigurations.nixos@NixOS.home.activationPackage"

# activate
./result/activate && unlink result