summaryrefslogtreecommitdiffstats
path: root/configs/xdg.nix
blob: 33f35f07edf8aeca40ead63ae21d157c53a4c98a (plain)
1
2
3
4
5
6
7
8
9
10
{ config, lib, ... }: {
  environment.variables.XDG_RUNTIME_DIR = "/run/xdg/$LOGNAME";

  systemd.tmpfiles.rules = let
    forUsers = lib.flip map users;
    isUser = { name, group, ... }:
      name == "root" || lib.hasSuffix "users" group;
    users = builtins.filter isUser (builtins.attrValues config.users.users);
  in forUsers (u: "d /run/xdg/${u.name} 0700 ${u.name} ${u.group} -");
}