Skip to content

nix: add extension support#434

Merged
aurelleb merged 1 commit intovicinaehq:mainfrom
schromp:nix-extension-support
Oct 7, 2025
Merged

nix: add extension support#434
aurelleb merged 1 commit intovicinaehq:mainfrom
schromp:nix-extension-support

Conversation

@schromp
Copy link
Copy Markdown
Contributor

@schromp schromp commented Oct 5, 2025

With this you can install extensions the following way:

services.vicinae = {
  extensions = [
    (inputs.vicinae-dev.mkVicinaeExtension.${pkgs.system} {
      inherit pkgs;
      name = "test-extension";
      src =
        pkgs.fetchFromGitHub {
          owner = "schromp";
          repo = "vicinae-extensions";
          rev = "f8be5c89393a336f773d679d22faf82d59631991";
          sha256 = "sha256-zk7WIJ19ITzRFnqGSMtX35SgPGq0Z+M+f7hJRbyQugw=";
        }
        + "/test-extension";
    })
    (inputs.vicinae-dev.mkVicinaeExtension.${pkgs.system} {
      inherit pkgs;
      name = "swww-switcher";
      src = pkgs.fetchFromGitHub {
        owner = "ViSovereign";
        repo = "swww-switcher";
        rev = "e29515ed74e27e58a631b2d2863bff19941b0c43";
        sha256 = "sha256-g+GNKwXNIuhnQ9u5C/wnp5KLwackF+FdOYXFiYk8WSI=";
      };
    })
  ];
};

I will add a section to the docs when/if this is merged.

I have taken most of the code from @kaan-w. I hope thats okay for you if not please say something :)

(This PR also moves a lot of the nix files into a seperate nix directory because we started to clutter the root quite alot)

@kaan-w
Copy link
Copy Markdown
Contributor

kaan-w commented Oct 5, 2025

I would appreciate it if you could add me as a co-author.

@schromp schromp force-pushed the nix-extension-support branch from 7bc7e4d to 5567e43 Compare October 5, 2025 18:44
@schromp
Copy link
Copy Markdown
Contributor Author

schromp commented Oct 5, 2025

I would appreciate it if you could add me as a co-author.

I hope i added you correctly. I didnt find a mail address so i used a github noreply one (as per.
If you want me to change that please give me your mail :)

@kaan-w
Copy link
Copy Markdown
Contributor

kaan-w commented Oct 5, 2025

If you want me to change that please give me your mail

Sorry for not including my email earlier. You can use the following address:
105508453+kaan-w@users.noreply.github.com

@schromp schromp force-pushed the nix-extension-support branch from 5567e43 to 3f08688 Compare October 5, 2025 21:58
@schromp
Copy link
Copy Markdown
Contributor Author

schromp commented Oct 5, 2025

done :)

@aurelleb
Copy link
Copy Markdown
Contributor

aurelleb commented Oct 6, 2025

the push to cachix workflow fails, not sure why

@kaan-w
Copy link
Copy Markdown
Contributor

kaan-w commented Oct 6, 2025

Maybe move ./nix/default.nix back to root and update the callPackage path?

Co-authored-by: kaan-w 105508453+kaan-w@users.noreply.github.com
@schromp schromp force-pushed the nix-extension-support branch from 3f08688 to 543c1db Compare October 6, 2025 17:39
@schromp
Copy link
Copy Markdown
Contributor Author

schromp commented Oct 6, 2025

Though this is one file more in root again.
Was the default file necessary for people without flakes, do i remember that right?

@aurelleb aurelleb merged commit f58a249 into vicinaehq:main Oct 7, 2025
4 checks passed
@kaan-w
Copy link
Copy Markdown
Contributor

kaan-w commented Oct 7, 2025

Co-author didn't work. There had to be a newline after the commit message and email between the <> brackets.

@schromp
Copy link
Copy Markdown
Contributor Author

schromp commented Oct 8, 2025

Co-author didn't work 🥲 There had to be a newline after the commit message and email between the <> brackets ig.

Damn sorry. Maybe @aurelien-brabant can atleast edit the release notes to include you for the change?

@aurelleb
Copy link
Copy Markdown
Contributor

aurelleb commented Oct 8, 2025

Damn sorry. Maybe @aurelien-brabant can atleast edit the release notes to include you for the change?

Done :)

@leiserfg
Copy link
Copy Markdown

leiserfg commented Oct 31, 2025

Guys, now that vicinae is in nixpkgs, would you mind coping this module to home-manager? I could do it myself too, I'm just not sure if you like me to do so. @schromp

@kaan-w
Copy link
Copy Markdown
Contributor

kaan-w commented Oct 31, 2025

@mawkler
Copy link
Copy Markdown

mawkler commented Nov 2, 2025

Thanks for adding Nix support for installing extensions!

What's the best way to install Raycast extensions from Nix? I tried doing this:

extensions = [
	(inputs.vicinae.mkVicinaeExtension.${pkgs.system} {
		inherit pkgs;
		name = "Gif Search";
		src = pkgs.fetchFromGitHub {
			owner = "raycast";
			repo = "extensions";
			rev = "4d417c2dfd86a5b2bea202d4a7b48d8eb3dbaeb1";
			sha256 = "";
		} + "/extensions/gif-search";
	})
];

...but it seems to take forever because it has to clone the entire Raycast extensions library. Is there a better way to do this?

@kaan-w
Copy link
Copy Markdown
Contributor

kaan-w commented Nov 2, 2025

...but it seems to take forever because it has to clone the entire Raycast extensions library. Is there a better way to do this?

I couldn't figure this out too.

@leiserfg
Copy link
Copy Markdown

leiserfg commented Nov 2, 2025

Fetching only the extension folder is easy, you just need to do something as:

 ...
        src =
          pkgs.fetchgit {
            url = "https://github.com/raycast/extensions";
            rev = "4d417c2dfd86a5b2bea202d4a7b48d8eb3dbaeb1";
            sha256 = "sha256-G7il8T1L+P/2mXWJsb68n4BCbVKcrrtK8GnBNxzt73Q=";
            sparseCheckout = [
              "/extensions/gif-search"
            ];
          }
          + "/extensions/gif-search";
...

But we need another function to build the package as the code for the raycast extention is not in /build/.local/share/vicinae/extensions/${name}

Changing this makes it work:

          # cp -r /build/.local/share/vicinae/extensions/${name}/* $out/

          cp -r /build/.config/raycast/extensions/${name}/* $out/

I'll add this one to the PR for home-manager.

@leiserfg
Copy link
Copy Markdown

leiserfg commented Nov 2, 2025

See here
nix-community/home-manager@cc83703

r6mez pushed a commit to r6mez/vicinae that referenced this pull request Jan 2, 2026
Co-authored-by: kaan-w 105508453+kaan-w@users.noreply.github.com

Co-authored-by: schromp <lennart@koziollek.com>
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.

5 participants