summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/os-release.nix
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2016-03-05 23:50:50 +0100
committerlassulus <lass@aidsballs.de>2016-03-05 23:50:50 +0100
commit0115e0ee85c3ecc05b709d0f036253e52367a1a1 (patch)
tree997634737c8b337646cfd83b1fac2de956a823bc /krebs/3modules/os-release.nix
parent1ba917c3337c9a954e5c251b137ea3ea2ce62f81 (diff)
parent198407f70fdeacaae5dac6e4ec305629a5368410 (diff)
Merge remote-tracking branch 'cd/master'
Diffstat (limited to 'krebs/3modules/os-release.nix')
-rw-r--r--krebs/3modules/os-release.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/krebs/3modules/os-release.nix b/krebs/3modules/os-release.nix
new file mode 100644
index 000000000..4c803fff8
--- /dev/null
+++ b/krebs/3modules/os-release.nix
@@ -0,0 +1,28 @@
+{ config, ... }:
+with config.krebs.lib;
+let
+ nixos-version-id = "${config.system.nixosVersion}";
+ nixos-version = "${nixos-version-id} (${config.system.nixosCodeName})";
+ nixos-pretty-name = "NixOS ${nixos-version}";
+
+ stockholm-version-id = maybeEnv "STOCKHOLM_VERSION" "unknown";
+ stockholm-version = "${stockholm-version-id}";
+ stockholm-pretty-name = "stockholm ${stockholm-version}";
+
+ version = "${stockholm-version}/${nixos-version}";
+ version-id = "${stockholm-version-id}/${nixos-version-id}";
+ pretty-name = "${stockholm-pretty-name} / ${nixos-pretty-name}";
+
+ home-url = http://cgit.cd.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}"
+ '';
+}