From a0c068d6ec5d1cc6b1c58fe9af379b638a346220 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 6 Nov 2015 21:37:58 +0100 Subject: {tv => krebs} per-user --- krebs/3modules/default.nix | 1 + krebs/3modules/per-user.nix | 35 +++++++++++++++++++++++++++++++++++ tv/3modules/default.nix | 1 - tv/3modules/per-user.nix | 35 ----------------------------------- 4 files changed, 36 insertions(+), 36 deletions(-) create mode 100644 krebs/3modules/per-user.nix delete mode 100644 tv/3modules/per-user.nix diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix index 2b5fc478c..438836f52 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 000000000..ee213deda --- /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 diff --git a/tv/3modules/default.nix b/tv/3modules/default.nix index 3a75d6e43..bb10d8261 100644 --- a/tv/3modules/default.nix +++ b/tv/3modules/default.nix @@ -5,6 +5,5 @@ _: ./consul.nix ./ejabberd.nix ./iptables.nix - ./per-user.nix ]; } diff --git a/tv/3modules/per-user.nix b/tv/3modules/per-user.nix deleted file mode 100644 index 8d21a01d9..000000000 --- a/tv/3modules/per-user.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - cfg = config.tv.per-user; - - out = { - options.tv.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 -- cgit v1.2.3