Files
Foundry/hosts/ubuntu/common/users/gabriel/default.nix
T
Gabriel Fontes cc5bd4b3c8 refactor(hosts): rename system-manager to ubuntu
The tree is heavily Ubuntu-coupled: masking netplan's generator and Ubuntu's
own wpa_supplicant units, apt packages in cloud-init, /etc/dbus-1 policy.

Assisted-by: pi (claude-opus-5)
2026-08-13 16:44:51 -03:00

55 lines
1.5 KiB
Nix

{
config,
pkgs,
systemManagerHostName,
...
}: let
inherit (config.users.users.gabriel) home;
in {
# Ubuntu's logind exec's the per-user `systemd --user` without the nix
# profiles in XDG_DATA_DIRS. The user-unit search path is fixed when the
# manager starts, so package-shipped units (home-manager's xdg-desktop-portal
# services under share/systemd/user) are never found, and environment.d is
# applied too late to change it. Set XDG_DATA_DIRS on the manager process
# itself, which also feeds its user D-Bus and services. Missing dirs are
# ignored; takes effect on the next login.
environment.etc."systemd/system/user@.service.d/10-nix-xdg-data-dirs.conf".text = ''
[Service]
Environment=XDG_DATA_DIRS=${home}/.nix-profile/share:/run/system-manager/sw/share:/usr/local/share:/usr/share
'';
users = {
mutableUsers = true;
groups.gabriel = {};
users.gabriel = {
isNormalUser = true;
group = "gabriel";
home = "/home/gabriel";
createHome = false;
shell = pkgs.fish;
ignoreShellProgramCheck = true;
extraGroups = [
"audio"
"netdev"
"render"
"sudo"
"video"
"wpa_supplicant"
];
};
};
sops.secrets = {
brave_api_key = {
sopsFile = ../../../../common/secrets.yaml;
owner = "gabriel";
};
kagi_session_token = {
sopsFile = ../../../../common/secrets.yaml;
owner = "gabriel";
};
};
home-manager.users.gabriel = import ../../../../../home/gabriel/${systemManagerHostName}.nix;
}