refactor: indirections f. user,[home,flake,xdg]Dir

This commit is contained in:
Leon Schwarzäugl 2025-03-22 22:32:32 +01:00
parent 5c207050a3
commit 9c1df052a2
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
34 changed files with 416 additions and 281 deletions

View file

@ -1,6 +1,7 @@
{ self, lib, pkgs, config, ... }:
let
owner = "swarsel";
inherit (config.swarselsystems) mainUser homeDir xdgDir;
owner = mainUser;
sopsFile = self + /secrets/work/secrets.yaml;
in
{
@ -26,7 +27,7 @@ in
_1password.enable = true;
_1password-gui = {
enable = true;
polkitPolicyOwners = [ "swarsel" ];
polkitPolicyOwners = [ "${mainUser}" ];
};
};
@ -93,7 +94,7 @@ in
openssh = {
enable = true;
extraConfig = ''
'';
'';
};
syncthing = {
@ -103,13 +104,36 @@ in
};
folders = {
"Documents" = {
path = "/home/swarsel/Documents";
path = "${homeDir}/Documents";
devices = [ "magicant" "winters" ];
id = "hgr3d-pfu3w";
};
};
};
};
udev.extraRules = ''
SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6860", TAG+="systemd", ENV{SYSTEMD_WANTS}="swarsel-screenshare.service"
'';
};
systemd.services.swarsel-screenshare = {
enable = true;
description = "Screensharing service upon dongle plugin";
serviceConfig = {
ExecStart = "${pkgs.screenshare}/bin/screenshare";
User = mainUser;
Group = "users";
Environment = [
"PATH=/run/current-system/sw/bin:/etc/profiles/per-user/${mainUser}/bin"
"XDG_RUNTIME_DIR=${xdgDir}"
"WAYLAND_DISPLAY=wayland-1"
];
Type = "oneshot";
StandardOutput = "journal";
StandardError = "journal";
};
};
# cgroups v1 is required for centos7 dockers