I have an error I cant figure out. In my home manager files I have defined:
options = {
tekslice.home.info.cliApps = lib.mkOption {
type = lib.types.listOf;
default = [];
};
};
Then elsewhere I have:
config = {
tekslice.home.info.cliApps = [ "yazi" ];
programs.yazi = {
enable = lib.mkDefault true;
};
};
and
config = lib.mkIf config.tekslice.home.shell.fish.enable {
tekslice.home.info.cliApps = [ "fish" ];
programs.fish = {
enable = lib.mkDefault config.tekslice.home.shell.fish.enable;
};
};
and
home.file = {
".config/info/installed_cli_apps.txt".text = ''
${config.tekslice.home.info.cliApps};
'';
};
However when I try to apply the config I get:
evaluating derivation 'git+file:///home/matthew/Git/nix-files#homeConfigurations."merror:
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:34:12:
33|
34| strict = derivationStrict drvAttrs;
| ^
35|
… while evaluating derivation 'home-manager-generation'
whose name attribute is located at /nix/store/apfqvr9kddcl6fscjvb92p4xdrqzcwk0-source/pkgs/stdenv/generic/make-derivation.nix:375:7
… while evaluating attribute 'buildCommand' of derivation 'home-manager-generation'
at /nix/store/apfqvr9kddcl6fscjvb92p4xdrqzcwk0-source/pkgs/build-support/trivial-builders/default.nix:59:17:
58| enableParallelBuilding = true;
59| inherit buildCommand name;
| ^
60| passAsFile = [ "buildCommand" ]
… while evaluating the option `home.file.".config/info/installed_cli_apps.txt".source':
… while evaluating definitions from `/nix/store/548acnkylzwsxfjd4l5g7yfmli77199b-source/modules/files.nix':
… while evaluating the option `home.file.".config/info/installed_cli_apps.txt".text':
… while evaluating definitions from `/nix/store/5izr1fm6cw1c9j1a2rwp3132ycdcnrh9-source/home-manager/common/cli/default.nix':
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: expected a set but found a function: «lambda listOf @ /nix/store/apfqvr9kddcl6fscjvb92p4xdrqzcwk0-source/lib/types.nix:564:14»
I have tried assigning “config.tekslice.home.info.cliApps” to a variable in a let binding and putting ${the-variable} in the text block but it gives the same error. Everything I find online says this should work, but im stumped.