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 is used but not defined" on nix-darwin #66

Closed
adrianord opened this issue Nov 14, 2022 · 9 comments
Closed

"The option is used but not defined" on nix-darwin #66

adrianord opened this issue Nov 14, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@adrianord
Copy link

Nixpkgs channel: master
Home-manager version: master

Description

When trying to use this module at all, I get the following error message

building the system configuration...
error: The option `home-manager.users.aordonez.programs.nixvim' is used but not defined.
(use '--show-trace' to show detailed location information)

Even with a very simple flake.nix which I will supply below.

Not sure if I'm doing something wrong on my side, but from referencing other people's nix configs who are using this flake on nixos, I don't believe I'm doing anything differently other than being on macos

Config

{
  description = "";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/master";

    darwin.url = "github:lnl7/nix-darwin/master";
    darwin.inputs.nixpkgs.follows = "nixpkgs";

    home-manager.url = "github:nix-community/home-manager";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";

    nixvim.url = "github:pta2002/nixvim";
  };

  outputs = { self, nixpkgs, darwin, home-manager, ... }@inputs:
    {
      darwinConfigurations.gon = darwin.lib.darwinSystem {
        system = "aarch64-darwin";
        specialArgs = { inherit inputs; };
        modules = [
          home-manager.darwinModules.home-manager
          {
            nix.extraOptions = ''
              experimental-features = nix-command flakes
            '';
          }
          {
            users.users.aordonez = {
              name = "aordonez";
            };
            home-manager.users.aordonez = {

              home.stateVersion = "22.11";
              imports = [ inputs.nixvim.homeManagerModules.nixvim ];
            };
          }
        ];
      };
    };
}
@adrianord adrianord added the bug Something isn't working label Nov 14, 2022
@pta2002
Copy link
Collaborator

pta2002 commented Nov 15, 2022

Ah damn I can try to fix this but it'll be incredibly hard for me to debug because I don't own a mac :/

@volkswagenfeature
Copy link
Contributor

I have had this bug as well on NixOS. I discovered that installing, but not activating this package does not work properly. Adding programs.nixvim.enable=true let my flake build.

@adrianord
Copy link
Author

Thanks @volkswagenfeature, it seems as much as defining programs.nixvim = {}; is enough to resolve the error.

@gaetgu
Copy link

gaetgu commented Dec 27, 2022

I can also confirm that setting program.nixvim to anything resolves this issue. You can probably mark this as closed, then, (and maybe add something to the readme? even just a link pointing to this issue)

@pta2002
Copy link
Collaborator

pta2002 commented Dec 29, 2022

Yeah this is an issue I've had before and I haven't been able to figure out what's causing it. I'll need to look into it better.

@pta2002
Copy link
Collaborator

pta2002 commented Jun 6, 2023

Hey, can anyone confirm if this is still an issue? I have a vague idea of a similar issue having been fixed on other platforms, so if it's fixed I'd like to close this :)

@GaetanLepage
Copy link
Member

I was not able to reproduce on NixOS.
Adding the module without specifying any configuration (not even programs.nixvim.enable = true) is working fine.

Could someone try again on darwin ?

@fabianpage
Copy link
Contributor

I did run darwin-rebuild build --flake .#gon with the flake.nix from the first post and was able to build the flake:

❯ ll
.rw-r--r-- 8.3k fabian 17 Jul 18:51 flake.lock
.rw-r--r-- 1.1k fabian 17 Jul 18:50 flake.nix
lrwxr-xr-x   96 fabian 17 Jul 18:52 result -> /nix/store/74z5j2cl2pn9p5awrr8f7ik97rgn9c1b-darwin-system-23.11.20230717.82951ca+darwin4.61662a6

@GaetanLepage
Copy link
Member

Ok, thank you @fabianpage for testing.
I will close this issue as we are not able to reproduce this bug.
Feel free to reopen/complain if this happens again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants