summaryrefslogtreecommitdiffstats
path: root/tv/2configs/xdg.nix
blob: 18bac9b3848b24d732f43915bc332a94c0a65995 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{ config, lib, pkgs, ... }:

with import <stockholm/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} -");
}