50 lines
2.2 KiB
Nix
50 lines
2.2 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
let
|
|
link = config.dotfiles.link;
|
|
fixDesktopFiles = pkgs.writeShellScript "fix-container-desktop-files" (builtins.readFile ../../scripts/fix-container-desktop-files.sh);
|
|
vesktop = ".var/app/dev.vencord.Vesktop/config/vesktop";
|
|
in
|
|
lib.mkIf config.dotfiles.gui {
|
|
# GUI apps are Flatpaks (config/flatpaks.txt, installed by `dot apps`);
|
|
# these are the few that work better outside the sandbox.
|
|
# Defguard VPN client: its root service comes from `dot system`, its setup from `dot defguard`.
|
|
home.packages = [
|
|
pkgs.xpipe
|
|
] ++ lib.optionals (!config.dotfiles.work) [
|
|
(pkgs.callPackage ../../pkgs/defguard-client.nix { })
|
|
];
|
|
|
|
# Let the host's Plasma session see Nix-installed .desktop files and icons.
|
|
xdg.configFile."plasma-workspace/env/10-nix.sh".text = ''
|
|
export XDG_DATA_DIRS="$HOME/.nix-profile/share:''${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
|
|
'';
|
|
xdg.configFile."environment.d/10-nix.conf".text = ''
|
|
XDG_DATA_DIRS=$HOME/.nix-profile/share:''${XDG_DATA_DIRS:-/usr/local/share:/usr/share}
|
|
'';
|
|
|
|
home.file = lib.optionalAttrs (!config.dotfiles.work) {
|
|
"${vesktop}/settings.json".source = link "config/vesktop/vesktop.json";
|
|
"${vesktop}/settings/settings.json".source = link "config/vesktop/vencord.json";
|
|
"${vesktop}/settings/quickCss.css".source = link "config/vesktop/quickCss.css";
|
|
} // {
|
|
".config/VSCodium/User/settings.json".source = link "config/vscodium/settings.json";
|
|
".config/zed/settings.json".source = link "config/zed/settings.json";
|
|
};
|
|
|
|
# Re-run whenever an app (e.g. Edge inside the etv distrobox) writes launchers.
|
|
systemd.user.paths.fix-container-desktop-files = {
|
|
Unit.Description = "Watch ~/.local/share/applications for container-only launchers";
|
|
Path.PathChanged = "${config.xdg.dataHome}/applications";
|
|
Install.WantedBy = [ "default.target" ];
|
|
};
|
|
systemd.user.services.fix-container-desktop-files = {
|
|
Unit.Description = "Wrap container-only launchers with distrobox-enter";
|
|
Service = {
|
|
Type = "oneshot";
|
|
ExecStart = "${fixDesktopFiles}";
|
|
Environment = "PATH=/usr/bin:/bin";
|
|
};
|
|
};
|
|
home.activation.fixContainerDesktopFiles = lib.hm.dag.entryAfter [ "writeBoundary" ] "${fixDesktopFiles} || true";
|
|
}
|