For instance, it allows the option to be configured in home-manager, while plugins are set via a home-manager option.
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 { ... })
];
}
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>
May I ask what your full nixos-rebuild command is?
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.