0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-12 05:16:25 +03:00

Merge pull request #209064 from Lassulus/os-release-extra

This commit is contained in:
Lassulus 2023-01-05 14:14:09 +01:00 committed by GitHub
commit c366c3dbc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -28,6 +28,8 @@ let
DOCUMENTATION_URL = "https://nixos.org/learn.html"; DOCUMENTATION_URL = "https://nixos.org/learn.html";
SUPPORT_URL = "https://nixos.org/community.html"; SUPPORT_URL = "https://nixos.org/community.html";
BUG_REPORT_URL = "https://github.com/NixOS/nixpkgs/issues"; BUG_REPORT_URL = "https://github.com/NixOS/nixpkgs/issues";
} // lib.optionalAttrs (cfg.variant_id != null) {
VARIANT_ID = cfg.variant_id;
}; };
initrdReleaseContents = osReleaseContents // { initrdReleaseContents = osReleaseContents // {
@ -87,6 +89,13 @@ in
description = lib.mdDoc "The NixOS release code name (e.g. `Emu`)."; description = lib.mdDoc "The NixOS release code name (e.g. `Emu`).";
}; };
nixos.variant_id = mkOption {
type = types.nullOr (types.strMatching "^[a-z0-9._-]+$");
default = null;
description = lib.mdDoc "A lower-case string identifying a specific variant or edition of the operating system";
example = "installer";
};
stateVersion = mkOption { stateVersion = mkOption {
type = types.str; type = types.str;
# TODO Remove this and drop the default of the option so people are forced to set it. # TODO Remove this and drop the default of the option so people are forced to set it.

View file

@ -20,6 +20,7 @@ with lib;
]; ];
config = { config = {
system.nixos.variant_id = lib.mkDefault "installer";
# Enable in installer, even if the minimal profile disables it. # Enable in installer, even if the minimal profile disables it.
documentation.enable = mkImageMediaOverride true; documentation.enable = mkImageMediaOverride true;