diff --git a/system/etc.nix b/system/etc.nix index 6d0bf80a240..756450ebe23 100644 --- a/system/etc.nix +++ b/system/etc.nix @@ -1,4 +1,4 @@ -{config, pkgs, upstartJobs, systemPath, wrapperDir, defaultShell}: +{config, pkgs, upstartJobs, systemPath, wrapperDir, defaultShell, extraEtc}: let @@ -144,5 +144,9 @@ import ../helpers/make-etc.nix { "chsh" "common" ] - ); + ) + + # Additional /etc files declared by Upstart jobs. + ++ extraEtc; + } diff --git a/system/system.nix b/system/system.nix index 6341db298df..83d92958b16 100644 --- a/system/system.nix +++ b/system/system.nix @@ -149,6 +149,7 @@ rec { # The static parts of /etc. etc = import ./etc.nix { inherit config pkgs upstartJobs systemPath wrapperDir defaultShell; + extraEtc = pkgs.lib.concatLists (map (job: job.extraEtc) upstartJobs.jobs); }; diff --git a/system/upstart.nix b/system/upstart.nix index 798df5b065b..6e4b9797d70 100644 --- a/system/upstart.nix +++ b/system/upstart.nix @@ -210,7 +210,7 @@ import ../upstart-jobs/gather.nix { # For the built-in logd job. ++ [ - (pkgs.upstart // {extraPath = [];}) + (pkgs.upstart // {extraPath = []; extraEtc = [];}) ]; } diff --git a/upstart-jobs/make-job.nix b/upstart-jobs/make-job.nix index 457336c8f20..d263a6d44f7 100644 --- a/upstart-jobs/make-job.nix +++ b/upstart-jobs/make-job.nix @@ -8,7 +8,8 @@ // # Allow jobs to declare extra packages that should be added to the -# system path. +# system path, as well as extra files that should be added to /etc. { extraPath = if job ? extraPath then job.extraPath else []; -} \ No newline at end of file + extraEtc = if job ? extraEtc then job.extraEtc else []; +} diff --git a/upstart-jobs/xserver.nix b/upstart-jobs/xserver.nix index f016035f463..69f1d834c4e 100644 --- a/upstart-jobs/xserver.nix +++ b/upstart-jobs/xserver.nix @@ -228,6 +228,13 @@ rec { xorg.xset # used by startkde, non-essential ]; + + extraEtc = + optional (sessionType == "kde") + { source = "${xkeyboard_config}/etc/X11/xkb"; + target = "X11/xkb"; + }; + job = " #start on network-interfaces