From ab912c488e3656d978d35ef1a3dc4627b4663289 Mon Sep 17 00:00:00 2001 From: Menno van Leeuwen Date: Thu, 11 Dec 2025 13:56:57 +0100 Subject: [PATCH] Preserve XDG_DATA_DIRS and add snapd desktop Update flake.lock to bump nixpkgs to the new revision and narHash --- config/bash.nix | 2 +- flake.lock | 6 +++--- workstation/snapd.nix | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 workstation/snapd.nix diff --git a/config/bash.nix b/config/bash.nix index bb52338..9147108 100644 --- a/config/bash.nix +++ b/config/bash.nix @@ -38,7 +38,7 @@ export EDITOR="code --wait" export STARSHIP_ENABLE_RIGHT_PROMPT="true" export STARSHIP_ENABLE_BASH_COMPLETION="true" - export XDG_DATA_DIRS="/usr/share:/var/lib/flatpak/exports/share:${config.home.homeDirectory}/.local/share/flatpak/exports/share" + export XDG_DATA_DIRS="/usr/share:/var/lib/flatpak/exports/share:${config.home.homeDirectory}/.local/share/flatpak/exports/share:$XDG_DATA_DIRS" export BUN_INSTALL="$HOME/.bun" # Source .profile (If exists) diff --git a/flake.lock b/flake.lock index 32bdb6f..d52beee 100644 --- a/flake.lock +++ b/flake.lock @@ -41,11 +41,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1764316264, - "narHash": "sha256-82L+EJU+40+FIdeG4gmUlOF1jeSwlf2AwMarrpdHF6o=", + "lastModified": 1765363881, + "narHash": "sha256-3C3xWn8/2Zzr7sxVBmpc1H1QfxjNfta5IMFe3O9ZEPw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9a7b80b6f82a71ea04270d7ba11b48855681c4b0", + "rev": "d2b1213bf5ec5e62d96b003ab4b5cbc42abfc0d0", "type": "github" }, "original": { diff --git a/workstation/snapd.nix b/workstation/snapd.nix new file mode 100644 index 0000000..e7b888b --- /dev/null +++ b/workstation/snapd.nix @@ -0,0 +1,17 @@ +{ config, lib, ... }: + +let + # Merge our session variable into any existing ones, if present. + existingSessionVars = config.home.sessionVariables or {}; + sessionVars = existingSessionVars // { + # Prepend snap desktop dir so snap-provided .desktop files are discovered by desktop environments. + # We include `$XDG_DATA_DIRS` to preserve any previously-set value at runtime. + XDG_DATA_DIRS = "/var/lib/snapd/desktop:$XDG_DATA_DIRS"; + }; +in +{ + config = { + # Use mkForce to ensure this module's value takes precedence when modules are merged. + home.sessionVariables = lib.mkForce sessionVars; + }; +}