File tree Expand file tree Collapse file tree 9 files changed +76
-38
lines changed Expand file tree Collapse file tree 9 files changed +76
-38
lines changed Original file line number Diff line number Diff line change 22Suites provide a mechanism for users to easily combine and name collections of
33profiles.
44
5- ` suites ` are defined in the ` importables ` argument in either the ` home ` or ` nixos `
6- namespace. They are a special case of an ` importable ` which is passed as a special
7- argument (one that can be use in an ` imports ` line) to your hosts. All lists defined
8- in ` suites ` are flattened and type-checked as paths.
5+ ` suites ` are defined in the ` importables ` argument in any of the ` nixos ` ,
6+ ` darwin ` , or ` home ` namespaces. They are a special case of an ` importable ` which
7+ is passed as a special argument (one that can be use in an ` imports ` line) to
8+ your hosts. All lists defined in ` suites ` are flattened and type-checked as
9+ paths.
910
1011## Definition
12+
1113``` nix
1214rec {
13- workstation = [ profiles.develop profiles.graphical users.nixos ];
14- mobileWS = workstation ++ [ profiles.laptop ];
15+ workstation = [
16+ profiles.develop
17+ profiles.graphical
18+ users.primary
19+ ];
20+ portableWorkstation =
21+ workstation
22+ ++ [ profiles.laptop ];
1523}
1624```
1725
1826## Usage
27+
1928` hosts/my-laptop.nix ` :
29+
2030``` nix
2131{ suites, ... }:
2232{
23- imports = suites.mobileWS ;
33+ imports = suites.portableWorkstation ;
2434}
2535```
Original file line number Diff line number Diff line change 119119 users = digga . lib . rakeLeaves ./users ;
120120 } ;
121121 suites = with profiles ; rec {
122- base = [ core . nixos users . nixos users . root ] ;
122+ base = [
123+ core . nixos
124+ users . root
125+ users . primary
126+ ] ;
123127 } ;
124128 } ;
125129 } ;
147151 users = digga . lib . rakeLeaves ./users ;
148152 } ;
149153 suites = with profiles ; rec {
150- base = [ core . darwin users . admin ] ;
154+ base = [
155+ core . darwin
156+ users . primary
157+ ] ;
151158 } ;
152159 } ;
153160 } ;
162169 } ;
163170 } ;
164171 users = {
165- nixos = { suites , ... } : { imports = suites . base ; } ;
166172 primary = { suites , ... } : { imports = suites . base ; } ;
167173 } ;
168174 } ;
Original file line number Diff line number Diff line change 11{ profiles , ... } :
22{
3- imports = [
4- # profiles.networking
5- profiles . core . nixos
6- profiles . users . root # make sure to configure ssh keys
7- profiles . users . nixos
3+ imports = with profiles ; [
4+ core . nixos
5+ # N.B. Make sure to add your public SSH keys to authorized keys!
6+ users . root
7+ # Traditionally, the installer user+password combo would be `nixos:nixos`.
8+ users . primary
89 ] ;
910
1011 boot . loader . systemd-boot . enable = true ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ { hmUsers , ... } :
2+ {
3+ # In this profile, the `nixos` system-level user loads the home-manager
4+ # profile for the `primary` user defined in the flake's
5+ # `self.home.users.primary` option.
6+ #
7+ # The user profile names defined in `self.home.users.<name>` don't need to
8+ # correspond directly to system-level usernames. They can, instead, be
9+ # imported as a module in any `home-manager.users` configuration, allowing for
10+ # more flexibility.
11+ #
12+ # Compare with the `primary` system user (in this directory), which uses a
13+ # simplified (but limited) approach.
14+ home-manager . users . nixos = { ...} : { imports = [ hmUsers . primary ] ; } ;
15+
16+ users . users . nixos = {
17+ password = "nixos" ;
18+ description = "default" ;
19+ isNormalUser = true ;
20+ extraGroups = [ "wheel" ] ;
21+ } ;
22+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ { hmUsers , ... } :
2+ {
3+ # You'll need to define an initial hashed or plaintext password for this user.
4+ users . users . primary = {
5+ description = "primary administrative user on this machine" ;
6+ } ;
7+
8+ # The following home-manager user definition doesn't include any further
9+ # customization beyond the default `hmUsers.primary` profile, so its
10+ # implementation can be simplified.
11+ #
12+ # Note, however, that the pattern demonstrated in the `nixos` user profile is
13+ # more flexible in the long run, especially if you want to share the same
14+ # home-manager profile amongst multiple users with different usernames.
15+ home-manager . users = { inherit ( hmUsers ) primary ; } ;
16+ }
File renamed without changes.
Original file line number Diff line number Diff line change 1717
1818 globalDefaults = { hmUsers } :
1919 { config , pkgs , self , ... } : {
20- # digga lib can be accessed in modules directly as config.lib.digga
20+ # Digga's library functions can be accessed directly through the module
21+ # system as `config.lib.digga`.
2122 lib = {
2223 inherit ( pkgs . lib ) digga ;
2324 } ;
3233 } ;
3334
3435 nixosDefaults = { self , ... } : {
36+ # N.B. If users are not explicitly defined in configuration, they will be
37+ # removed from the resulting system. This could result in data loss if
38+ # you're not starting from a fresh install -- even if you are currently
39+ # logged in!
3540 users . mutableUsers = lib . mkDefault false ;
3641 hardware . enableRedistributableFirmware = lib . mkDefault true ;
3742 system . configurationRevision = lib . mkIf ( self ? rev ) self . rev ;
You can’t perform that action at this time.
0 commit comments