version module: refactor with fileContents

This commit is contained in:
Eric Sagnes 2016-07-31 22:08:29 +09:00
parent 1114ab41e6
commit c7bd26e537

View File

@ -49,21 +49,21 @@ in
nixosRelease = mkOption { nixosRelease = mkOption {
readOnly = true; readOnly = true;
type = types.str; type = types.str;
default = readFile releaseFile; default = fileContents releaseFile;
description = "The NixOS release (e.g. <literal>16.03</literal>)."; description = "The NixOS release (e.g. <literal>16.03</literal>).";
}; };
nixosVersionSuffix = mkOption { nixosVersionSuffix = mkOption {
internal = true; internal = true;
type = types.str; type = types.str;
default = if pathExists suffixFile then readFile suffixFile else "pre-git"; default = if pathExists suffixFile then fileContents suffixFile else "pre-git";
description = "The NixOS version suffix (e.g. <literal>1160.f2d4ee1</literal>)."; description = "The NixOS version suffix (e.g. <literal>1160.f2d4ee1</literal>).";
}; };
nixosRevision = mkOption { nixosRevision = mkOption {
internal = true; internal = true;
type = types.str; type = types.str;
default = if pathExists revisionFile then readFile revisionFile else "master"; default = if pathExists revisionFile then fileContents revisionFile else "master";
description = "The Git revision from which this NixOS configuration was built."; description = "The Git revision from which this NixOS configuration was built.";
}; };