From 2d146123262875959397514cd12e067a8734c032 Mon Sep 17 00:00:00 2001 From: Benoit de Chezelles Date: Thu, 7 Mar 2024 20:23:21 +0100 Subject: [PATCH] keymapp: Update @2024-03-08 (remove binary, nix is broken with git-lfs) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using git-lfs, when the flake copies the repo to the store (for purity) the 'virtual file' stored in git is copied (with oid/size info of the object in LFS) instead of the actual (large) file :/ ref: https://github.com/NixOS/nix/pull/10153 I think it was working before because the file was in git temporarily at some point, then I moved it to LFS, but after the system was built.. (or something like that 🤷) --- pkgs/zsa-keymapp/.gitattributes | 1 - pkgs/zsa-keymapp/default.nix | 21 ++++++++++++--------- pkgs/zsa-keymapp/keymapp | 3 --- 3 files changed, 12 insertions(+), 13 deletions(-) delete mode 100644 pkgs/zsa-keymapp/.gitattributes delete mode 100755 pkgs/zsa-keymapp/keymapp diff --git a/pkgs/zsa-keymapp/.gitattributes b/pkgs/zsa-keymapp/.gitattributes deleted file mode 100644 index fbddd0d..0000000 --- a/pkgs/zsa-keymapp/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -keymapp filter=lfs diff=lfs merge=lfs -text diff --git a/pkgs/zsa-keymapp/default.nix b/pkgs/zsa-keymapp/default.nix index 66827fb..9231b9b 100644 --- a/pkgs/zsa-keymapp/default.nix +++ b/pkgs/zsa-keymapp/default.nix @@ -1,24 +1,27 @@ { buildFHSUserEnv, writeShellScript, + fetchzip, }: # Copied/Adapted from: https://github.com/pope/personal/commit/5cf0d43c7ffec572b46fcd96f08c5e9748ead9d4 let - # @2023-11 ZSA doesn't seem to have published Keymapp' sources, + # @2023-11 ZSA will not publish Keymapp' sources, # and only give a download link to the LATEST version of the built software. - # - # In the meantime, download the latest version from: - # https://oryx.nyc3.cdn.digitaloceanspaces.com/keymapp/keymapp-latest.tar.gz - # And put the binary locally in the repo (through Git LFS). - keymapp-binary = ./keymapp; + # NOTE: fetchzip is not limited to zip files and supports many archives formats + keymapp-binary = fetchzip { + url = "https://oryx.nyc3.cdn.digitaloceanspaces.com/keymapp/keymapp-latest.tar.gz"; + # WARNING: The URL is impure, it does not lock to a version, so the hash can easily be outdated + # (and I'd be aware of that only if I do a re-install without my current store) + hash = "sha256-+tunfmnjFsqhkmzK3V6efcJ9u3qapx41JUzH/z4dUis"; + # archive contains binary + an icon file, don't try to extract a single file + stripRoot = false; + }; in buildFHSUserEnv { name = "keymapp"; - runScript = writeShellScript "keymapp-wrapper.sh" '' - exec ${keymapp-binary} "$@" - ''; + runScript = "${keymapp-binary}/keymapp"; targetPkgs = pkgs: [ pkgs.gdk-pixbuf pkgs.glib diff --git a/pkgs/zsa-keymapp/keymapp b/pkgs/zsa-keymapp/keymapp deleted file mode 100755 index 61cf1b6..0000000 --- a/pkgs/zsa-keymapp/keymapp +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:853f4690ea47ced6bcdba3edbec672b166ed45803dbc2ed0ff678e85a1d5c218 -size 11350512