diff --git a/packages/nixpak/amberol/default.nix b/packages/nixpak/amberol/default.nix index 36af8dd..dc270b1 100644 --- a/packages/nixpak/amberol/default.nix +++ b/packages/nixpak/amberol/default.nix @@ -1,7 +1,7 @@ { mkNixPak, callPackage }: mkNixPak { - config = { + config = { sloth, ... }: { imports = [ ../modules/gui-base.nix ]; dbus.policies = { "org.mpris.MediaPlayer2.*" = "own"; @@ -9,10 +9,10 @@ mkNixPak { flatpak.appId = "io.bassi.Amberol"; bubblewrap = { bind.rw = [ - "$HOME/.cache/amberol" + (sloth.concat' sloth.xdgCacheHome "/amberol") ]; bind.ro = [ - "$HOME/Music" + (sloth.concat' sloth.homeDir "/Music") ]; }; app.package = callPackage ./amberol.nix {}; diff --git a/packages/nixpak/fragments/default.nix b/packages/nixpak/fragments/default.nix index 6fbb6f8..9073160 100644 --- a/packages/nixpak/fragments/default.nix +++ b/packages/nixpak/fragments/default.nix @@ -1,7 +1,7 @@ { mkNixPak, fragments }: mkNixPak { - config = { + config = { sloth, ... }: { imports = [ ../modules/gui-base.nix ]; flatpak.appId = "de.haeckerfelix.Fragments"; app.package = fragments; @@ -14,7 +14,7 @@ mkNixPak { "/etc/hosts" ]; bind.rw = [ - "$HOME/.config/fragments" + (sloth.concat' sloth.xdgConfigHome "/fragments") ]; }; }; diff --git a/packages/nixpak/modules/gui-base.nix b/packages/nixpak/modules/gui-base.nix index fed5d45..480c099 100644 --- a/packages/nixpak/modules/gui-base.nix +++ b/packages/nixpak/modules/gui-base.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, sloth, ... }: { config = { @@ -18,18 +18,22 @@ bubblewrap = { network = lib.mkDefault false; bind.rw = [ - "$HOME/.cache/fontconfig" - "$HOME/.cache/mesa_shader_cache" - "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" - "$XDG_RUNTIME_DIR/at-spi/bus" - "$XDG_RUNTIME_DIR/gvfsd" - "$XDG_RUNTIME_DIR/pulse" + (sloth.concat' sloth.xdgCacheHome "fontconfig") + (sloth.concat' sloth.xdgCacheHome "mesa_shader_cache") + (sloth.concat [ + (sloth.env "XDG_RUNTIME_DIR") + "/" + (sloth.env "WAYLAND_DISPLAY") + ]) + (sloth.concat' (sloth.env "XDG_RUNTIME_DIR") "/at-spi/bus") + (sloth.concat' (sloth.env "XDG_RUNTIME_DIR") "/gvfsd") + (sloth.concat' (sloth.env "XDG_RUNTIME_DIR") "/pulse") ]; bind.ro = [ - "$XDG_RUNTIME_DIR/doc" - "$HOME/.config/gtk-2.0" - "$HOME/.config/gtk-3.0" - "$HOME/.config/gtk-4.0" + (sloth.concat' (sloth.env "XDG_RUNTIME_DIR") "/doc") + (sloth.concat' sloth.xdgConfigHome "/gtk-2.0") + (sloth.concat' sloth.xdgConfigHome "/gtk-3.0") + (sloth.concat' sloth.xdgConfigHome "/gtk-4.0") ]; env = { XDG_DATA_DIRS = lib.makeSearchPath "share" [