Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The option 'my namespace' does not exist while trying to install flake on NixOS #157

Open
Kazuto opened this issue Jan 16, 2025 · 9 comments

Comments

@Kazuto
Copy link

Kazuto commented Jan 16, 2025

I've used my configuration before but on Arch and wanted to configure a system on NixOS now, though I'm having issues installing my configuration and I can't figure out why because on darwin everything stillt works fine.

# nixos-rebuild switch --flake ./#susanoo

error:
       … while calling the 'seq' builtin
         at /nix/store/va0p2i72cm2ljwm084a0g6ji41s5qnyz-source/lib/modules.nix:334:18:
          333|         options = checked options;
          334|         config = checked (removeAttrs config [ "_module" ]);
             |                  ^
          335|         _module = checked (config._module);

       … while calling the 'throw' builtin
         at /nix/store/va0p2i72cm2ljwm084a0g6ji41s5qnyz-source/lib/modules.nix:310:18:
          309|                     ''
          310|             else throw baseMsg
             |                  ^
          311|         else null;

       error: The option `shiro' does not exist. Definition values:
       - In `/nix/store/0jbygwqngjx47yznncidmylzk29khx7n-l3ncbw7ns6nmsi77ql2y7vkk32lzpnga-source/systems/x86_64-linux/susanoo/default.nix':
           {
             suites = {
               common = {
                 enable = true;
               };
           ...

https://github.com/Kazuto/.nix/tree/server-config is my current branch. Maybe someone can guide me in the right direction.

@Kazuto Kazuto changed the title Undefined variable 'enabled' while trying to install flake on NixOS The option 'my namespace' does not exist while trying to install flake on NixOS Jan 16, 2025
@olifloof
Copy link

replace shiro with ${namespace}

@olifloof
Copy link

also the module directory linux should be nixos

@Kazuto
Copy link
Author

Kazuto commented Jan 16, 2025

replace shiro with ${namespace}

You mean in systems/x86_64-linux/susanoo/default.nix? Did that :)

renamed the directory, now I get the following error

error:
       … while calling the 'seq' builtin
         at /nix/store/va0p2i72cm2ljwm084a0g6ji41s5qnyz-source/lib/modules.nix:334:18:
          333|         options = checked options;
          334|         config = checked (removeAttrs config [ "_module" ]);
             |                  ^
          335|         _module = checked (config._module);

       … while evaluating a branch condition
         at /nix/store/va0p2i72cm2ljwm084a0g6ji41s5qnyz-source/lib/modules.nix:273:9:
          272|       checkUnmatched =
          273|         if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then
             |         ^
          274|           let

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: undefined variable 'enabled'
       at /nix/store/f6hsgacqqgxdm56frygiv5f8z108k32m-y9zydcscj48jj60qj7xcxwdivaygz2bb-source/modules/nixos/suites/gaming/default.nix:15:19:
           14|       apps = {
           15|         discord = enabled;
             |                   ^
           16|         lutris = enabled;

@olifloof
Copy link

delete the with lib;

put this in the let binding

inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt enabled;

@olifloof
Copy link

delete the with types; as booleans are built in

@Kazuto
Copy link
Author

Kazuto commented Jan 17, 2025

I don't quite get it as my config doesn't really look any different than Jake Hamiltons config repo and I guess that his still works for him.

And I can't find any of your suggestions in the documentation either, so I have no clue what part your talking about replacing or deleting.

EDIT

If I run nix flake check I get the errors unknown flake output 'snowfall' and unknown flake output 'pkgs'

@Cucumberrbob
Copy link

If I run nix flake check I get the errors unknown flake output 'snowfall' and unknown flake output 'pkgs'

This is expected and normal behaviour. The outputs snowfall and pkgs (both of which are provided by mkFlake) are unknown to nix - they're not in the flake output schema.

It's fine to just ignore those lines as far as I'm aware

@Kazuto
Copy link
Author

Kazuto commented Jan 20, 2025

If I run nix flake check I get the errors unknown flake output 'snowfall' and unknown flake output 'pkgs'

This is expected and normal behaviour. The outputs snowfall and pkgs (both of which are provided by mkFlake) are unknown to nix - they're not in the flake output schema.

It's fine to just ignore those lines as far as I'm aware

Ah okay, thanks for the explanation. Though I still can't get it to work. Even with --show-trace I can't figure out why.

@Kazuto
Copy link
Author

Kazuto commented Jan 25, 2025

No matter what I do, even trying a setup like olifloof's with his mkModule, it just doesn't work and won't find the namespace and thus I get errors like shiro.bootloader does not exist.

Edit
I've got it so far that it's downloading the pkgs. Let's see if it's successful :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants