nixos/label: remove with lib;

This commit is contained in:
Felix Buehler 2024-08-30 00:46:30 +02:00
parent 4feff6c9b5
commit 0334b1bf8e

View File

@ -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) ])));
};
}