[–] 2 points 8 months ago* (last edited 8 months ago) (2 children)

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 manage your 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 { ... })
  ];
}
  • source
  • [–] 2 points 8 months ago (1 child)

    Do you know about pkg-config --cflags?

        devShells.${system}.default = pkgs.mkShell {
          buildInputs = with pkgs; [
            pkg-config
            clang
            wlroots_0_19
          ];
        };
    

    pkg-config --cflags wlroots-0.19 outputs -I/nix/store/pkg-hash-wlroots-0.19.0/include/wlroots-0.19

    clang your-file.c $(pkg-config --cflags wlroots-0.19) should resolve #include <wlr/backend.h>

  • source
  • [–] 3 points 9 months ago* (last edited 9 months ago)
      programs.fish.enable = true; # Enable your shell
      home.sessionPath = ["$HOME/.local/bin"];
    

    I found the option by searching for "PATH" at home-manager-options.extranix.com.

    home.sessionPath will generate hm-session-vars files for different shells. You can read it by cat ~/.nix-profile/etc/profile.d/hm-session-vars.sh.

    Enabling the shell is required for the respective hm-session-vars file to be sourced into the shell.

  • source