this post was submitted on 13 Feb 2026
2 points (100.0% liked)

Nix / NixOS

2621 readers
8 users here now

Main links

Videos

founded 2 years ago
MODERATORS
 

I'm using xdg.dataFile in order to install krita plugin, the issue is that krita plugin need to have their content placed in the `~/.local/share/krita/pykrita" and cannot be put in subfolder. For now I'm doing

  xdg.dataFile = {
    "krita/pykrita" = {
      enable = true;
      source = pkgs.fetchFromGitHub {
        owner = "veryprofessionaldodo";
        repo = "Krita-UI-Redesign";
        rev = "df37ade2334b09ca30820286e3e16c26b0fbb4f8";
        hash = "sha256-kGs1K2aNIiQq//W8IQ2JX4iyXq43z2I/WnI8aJjg8Yk=";
      };
      recursive = true;
    };
  };

It's fine when i use a single plugin, but when a use multiple plugins i gotta use multiple fetchers which im not sure how to do. tried to do source = <fetcher 1> + <fetcher 2> which surprisingly builds but then the home-manager service fails

top 1 comments
sorted by: hot top controversial new old
[–] stupiv@lemmy.ml 1 points 2 hours ago

pkgs.symlinkJoin might help:

{pkgs, ...}: let
  plugin1 = pkgs.fetchFromGitHub { ... };
  plugin2 = pkgs.fetchFromGitHub { ... };
in {
  xdg.dataFile = {
    "krita/pykrita" = {
      enable = true;
      source = pkgs.symlinkJoin {
        name = "pykrita";
        paths = [
          plugin1
          plugin2
        ];
      };
      recursive = true;
    };
  };
}

You might also want to define plugins in separate files:

# krita-plugins.nix
{
  config,
  lib,
  pkgs,
  ...
}:
with lib; {
  options.yourOptions.krita.plugins = mkOption {
    type = types.listOf types.path;
    default = [];
  };
  config = {
    xdg.dataFile = {
      "krita/pykrita" = {
        enable = true;
        source = pkgs.symlinkJoin {
          name = "pykrita";
          paths = config.yourOptions.krita.plugins;
        };
        recursive = true;
      };
    };
  };
}
# kirta-plugin-a.nix
{pkgs, ...}: {
  yourOptions.krita.plugins = [
    (pkgs.fetchFromGitHub { ... })
  ];
}
# kirta-plugin-b.nix
{pkgs, ...}: {
  yourOptions.krita.plugins = [
    (pkgs.fetchFromGitHub { ... })
  ];
}