···35 nixosLabel = mkOption {
36 type = types.str;
37 description = ''
38- NixOS version name to be used in the names of generated
39- outputs and boot labels.
40-41- If you ever wanted to influence the labels in your GRUB menu,
42- this is option is for you.
43-44- Can be set directly or with <envar>NIXOS_LABEL</envar>
45- environment variable for <command>nixos-rebuild</command>,
46- e.g.:
47-48- <screen>
49- #!/bin/sh
50- today=`date +%Y%m%d`
51- branch=`(cd nixpkgs ; git branch 2>/dev/null | sed -n '/^\* / { s|^\* ||; p; }')`
52- revision=`(cd nixpkgs ; git rev-parse HEAD)`
53- export NIXOS_LABEL="$today.$branch-''${revision:0:7}"
54- nixos-rebuild switch</screen>
55 '';
56 };
57···102 system = {
103 # These defaults are set here rather than up there so that
104 # changing them would not rebuild the manual
105- nixosLabel = mkDefault (maybeEnv "NIXOS_LABEL" cfg.nixosVersion);
106- nixosVersion = mkDefault (maybeEnv "NIXOS_VERSION" (cfg.nixosRelease + cfg.nixosVersionSuffix));
107 nixosRevision = mkIf (pathIsDirectory gitRepo) (mkDefault gitCommitId);
108 nixosVersionSuffix = mkIf (pathIsDirectory gitRepo) (mkDefault (".git." + gitCommitId));
109
···35 nixosLabel = mkOption {
36 type = types.str;
37 description = ''
38+ Label to be used in the names of generated outputs and boot
39+ labels.
00000000000000040 '';
41 };
42···87 system = {
88 # These defaults are set here rather than up there so that
89 # changing them would not rebuild the manual
90+ nixosLabel = mkDefault cfg.nixosVersion;
91+ nixosVersion = mkDefault (cfg.nixosRelease + cfg.nixosVersionSuffix);
92 nixosRevision = mkIf (pathIsDirectory gitRepo) (mkDefault gitCommitId);
93 nixosVersionSuffix = mkIf (pathIsDirectory gitRepo) (mkDefault (".git." + gitCommitId));
94