summaryrefslogtreecommitdiffstats
path: root/tv/2configs/xdg.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-07-23 13:19:44 +0200
committertv <tv@krebsco.de>2016-07-23 13:19:44 +0200
commitb6dfed56ddb161907988e0bcbc923de0c5b226dd (patch)
tree87796c659cd618c9a745e33ef4c0fb112ced0a6c /tv/2configs/xdg.nix
parent268303de888591f4b98dc610f89707cd3cfe3ef7 (diff)
tv xdg: init
Diffstat (limited to 'tv/2configs/xdg.nix')
-rw-r--r--tv/2configs/xdg.nix14
1 files changed, 14 insertions, 0 deletions
diff --git a/tv/2configs/xdg.nix b/tv/2configs/xdg.nix
new file mode 100644
index 000000000..f05ec5431
--- /dev/null
+++ b/tv/2configs/xdg.nix
@@ -0,0 +1,14 @@
+{ config, lib, pkgs, ... }:
+
+with config.krebs.lib;
+
+{
+ environment.variables.XDG_RUNTIME_DIR = "/run/xdg/$LOGNAME";
+
+ systemd.tmpfiles.rules = let
+ forUsers = flip map users;
+ isUser = { name, group, ... }:
+ name == "root" || hasSuffix "users" group;
+ users = filter isUser (mapAttrsToList (_: id) config.users.users);
+ in forUsers (u: "d /run/xdg/${u.name} 0700 ${u.name} ${u.group} -");
+}