From 2e6c2f9aaf8f7caeef859630c55df5b6bcbb3969 Mon Sep 17 00:00:00 2001 From: Nicolas Pierron Date: Sun, 9 Nov 2008 16:44:37 +0000 Subject: [PATCH] Add config.etc option to add extra /etc/* files. svn path=/nixos/trunk/; revision=13234 --- system/options.nix | 15 ++++++++++++++- system/system.nix | 4 +++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/system/options.nix b/system/options.nix index 4249065239c..d60a99d470a 100644 --- a/system/options.nix +++ b/system/options.nix @@ -592,7 +592,6 @@ in # then the checking in upstart-jobs/default.nix can be removed again (together with passing arg optionDeclarations) }; - services = { @@ -3008,6 +3007,20 @@ root ALL=(ALL) SETENV: ALL "; }; + # should be moved to etc/default.nix + etc = mkOption { + default = []; + example = [ + { source = "/nix/store/.../etc/dir/file.conf.example"; + target = "dir/file.conf"; + mode = "0440"; + } + ]; + description = " + List of files that have to be linked in /etc. + "; + }; + nix = mkOption { default = pkgs.nixUnstable; example = pkgs.nixCustomFun /root/nix.tar.gz; diff --git a/system/system.nix b/system/system.nix index 95b85a83da2..d0d1946038a 100644 --- a/system/system.nix +++ b/system/system.nix @@ -116,7 +116,9 @@ rec { etc = import ../etc/default.nix { inherit config pkgs upstartJobs systemPath wrapperDir defaultShell nixEnvVars modulesTree nssModulesPath; - extraEtc = pkgs.lib.concatLists (map (job: job.extraEtc) upstartJobs.jobs); + extraEtc = + (pkgs.lib.concatLists (map (job: job.extraEtc) upstartJobs.jobs)) + ++ config.environment.etc; };