programs: frozen-bubble: persist data and sandbox with bwrap

This commit is contained in:
Colin 2024-02-05 21:32:58 +00:00
parent cd1d22e7b9
commit 9a8d8a20bd
2 changed files with 19 additions and 0 deletions

View File

@ -27,6 +27,7 @@
./flare-signal.nix
./fontconfig.nix
./fractal.nix
./frozen-bubble.nix
./fwupd.nix
./g4music.nix
./gajim.nix

View File

@ -0,0 +1,18 @@
# source code: <https://github.com/kthakore/frozen-bubble>
{ pkgs, ... }:
{
sane.programs.frozen-bubble = {
sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
packageUnwrapped = pkgs.frozen-bubble.overrideAttrs (upstream: {
# patch so it stores its dot-files not in root ~.
postPatch = (upstream.postPatch or "") + ''
substituteInPlace lib/Games/FrozenBubble/Stuff.pm \
--replace-fail '$FBHOME = "$ENV{HOME}/.frozen-bubble"' '$FBHOME = "$ENV{HOME}/.local/share/frozen-bubble"'
'';
});
persist.byStore.plaintext = [
".local/share/frozen-bubble" # preferences, high scores
];
};
}