Closed pf56 closed 1 year ago
Getting the same behavior here.
Adding it to my flake.nix returns
error: attribute 'lollypops' missing
.
This means it tried to find lollypops
in one of your nixosConfigurations
but could not find it. That is expected because you have only imported it here but it is missing in the other ones. You can either import it in all of them or you have to change the configFlake = self
here so you only pass the ones that have it imported.
For example this should work to only pass the one nixosConfigration where you have it imported:
{
apps."x86_64-linux".default = lollypops.apps."x86_64-linux".default {
configFlake = {
nixosConfigurations.nomadserver-01 = self.nixosConfigurations.nomadserver-01;
};
};
}
As for the second error (missing home-manager) I see where this is coming from: It is expecting home-manager to be present in the configuration and not finding it. This is a bug, I'll add a check to only try to get it when it exists.
If added a check, let me know if it works now
Thanks for the quick response. I shuffled some code around and could get it working.
I want to point out that importing lollypops.hmModule
was necessary for me. Without it, it would fail with the error message below. The docs make it seem like it's supposed to be optional, so I'm not sure if this is intended.
For reference: These are the two changesets I needed to set up lollypops (one two).
➜ nix run '.' --show-trace -- --list-all
error: attribute 'lollypops' missing
at /nix/store/y6cpf5dxqn9f8vckrq9sxkmqqlifi0vy-source/flake.nix:53:21:
52| ])
53| userconfig.lollypops.secrets.files))
| ^
54|
… while evaluating 'flatten'
at /nix/store/0b1s6l5i9izifskg8kgc29jn5bzgdjnv-source/lib/lists.nix:138:13:
137| */
138| flatten = x:
| ^
139| if isList x
… from call site
at /nix/store/0b1s6l5i9izifskg8kgc29jn5bzgdjnv-source/lib/lists.nix:140:24:
139| if isList x
140| then concatMap (y: flatten y) x
| ^
141| else [x];
… while evaluating anonymous lambda
at /nix/store/0b1s6l5i9izifskg8kgc29jn5bzgdjnv-source/lib/lists.nix:140:21:
139| if isList x
140| then concatMap (y: flatten y) x
| ^
141| else [x];
… from call site
at /nix/store/0b1s6l5i9izifskg8kgc29jn5bzgdjnv-source/lib/lists.nix:140:10:
139| if isList x
140| then concatMap (y: flatten y) x
| ^
141| else [x];
… while evaluating 'flatten'
at /nix/store/0b1s6l5i9izifskg8kgc29jn5bzgdjnv-source/lib/lists.nix:138:13:
137| */
138| flatten = x:
| ^
139| if isList x
… from call site
at /nix/store/0b1s6l5i9izifskg8kgc29jn5bzgdjnv-source/lib/lists.nix:140:24:
139| if isList x
140| then concatMap (y: flatten y) x
| ^
141| else [x];
… while evaluating anonymous lambda
at /nix/store/0b1s6l5i9izifskg8kgc29jn5bzgdjnv-source/lib/lists.nix:140:21:
139| if isList x
140| then concatMap (y: flatten y) x
| ^
141| else [x];
… from call site
at /nix/store/0b1s6l5i9izifskg8kgc29jn5bzgdjnv-source/lib/lists.nix:140:10:
139| if isList x
140| then concatMap (y: flatten y) x
| ^
141| else [x];
… while evaluating 'flatten'
at /nix/store/0b1s6l5i9izifskg8kgc29jn5bzgdjnv-source/lib/lists.nix:138:13:
137| */
138| flatten = x:
| ^
139| if isList x
… from call site
at /nix/store/y6cpf5dxqn9f8vckrq9sxkmqqlifi0vy-source/flake.nix:32:42:
31| # Build steps for all secrets of all users
32| mkSeclistUser = homeUsers: pkgs.lib.lists.flatten (builtins.attrValues (builtins.mapAttrs
| ^
33| (user: userconfig: [
… while evaluating 'mkSeclistUser'
at /nix/store/y6cpf5dxqn9f8vckrq9sxkmqqlifi0vy-source/flake.nix:32:31:
31| # Build steps for all secrets of all users
32| mkSeclistUser = homeUsers: pkgs.lib.lists.flatten (builtins.attrValues (builtins.mapAttrs
| ^
33| (user: userconfig: [
… from call site
at /nix/store/y6cpf5dxqn9f8vckrq9sxkmqqlifi0vy-source/flake.nix:113:29:
112| ++ (if builtins.hasAttr "home-manager" hostConfig.config then
113| mkSeclistUser hostConfig.config.home-manager.users else [ ]);
| ^
114| };
… while evaluating the attribute 'text' of the derivation 'CommonTasks.yml'
at /nix/store/0b1s6l5i9izifskg8kgc29jn5bzgdjnv-source/pkgs/stdenv/generic/make-derivation.nix:270:7:
269| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
270| name =
| ^
271| let
… while evaluating the attribute 'text' of the derivation 'Taskfile.yml'
at /nix/store/0b1s6l5i9izifskg8kgc29jn5bzgdjnv-source/pkgs/stdenv/generic/make-derivation.nix:270:7:
269| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
270| name =
| ^
271| let
… while evaluating the attribute 'text' of the derivation 'go-task-runner'
at /nix/store/0b1s6l5i9izifskg8kgc29jn5bzgdjnv-source/pkgs/stdenv/generic/make-derivation.nix:270:7:
269| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
270| name =
| ^
271| let
I think I see what I missed here. I'm checking only if home-manager exists in the system, but not if the hmModule
of lollypops is imported. Thanks for reporting, Looking into it!
@pf56 Should be fixed by 4a211f494721dba036c9ce8f9c505683f58de95b
We now check for home-manager and hmModule. The use of the module should be optional that way.
I can't get the basic example from the readme to work. Adding it to my flake.nix returns
error: attribute 'lollypops' missing
.I tried to narrow it down by removing my other
nixosConfigurations
andpackages
, but then it complained about home-manager being missing.Any idea whats going on?
With the other
nixosConfigurations
andpackages
removed: