Ask about garden
When you use inherit (config.garden.profiles.workstation), I wonder where you declare garden
There are several garden's scattered around, since that's just the name space I choose. But based on profiles your looking for https://github.com/isabelroses/dotfiles/blob/main/modules/generic/profiles.nix
There are several
garden's scattered around
Thx I mean how you use inherit (config.garden.profiles.workstation) instead
let
cfg = config.${namespace}.module;
in
{
options.${namespace}.module = with types; {
enable = mkBoolOpt false "Enable module";
};
config = mkIf cfg.enable { };
}
Anything for the module is configured per-host, for example https://github.com/isabelroses/dotfiles/blob/c4e94369e2792c040c5005c4b145611dcf17eede/systems/athena/default.nix
Anything for the module is configured per-host, for example https://github.com/isabelroses/dotfiles/blob/c4e94369e2792c040c5005c4b145611dcf17eede/systems/athena/default.nix
No this it what I'm looking for modules/generic/profiles.nix and modules/home/profiles.nix, which is how to declare config.garden
The options part of the module system is a bit magic in that it will "create" for a lack of better words the attrsets prior for you. For example
{
options.foo.bar.baz = {
enable = mkBoolOpt false "Enable module";
};
}
which will create config.foo and config.foo.baz and so on for you. So you don't need to declare them anywhere special.
The
optionspart of the module system is a bit magic in that it will "create" for a lack of better words the attrsets prior for you. For example{ options.foo.bar.baz = { enable = mkBoolOpt false "Enable module"; }; } which will create
config.fooandconfig.foo.bazand so on for you. So you don't need to declare them anywhere special.
I know, I'm sorry because not good in English. I mean I don't see any
options.foo.bar.baz = {
enable = mkBoolOpt false "Enable module";
In your dotfiles
I know, I'm sorry because not good in English. I mean I don't see any
options.foo.bar.baz = { enable = mkBoolOpt false "Enable module";In your dotfiles
the profiles are declared right here: https://github.com/isabelroses/dotfiles/blob/main/modules/generic/profiles.nix#L6
I use this
{lib,config, ...}: {
options.garden.profiles = {
workstation.enable = lib.mkEnableOption "workstation";
};
programs.fzf = {
inherit (config.garden.profiles.workstation) enable;
enableZshIntegration = true;
enableFishIntegration = true;
# enableNushellIntegration = true;
defaultOptions = [
"--height 40%"
"--border"
];
};
}
and error:
error: Module `/nix/store/s5yh3qqq871kr1scw2nqyclyq4vjj5xq-source/modules/home/cli-tui/fzf.nix' has an unsupported attribute `programs'. This is caused by introducing a top-level `config' or `options' attribute. Add configuration attributes immediately on the top level instead, or move all of them (namely: programs) into the explicit `config' attribute.
the profiles are declared right here:
main/modules%2Fgeneric%2Fprofiles.nix#L6
I think this can be write shorter with:
{ lib, ... }:
with lib;
let
enableOptions = names:
builtins.listToAttrs (map (name: {
inherit name;
value = mkEnableOption name;
}) names);
in
{
options.garden.profiles =
enableOptions [
"graphical" "headless" "workstation" "gaming" "laptop"
] // {
server = {
enable = mkEnableOption "server";
} // enableOptions [ "oracle" "hetzner" ];
};
}