From a7b7966d52cdf2913a7be055d74aa5f24407f14a Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 25 Mar 2024 22:42:23 -0400 Subject: [PATCH] refactor: improve custom packages' versioning --- common/home/trash-d/trash-d.nix | 2 +- common/overlays/dracula-theme/default.nix | 1 + common/overlays/dracula-theme/git.nix | 2 +- common/overlays/dracula-theme/plymouth.nix | 2 +- common/pkgs/pam-fprint-grosshack/default.nix | 2 +- common/pkgs/pokemon-colorscripts/default.nix | 2 +- devices/binto/modules/gpu-replay.nix | 2 +- .../nos/modules/subtitles/subsync/default.nix | 12 +++++- .../subtitles/subsync/pocketsphinx.nix | 37 ++++++++++--------- .../modules/subtitles/subsync/sphinxbase.nix | 2 +- .../nos/modules/subtitles/subsync/subsync.nix | 11 ++---- flake.lock | 34 +++++++++++++++++ flake.nix | 14 +++++++ home/firefox/firefox-gx/default.nix | 2 +- home/mpv/scripts/modernx.nix | 2 +- home/mpv/scripts/persist-properties.nix | 2 +- home/mpv/scripts/pointer-event.nix | 2 +- home/mpv/scripts/touch-gestures.nix | 2 +- home/mpv/scripts/undo-redo.nix | 2 +- 19 files changed, 95 insertions(+), 40 deletions(-) diff --git a/common/home/trash-d/trash-d.nix b/common/home/trash-d/trash-d.nix index 9062e73..4c99ce0 100644 --- a/common/home/trash-d/trash-d.nix +++ b/common/home/trash-d/trash-d.nix @@ -8,7 +8,7 @@ }: stdenv.mkDerivation { name = "trash"; - version = trash-d-src.rev; + version = trash-d-src.shortRev; src = trash-d-src; diff --git a/common/overlays/dracula-theme/default.nix b/common/overlays/dracula-theme/default.nix index f8df0cc..6076f96 100644 --- a/common/overlays/dracula-theme/default.nix +++ b/common/overlays/dracula-theme/default.nix @@ -9,6 +9,7 @@ plymouth = prev.callPackage ./plymouth.nix inputs; wallpaper = prev.fetchurl (import ./wallpaper.nix); in { + version = gtk-theme-src.shortRev; src = gtk-theme-src; installPhase = '' diff --git a/common/overlays/dracula-theme/git.nix b/common/overlays/dracula-theme/git.nix index f13840d..7cdc447 100644 --- a/common/overlays/dracula-theme/git.nix +++ b/common/overlays/dracula-theme/git.nix @@ -5,7 +5,7 @@ }: stdenv.mkDerivation { name = "dracula-git"; - version = git-theme-src.rev; + version = git-theme-src.shortRev; src = git-theme-src; diff --git a/common/overlays/dracula-theme/plymouth.nix b/common/overlays/dracula-theme/plymouth.nix index 7196f71..45318fa 100644 --- a/common/overlays/dracula-theme/plymouth.nix +++ b/common/overlays/dracula-theme/plymouth.nix @@ -5,7 +5,7 @@ }: stdenv.mkDerivation { name = "dracula-plymouth"; - version = plymouth-theme-src.rev; + version = plymouth-theme-src.shortRev; src = plymouth-theme-src; diff --git a/common/pkgs/pam-fprint-grosshack/default.nix b/common/pkgs/pam-fprint-grosshack/default.nix index 362542d..64b9c3f 100644 --- a/common/pkgs/pam-fprint-grosshack/default.nix +++ b/common/pkgs/pam-fprint-grosshack/default.nix @@ -15,7 +15,7 @@ }: stdenv.mkDerivation { name = "pam-fprint-grosshack"; - version = pam-fprint-grosshack-src.rev; + version = pam-fprint-grosshack-src.shortRev; src = pam-fprint-grosshack-src; diff --git a/common/pkgs/pokemon-colorscripts/default.nix b/common/pkgs/pokemon-colorscripts/default.nix index 464fd54..c193638 100644 --- a/common/pkgs/pokemon-colorscripts/default.nix +++ b/common/pkgs/pokemon-colorscripts/default.nix @@ -6,7 +6,7 @@ }: stdenv.mkDerivation { name = "pokemon-colorscripts"; - version = pokemon-colorscripts-src.rev; + version = pokemon-colorscripts-src.shortRev; src = pokemon-colorscripts-src; diff --git a/devices/binto/modules/gpu-replay.nix b/devices/binto/modules/gpu-replay.nix index b87676d..01be48b 100644 --- a/devices/binto/modules/gpu-replay.nix +++ b/devices/binto/modules/gpu-replay.nix @@ -11,7 +11,7 @@ gsr = pkgs.stdenv.mkDerivation { name = "gpu-screen-recorder"; - version = gpu-screen-recorder-src.rev; + version = gpu-screen-recorder-src.shortRev; src = gpu-screen-recorder-src; diff --git a/devices/nos/modules/subtitles/subsync/default.nix b/devices/nos/modules/subtitles/subsync/default.nix index cc37527..074f1e6 100644 --- a/devices/nos/modules/subtitles/subsync/default.nix +++ b/devices/nos/modules/subtitles/subsync/default.nix @@ -1,13 +1,21 @@ { config, pkgs, + pocketsphinx-src, + subsync-src, ... }: let inherit (config.vars) mainUser; sphinxbase = pkgs.callPackage ./sphinxbase.nix {}; - pocketsphinx = pkgs.callPackage ./pocketsphinx.nix {inherit sphinxbase;}; - subsync = pkgs.callPackage ./subsync.nix {inherit sphinxbase pocketsphinx;}; + + pocketsphinx = pkgs.callPackage ./pocketsphinx.nix { + inherit sphinxbase pocketsphinx-src; + }; + + subsync = pkgs.callPackage ./subsync.nix { + inherit sphinxbase pocketsphinx subsync-src; + }; in { systemd = { services.subsync-job = { diff --git a/devices/nos/modules/subtitles/subsync/pocketsphinx.nix b/devices/nos/modules/subtitles/subsync/pocketsphinx.nix index cdc6a25..ce00c1d 100644 --- a/devices/nos/modules/subtitles/subsync/pocketsphinx.nix +++ b/devices/nos/modules/subtitles/subsync/pocketsphinx.nix @@ -1,26 +1,29 @@ { cmake, - fetchFromGitHub, pkg-config, + pocketsphinx-src, sphinxbase, stdenv, ... -}: -stdenv.mkDerivation rec { - name = "pocketsphinx"; - version = "unstable"; +}: let + pyproject = + ( + fromTOML ( + builtins.readFile "${pocketsphinx-src}/pyproject.toml" + ) + ) + .project; +in + stdenv.mkDerivation rec { + name = "pocketsphinx"; + inherit (pyproject) version; - src = fetchFromGitHub { - owner = "cmusphinx"; - repo = "pocketsphinx"; - rev = "7be89aae3e76568e02e4f3d41cf1adcb7654430c"; - hash = "sha256-imrwUIpORpfInitVjU11SKPPpjvObKyfI8IB4f41hfY="; - }; + src = pocketsphinx-src; - buildInputs = [pkg-config]; - nativeBuildInputs = [cmake sphinxbase]; + buildInputs = [pkg-config]; + nativeBuildInputs = [cmake sphinxbase]; - postFixup = '' - cp -ar ${src}/src/util $out/include - ''; -} + postFixup = '' + cp -ar ${src}/src/util $out/include + ''; + } diff --git a/devices/nos/modules/subtitles/subsync/sphinxbase.nix b/devices/nos/modules/subtitles/subsync/sphinxbase.nix index 299cb49..8db0624 100644 --- a/devices/nos/modules/subtitles/subsync/sphinxbase.nix +++ b/devices/nos/modules/subtitles/subsync/sphinxbase.nix @@ -10,7 +10,7 @@ }: stdenv.mkDerivation { name = "sphinxbase"; - version = "unstable"; + version = "5prealpha"; # Deprecated buildInputs = [bison pkg-config python3 swig2]; nativeBuildInputs = [autoreconfHook]; diff --git a/devices/nos/modules/subtitles/subsync/subsync.nix b/devices/nos/modules/subtitles/subsync/subsync.nix index 43b173b..43b3c60 100644 --- a/devices/nos/modules/subtitles/subsync/subsync.nix +++ b/devices/nos/modules/subtitles/subsync/subsync.nix @@ -1,24 +1,19 @@ { - fetchFromGitHub, ffmpeg, pkg-config, pocketsphinx, python3Packages, sphinxbase, + subsync-src, ... }: let inherit (builtins) concatStringsSep; in python3Packages.buildPythonPackage { pname = "subsync"; - version = "unstable"; + version = subsync-src.shortRev; - src = fetchFromGitHub { - owner = "sc0ty"; - repo = "subsync"; - rev = "8e0cf71960b9a5418acb60a1910cf3295d67e6bf"; - hash = "sha256-jUur1U1yNShQx70/mj36+sGoVk8+E5hQUV/G79q2A2k="; - }; + src = subsync-src; buildInputs = [ ffmpeg diff --git a/flake.lock b/flake.lock index 4e846a4..6b1153f 100644 --- a/flake.lock +++ b/flake.lock @@ -1409,6 +1409,22 @@ "type": "github" } }, + "pocketsphinx-src": { + "flake": false, + "locked": { + "lastModified": 1707149455, + "narHash": "sha256-imrwUIpORpfInitVjU11SKPPpjvObKyfI8IB4f41hfY=", + "owner": "cmusphinx", + "repo": "pocketsphinx", + "rev": "7be89aae3e76568e02e4f3d41cf1adcb7654430c", + "type": "github" + }, + "original": { + "owner": "cmusphinx", + "repo": "pocketsphinx", + "type": "github" + } + }, "pointer-event-src": { "flake": false, "locked": { @@ -1497,9 +1513,11 @@ "pcsd": "pcsd", "persist-properties-src": "persist-properties-src", "plymouth-theme-src": "plymouth-theme-src", + "pocketsphinx-src": "pocketsphinx-src", "pointer-event-src": "pointer-event-src", "pokemon-colorscripts-src": "pokemon-colorscripts-src", "secrets": "secrets", + "subsync-src": "subsync-src", "touch-gestures-src": "touch-gestures-src", "trash-d-src": "trash-d-src", "vimplugin-riscv-src": "vimplugin-riscv-src", @@ -1565,6 +1583,22 @@ "type": "github" } }, + "subsync-src": { + "flake": false, + "locked": { + "lastModified": 1681249928, + "narHash": "sha256-jUur1U1yNShQx70/mj36+sGoVk8+E5hQUV/G79q2A2k=", + "owner": "sc0ty", + "repo": "subsync", + "rev": "8e0cf71960b9a5418acb60a1910cf3295d67e6bf", + "type": "github" + }, + "original": { + "owner": "sc0ty", + "repo": "subsync", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index bc3ce7c..336dbbc 100644 --- a/flake.nix +++ b/flake.nix @@ -292,6 +292,20 @@ # -= Non-flake inputs =- ## Custom packages + pocketsphinx-src = { + type = "github"; + owner = "cmusphinx"; + repo = "pocketsphinx"; + flake = false; + }; + + subsync-src = { + type = "github"; + owner = "sc0ty"; + repo = "subsync"; + flake = false; + }; + trash-d-src = { type = "github"; owner = "rushsteve1"; diff --git a/home/firefox/firefox-gx/default.nix b/home/firefox/firefox-gx/default.nix index 47c5618..b96ddd4 100644 --- a/home/firefox/firefox-gx/default.nix +++ b/home/firefox/firefox-gx/default.nix @@ -5,7 +5,7 @@ }: stdenvNoCC.mkDerivation { pname = "firefox-gx"; - version = firefox-gx-src.rev; + version = firefox-gx-src.shortRev; src = firefox-gx-src; diff --git a/home/mpv/scripts/modernx.nix b/home/mpv/scripts/modernx.nix index b9bde0d..7e37462 100644 --- a/home/mpv/scripts/modernx.nix +++ b/home/mpv/scripts/modernx.nix @@ -6,7 +6,7 @@ }: buildLua (finalAttrs: { pname = "modernx"; - version = modernx-src.rev; + version = modernx-src.shortRev; src = modernx-src; diff --git a/home/mpv/scripts/persist-properties.nix b/home/mpv/scripts/persist-properties.nix index aa8b194..409b481 100644 --- a/home/mpv/scripts/persist-properties.nix +++ b/home/mpv/scripts/persist-properties.nix @@ -5,7 +5,7 @@ }: buildLua { pname = "persist-properties"; - version = persist-properties-src.rev; + version = persist-properties-src.shortRev; src = persist-properties-src; } diff --git a/home/mpv/scripts/pointer-event.nix b/home/mpv/scripts/pointer-event.nix index e9b0003..9bc0079 100644 --- a/home/mpv/scripts/pointer-event.nix +++ b/home/mpv/scripts/pointer-event.nix @@ -5,7 +5,7 @@ }: buildLua { pname = "pointer-event"; - version = pointer-event-src.rev; + version = pointer-event-src.shortRev; src = pointer-event-src; } diff --git a/home/mpv/scripts/touch-gestures.nix b/home/mpv/scripts/touch-gestures.nix index 2bd05eb..87bfd5a 100644 --- a/home/mpv/scripts/touch-gestures.nix +++ b/home/mpv/scripts/touch-gestures.nix @@ -5,7 +5,7 @@ }: buildLua { pname = "touch-gestures"; - version = touch-gestures-src.rev; + version = touch-gestures-src.shortRev; src = touch-gestures-src; } diff --git a/home/mpv/scripts/undo-redo.nix b/home/mpv/scripts/undo-redo.nix index 8251766..fd4b3af 100644 --- a/home/mpv/scripts/undo-redo.nix +++ b/home/mpv/scripts/undo-redo.nix @@ -5,7 +5,7 @@ }: buildLua rec { pname = "undo-redo"; - version = eisa-scripts-src.rev; + version = eisa-scripts-src.shortRev; src = eisa-scripts-src; scriptPath = "${src}/scripts/UndoRedo.lua";