Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update source attributes other than src #202

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Artturin
Copy link
Contributor

@Artturin Artturin commented Oct 17, 2023

Motivation is to update packages such as catppuccin CC @khaneliman and lambda-lisp CC @cafkafk

Diff Setting bat source to an old version and adding sources to passthru

diff --git a/pkgs/data/themes/catppuccin/default.nix b/pkgs/data/themes/catppuccin/default.nix
index 16befcd06b81..46214c6ed74b 100644
--- a/pkgs/data/themes/catppuccin/default.nix
+++ b/pkgs/data/themes/catppuccin/default.nix
@@ -20,8 +20,8 @@ let
       name = "bat";
       owner = "catppuccin";
       repo = "bat";
-      rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1";
-      hash = "sha256-6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw=";
+      rev = "00bd462e8fab5f74490335dcf881ebe7784d23fa";
+      hash = "sha256-yzn+1IXxQaKcCK7fBdjtVohns0kbN+gcqbWVE4Bx7G8=";
     };
 
     bottom = fetchFromGitHub {
@@ -102,6 +102,8 @@ stdenvNoCC.mkDerivation {
     runHook postInstall
   '';
 
+  passthru = { inherit sources; };
+
   meta = {
     description = "Soothing pastel themes";
     homepage = "https://github.com/catppuccin/catppuccin";

nix-update "catppuccin" --src-attr "sources.bat"

It would be nice to be able to use nix-update to update such sources instead of a custom update script

Related #163 because being able to pass catppuccin.sources.bat would fix this issue too.

@Artturin Artturin marked this pull request as draft October 17, 2023 04:02
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently fails with

nix_update.errors.VersionError: Please specify the version. We can only get the latest version from codeberg/crates.io/gitea/github/gitlab/notabug/pypi/savannah/sourcehut/rubygems projects right now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Output of the pprint(package)

Package(attribute='catppuccin',
        name='catppuccin-unstable-2023-10-09',
        old_version='unstable-2023-10-09',
        filename='/home/artturin/nixgits/my-nixpkgs/pkgs/data/themes/catppuccin/default.nix',
        line=19,
        urls=['https://github.com/catppuccin/bat/archive/00bd462e8fab5f74490335dcf881ebe7784d23fa.tar.gz'],
        url='https://github.com/catppuccin/bat/archive/00bd462e8fab5f74490335dcf881ebe7784d23fa.tar.gz',
        src_homepage='https://github.com/catppuccin/bat',
        changelog=None,
        rev='00bd462e8fab5f74490335dcf881ebe7784d23fa',
        hash='sha256-yzn+1IXxQaKcCK7fBdjtVohns0kbN+gcqbWVE4Bx7G8=',
        go_modules=None,
        go_modules_old=None,
        cargo_deps=None,
        npm_deps=None,
        yarn_deps=None,
        tests=[],
        has_update_script=False,
        parsed_url=ParseResult(scheme='https', netloc='github.com', path='/catppuccin/bat/archive/00bd462e8fab5f74490335dcf881ebe7784d23fa.tar.gz', params='', query='', fragment=''),
        new_version=None,
        version_position=Position(file='/home/artturin/nixgits/my-nixpkgs/pkgs/data/themes/catppuccin/default.nix',
                                  line=66,
                                  column=3),
        cargo_lock=<nix_update.eval.NoCargoLock object at 0x7fc032a9e150>,
        diff_url=None)

@Artturin Artturin force-pushed the directlyfetcherupdating branch 2 times, most recently from c6b9e65 to 818ce25 Compare October 17, 2023 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant