[Nix-dev] [Nix-commits] SVN commit: nix - r34162 - nixos/trunk/modules/misc

Sander van der Burg - EWI S.vanderBurg at tudelft.nl
Thu May 17 23:28:36 CEST 2012


Why didn't you call this file /etc/bikeshed instead?

LOL! http://0pointer.de/blog/projects/os-release.html
________________________________________
From: nix-commits-bounces at lists.science.uu.nl [nix-commits-bounces at lists.science.uu.nl] on behalf of Eelco Dolstra [e.dolstra at tudelft.nl]
Sent: Thursday, May 17, 2012 11:10 PM
To: nix-commits at lists.science.uu.nl
Subject: [Nix-commits] SVN commit: nix - r34162 - nixos/trunk/modules/misc

Author: eelco
Date: Thu May 17 21:10:42 2012
New Revision: 34162
URL: https://nixos.org/websvn/nix/?rev=34162&sc=1

Log:
* Add /etc/os-release to be Lennart Poettering compliant.
  See http://0pointer.de/blog/projects/os-release.html

Modified:
   nixos/trunk/modules/misc/version.nix

Modified: nixos/trunk/modules/misc/version.nix
==============================================================================
--- nixos/trunk/modules/misc/version.nix        Thu May 17 19:43:32 2012        (r34161)
+++ nixos/trunk/modules/misc/version.nix        Thu May 17 21:10:42 2012        (r34162)
@@ -12,7 +12,27 @@
         + (if builtins.pathExists ../../.version-suffix then builtins.readFile ../../.version-suffix else "pre-svn");
       description = "NixOS version.";
     };
-
+
+  };
+
+  config = {
+
+    # Generate /etc/os-release.  See
+    # http://0pointer.de/public/systemd-man/os-release.html for the
+    # format.
+    environment.etc = singleton
+      { source = pkgs.writeText "os-release"
+          ''
+            NAME=NixOS
+            ID=nixos
+            VERSION="${config.system.nixosVersion}"
+            VERSION_ID="${config.system.nixosVersion}"
+            PRETTY_NAME="NixOS ${config.system.nixosVersion}"
+            HOME_URL="http://nixos.org/"
+          '';
+        target = "os-release";
+      };
+
   };

 }
_______________________________________________
nix-commits mailing list
nix-commits at lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-commits


More information about the nix-dev mailing list