Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions nixos/modules/misc/version.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let
BUILD_ID = cfg.version;
PRETTY_NAME = "${cfg.distroName} ${cfg.release} (${cfg.codeName})";
CPE_NAME = "cpe:/o:${cfg.vendorId}:${cfg.distroId}:${cfg.release}";
LOGO = "nix-snowflake";
LOGO = optionalString (cfg.logo != null) cfg.logo;
HOME_URL = optionalString isNixos "https://nixos.org/";
VENDOR_URL = optionalString isNixos "https://nixos.org/";
DOCUMENTATION_URL = optionalString isNixos "https://nixos.org/learn.html";
Expand All @@ -42,7 +42,7 @@ let
VARIANT = optionalString (cfg.variantName != null) cfg.variantName;
VARIANT_ID = optionalString (cfg.variant_id != null) cfg.variant_id;
DEFAULT_HOSTNAME = config.networking.fqdnOrHostName;
SUPPORT_END = "2025-06-30";
SUPPORT_END = cfg.supportEnd;
};

initrdReleaseContents = (removeAttrs osReleaseContents [ "BUILD_ID" ]) // {
Expand Down Expand Up @@ -75,7 +75,7 @@ in
};

release = mkOption {
readOnly = true;
internal = true;
Copy link
Contributor

@SigmaSquadron SigmaSquadron Nov 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very much against setting those options as not R/O. Downstreams know where to look and can override them, and there's no reason to have users editing internal distro branding options.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downstreams know where to look and can override them,

Am I misunderstanding something? internal omits the option from the manual while readOnly options are also cannot be overriden. Or is your point that such downstream use-cases must/ought fork nixpkgs and manually update the field? In any case, I agree is #351736 is a much better solution.

type = types.str;
default = trivial.release;
description = "The NixOS release (e.g. `16.03`).";
Expand All @@ -96,7 +96,7 @@ in
};

codeName = mkOption {
readOnly = true;
internal = true;
type = types.str;
default = trivial.codeName;
description = "The NixOS release code name (e.g. `Emu`).";
Expand Down Expand Up @@ -143,6 +143,20 @@ in
default = "NixOS";
description = "The name of the operating system vendor";
};

logo = mkOption {
internal = true;
type = types.nullOr types.str;
default = "nix-snowflake";
description = "The name of an icon that can be used by graphical applications to display the operating system's logo";
};

supportEnd = mkOption {
internal = true;
type = types.strMatching "[0-9]{4}-[0-9]{2}-[0-9]{2}";
default = "2025-06-30";
description = "The date when support for this OS version ends.";
};
};

image = {
Expand Down