summaryrefslogtreecommitdiffstats
path: root/krebs
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-11-07 09:48:06 +0100
committertv <tv@shackspace.de>2015-11-07 09:48:06 +0100
commit8ad05d0f40debdb2dc41aef2db24f77f539f4328 (patch)
tree50c71257fa56bd1d4a67c3ef23cc10620fd387ff /krebs
parentd590cf26cd8fa33ed4140bef7a5d689c76455625 (diff)
parentbae469d2a64165a42d93cdb31e231fa75e9813a5 (diff)
Merge remote-tracking branch 'cd/master'
Diffstat (limited to 'krebs')
-rw-r--r--krebs/3modules/build.nix5
-rw-r--r--krebs/3modules/default.nix1
-rw-r--r--krebs/3modules/per-user.nix35
3 files changed, 40 insertions, 1 deletions
diff --git a/krebs/3modules/build.nix b/krebs/3modules/build.nix
index 1205e192..7f004cd8 100644
--- a/krebs/3modules/build.nix
+++ b/krebs/3modules/build.nix
@@ -29,10 +29,13 @@ let
};
options.krebs.build.source.dir = mkOption {
- type = types.attrsOf (types.submodule ({ config, ... }: {
+ type = let
+ default-host = config.krebs.current.host;
+ in types.attrsOf (types.submodule ({ config, ... }: {
options = {
host = mkOption {
type = types.host;
+ default = default-host;
};
path = mkOption {
type = types.str;
diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix
index 2b5fc478..438836f5 100644
--- a/krebs/3modules/default.nix
+++ b/krebs/3modules/default.nix
@@ -15,6 +15,7 @@ let
./git.nix
./iptables.nix
./nginx.nix
+ ./per-user.nix
./Reaktor.nix
./retiolum-bootstrap.nix
./realwallpaper.nix
diff --git a/krebs/3modules/per-user.nix b/krebs/3modules/per-user.nix
new file mode 100644
index 00000000..ee213ded
--- /dev/null
+++ b/krebs/3modules/per-user.nix
@@ -0,0 +1,35 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+ cfg = config.krebs.per-user;
+
+ out = {
+ options.krebs.per-user = api;
+ config = imp;
+ };
+
+ api = mkOption {
+ type = with types; attrsOf (submodule {
+ options = {
+ packages = mkOption {
+ type = listOf path;
+ default = [];
+ };
+ };
+ });
+ default = {};
+ };
+
+ imp = {
+ environment = {
+ etc = flip mapAttrs' cfg (name: { packages, ... }: {
+ name = "per-user/${name}";
+ value.source = pkgs.symlinkJoin "per-user.${name}" packages;
+ });
+ profiles = ["/etc/per-user/$LOGNAME"];
+ };
+ };
+
+in out