2012-04-10 22:56:38 +02:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
with pkgs.lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
system.nixosVersion = mkOption {
|
|
|
|
default =
|
|
|
|
builtins.readFile ../../.version
|
2012-06-22 16:28:06 +02:00
|
|
|
+ (if builtins.pathExists ../../.version-suffix then builtins.readFile ../../.version-suffix else "pre-git");
|
2012-04-10 22:56:38 +02:00
|
|
|
description = "NixOS version.";
|
|
|
|
};
|
2012-05-17 23:10:42 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
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";
|
|
|
|
};
|
|
|
|
|
2012-04-10 22:56:38 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|