From c4aa833e5654e869f8fe78046e3f601406a2aad2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 11 May 2012 23:06:35 +0000 Subject: [PATCH] * Use optionSet to check environment.etc. svn path=/nixos/trunk/; revision=34064 --- modules/system/etc/etc.nix | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/modules/system/etc/etc.nix b/modules/system/etc/etc.nix index ec6e4e72012..7553a569beb 100644 --- a/modules/system/etc/etc.nix +++ b/modules/system/etc/etc.nix @@ -16,8 +16,26 @@ let } ]; description = '' - List of files that have to be linked in /etc. + List of files that have to be linked in /etc. ''; + type = types.listOf types.optionSet; + options = { + source = mkOption { + description = "Source file."; + }; + target = mkOption { + description = "Name of symlink (relative to /etc)."; + }; + mode = mkOption { + default = "symlink"; + example = "0600"; + description = '' + If set to something else than symlink, + the file is copied instead of symlinked, with the given + file mode. + ''; + }; + }; }; }; in @@ -35,7 +53,7 @@ let /* !!! Use toXML. */ sources = map (x: x.source) config.environment.etc; targets = map (x: x.target) config.environment.etc; - modes = map (x: if x ? mode then x.mode else "symlink") config.environment.etc; + modes = map (x: x.mode) config.environment.etc; }; in