gpodder-adaptive: 3.11.1+1 -> 3.11.2+1 and add an updateScript
This commit is contained in:
31
flake.nix
31
flake.nix
@@ -4,6 +4,8 @@
|
|||||||
# - this is marginally the case with schemes like `github:nixos/nixpkgs`.
|
# - this is marginally the case with schemes like `github:nixos/nixpkgs`.
|
||||||
# - given the *existing* `git+https://` scheme, i propose expressing github URLs similarly:
|
# - given the *existing* `git+https://` scheme, i propose expressing github URLs similarly:
|
||||||
# - `github+https://github.com/nixos/nixpkgs/tree/nixos-22.11`
|
# - `github+https://github.com/nixos/nixpkgs/tree/nixos-22.11`
|
||||||
|
# - this would allow for the same optimizations as today's `github:nixos/nixpkgs`, but without obscuring the source.
|
||||||
|
# a code reader could view the source being referenced simply by clicking the https:// portion of that URI.
|
||||||
# - need some way to apply local patches to inputs.
|
# - need some way to apply local patches to inputs.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
@@ -253,6 +255,19 @@
|
|||||||
# let the user handle that edge case by re-running this whole command
|
# let the user handle that edge case by re-running this whole command
|
||||||
nixos-rebuild --flake '.#${host}' ${action} --target-host colin@${addr} --use-remote-sudo $@
|
nixos-rebuild --flake '.#${host}' ${action} --target-host colin@${addr} --use-remote-sudo $@
|
||||||
'';
|
'';
|
||||||
|
mkUpdater = attrPath: {
|
||||||
|
type = "app";
|
||||||
|
program = let
|
||||||
|
pkg = pkgs.lib.getAttrFromPath attrPath pkgs;
|
||||||
|
strAttrPath = pkgs.lib.concatStringsSep "." attrPath;
|
||||||
|
in builtins.toString (pkgs.writeShellScript "update-${pkg.name}" ''
|
||||||
|
export UPDATE_NIX_NAME=${pkg.name}
|
||||||
|
export UPDATE_NIX_PNAME=${pkg.pname}
|
||||||
|
export UPDATE_NIX_OLD_VERSION=${pkg.version}
|
||||||
|
export UPDATE_NIX_ATTR_PATH=${strAttrPath}
|
||||||
|
${pkgs.lib.escapeShellArgs pkg.updateScript.command}
|
||||||
|
'');
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
help = {
|
help = {
|
||||||
type = "app";
|
type = "app";
|
||||||
@@ -276,20 +291,8 @@
|
|||||||
program = "${pkgs.feeds.updateScript}";
|
program = "${pkgs.feeds.updateScript}";
|
||||||
};
|
};
|
||||||
|
|
||||||
update-bpc = {
|
update-bpc = mkUpdater [ "firefox-extensions" "unwrapped" "bypass-paywalls-clean" ];
|
||||||
# proof-of-concept updater like in nixpkgs
|
update-gpodder-adaptive = mkUpdater [ "gpodder-adaptive" ];
|
||||||
# TODO: extend this to update all my packages
|
|
||||||
type = "app";
|
|
||||||
program = let
|
|
||||||
pkg = pkgs.firefox-extensions.unwrapped.bypass-paywalls-clean;
|
|
||||||
in builtins.toString (pkgs.writeShellScript "update-bpc" ''
|
|
||||||
export UPDATE_NIX_NAME=${pkg.name}
|
|
||||||
export UPDATE_NIX_PNAME=${pkg.pname}
|
|
||||||
export UPDATE_NIX_OLD_VERSION=${pkg.version}
|
|
||||||
export UPDATE_NIX_ATTR_PATH=firefox-extensions.unwrapped.bypass-paywalls-clean
|
|
||||||
${pkgs.lib.escapeShellArgs pkg.updateScript.command}
|
|
||||||
'');
|
|
||||||
};
|
|
||||||
|
|
||||||
init-feed = {
|
init-feed = {
|
||||||
type = "app";
|
type = "app";
|
||||||
|
@@ -1,15 +1,18 @@
|
|||||||
{ gpodder
|
{ gpodder
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
|
, gitUpdater
|
||||||
, libhandy
|
, libhandy
|
||||||
}:
|
}:
|
||||||
gpodder.overridePythonAttrs (upstream: rec {
|
|
||||||
|
let
|
||||||
|
self = gpodder.overridePythonAttrs (upstream: rec {
|
||||||
pname = "gpodder-adaptive";
|
pname = "gpodder-adaptive";
|
||||||
version = "3.11.1+1";
|
version = "3.11.2+1";
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "gpodder";
|
owner = "gpodder";
|
||||||
repo = "gpodder";
|
repo = "gpodder";
|
||||||
rev = "adaptive/${version}";
|
rev = "adaptive/${version}";
|
||||||
hash = "sha256-pn5sh8CLV2Civ26PL3rrkkUdoobu7SIHXmWKCZucBhw=";
|
hash = "sha256-DJ5/9PFRc0uVREy4JmFVweiSGtXZ8wyb+XaNmjI5/k4=";
|
||||||
};
|
};
|
||||||
|
|
||||||
# nixpkgs `gpodder` uses the `format = "other"` Makefile build flow.
|
# nixpkgs `gpodder` uses the `format = "other"` Makefile build flow.
|
||||||
@@ -30,4 +33,19 @@ gpodder.overridePythonAttrs (upstream: rec {
|
|||||||
buildInputs = upstream.buildInputs ++ [
|
buildInputs = upstream.buildInputs ++ [
|
||||||
libhandy
|
libhandy
|
||||||
];
|
];
|
||||||
})
|
|
||||||
|
passthru.updateScript = gitUpdater {
|
||||||
|
rev-prefix = "adaptive/";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
in self // {
|
||||||
|
meta = self.meta // {
|
||||||
|
# ensure nix thinks the canonical position of this derivation is inside my own repo,
|
||||||
|
# not upstream nixpkgs repo. this ensures that the updateScript can patch the version/hash
|
||||||
|
# of the right file. meta.position gets overwritten if set in overrideAttrs, hence this
|
||||||
|
# manual `//` hack
|
||||||
|
position = let
|
||||||
|
pos = builtins.unsafeGetAttrPos "updateScript" self.passthru;
|
||||||
|
in "${pos.file}:${builtins.toString pos.line}";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user