diff --git a/nixos/modules/misc/label.nix b/nixos/modules/misc/label.nix index c7177f65a0fd..aba5ae23dc39 100644 --- a/nixos/modules/misc/label.nix +++ b/nixos/modules/misc/label.nix @@ -1,7 +1,4 @@ { config, lib, ... }: - -with lib; - let cfg = config.system.nixos; in @@ -10,8 +7,8 @@ in options.system = { - nixos.label = mkOption { - type = types.strMatching "[a-zA-Z0-9:_\\.-]*"; + nixos.label = lib.mkOption { + type = lib.types.strMatching "[a-zA-Z0-9:_\\.-]*"; description = '' NixOS version name to be used in the names of generated outputs and boot labels. @@ -43,8 +40,8 @@ in ''; }; - nixos.tags = mkOption { - type = types.listOf types.str; + nixos.tags = lib.mkOption { + type = lib.types.listOf lib.types.str; default = []; example = [ "with-xen" ]; description = '' @@ -68,9 +65,9 @@ in config = { # This is set here rather than up there so that changing it would # not rebuild the manual - system.nixos.label = mkDefault (maybeEnv "NIXOS_LABEL" - (concatStringsSep "-" ((sort (x: y: x < y) cfg.tags) - ++ [ (maybeEnv "NIXOS_LABEL_VERSION" cfg.version) ]))); + system.nixos.label = lib.mkDefault (lib.maybeEnv "NIXOS_LABEL" + (lib.concatStringsSep "-" ((lib.sort (x: y: x < y) cfg.tags) + ++ [ (lib.maybeEnv "NIXOS_LABEL_VERSION" cfg.version) ]))); }; }