os-release: add stockholm-version-id option
This commit is contained in:
parent
f64e3d14d2
commit
c260c4a1de
@ -8,28 +8,34 @@ let
|
||||
nixos-version = "${nixos-version-id} (${nixos-codeName})";
|
||||
nixos-pretty-name = "NixOS ${nixos-version}";
|
||||
|
||||
stockholm-version-id = let
|
||||
eval = builtins.tryEval (removeSuffix "\n" (readFile <stockholm-version>));
|
||||
in
|
||||
if eval.success then eval.value else "unknown";
|
||||
|
||||
stockholm-version = "${stockholm-version-id}";
|
||||
stockholm-version = "${config.krebs.os-release.stockholm-version-id}";
|
||||
stockholm-pretty-name = "stockholm ${stockholm-version}";
|
||||
|
||||
version = "${stockholm-version}/${nixos-version}";
|
||||
version-id = "${stockholm-version-id}/${nixos-version-id}";
|
||||
version-id = "${config.krebs.os-release.stockholm-version-id}/${nixos-version-id}";
|
||||
pretty-name = "${stockholm-pretty-name} / ${nixos-pretty-name}";
|
||||
|
||||
home-url = http://cgit.ni.krebsco.de/stockholm;
|
||||
in
|
||||
{
|
||||
# http://0pointer.de/public/systemd-man/os-release.html
|
||||
environment.etc."os-release".text = mkForce ''
|
||||
NAME="stockholm/NixOS"
|
||||
ID=stockholm
|
||||
VERSION="${version}"
|
||||
VERSION_ID="${version-id}"
|
||||
PRETTY_NAME="${pretty-name}"
|
||||
HOME_URL="${home-url}"
|
||||
'';
|
||||
options.krebs.os-release = {
|
||||
stockholm-version-id = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = let
|
||||
eval = builtins.tryEval (removeSuffix "\n" (readFile <stockholm-version>));
|
||||
in
|
||||
if eval.success then eval.value else "unknown";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
# http://0pointer.de/public/systemd-man/os-release.html
|
||||
environment.etc."os-release".text = mkForce ''
|
||||
NAME="stockholm/NixOS"
|
||||
ID=stockholm
|
||||
VERSION="${version}"
|
||||
VERSION_ID="${version-id}"
|
||||
PRETTY_NAME="${pretty-name}"
|
||||
HOME_URL="${home-url}"
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user