nix-flatpak icon indicating copy to clipboard operation
nix-flatpak copied to clipboard

build error using `nix-flatpak.homeManagerModules.nix-flatpak`: `The option 'home' does not exist`

Open Pinoinha opened this issue 1 year ago • 1 comments
trafficstars

hi there! I'm having build errors when trying to rebuild my system by using the home-manager module.

while I've read the https://github.com/gmodena/nix-flatpak#notes-on-homemanager, I'm unsure if that's the issue I'm having, as I'm quite new to Nix and still unsure on how to diagnose problems. however, if it be the case, I'd suggest maybe adding a reference to that section on common error messages when the home-manager module failed

/etc/nixos/flake.nix:

  inputs = {
   ...
    nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1";
  };
  ...
  outputs = inputs @ {
    ...
    nix-flatpak,
    ...
  }: {
    nixosConfigurations = {
       ...
        modules = [
         ...
          nix-flatpak.homeManagerModules.nix-flatpak
          ./configuration.nix
        ];
      };
    };
  };

output of nix-info:

 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.32, NixOS, 24.11 (Vicuña), 24.11.20240607.051f920`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"nixos-24.05"`
 - nixpkgs: `/nix/store/3dr5pyja36lvvrszhzffww1jwyrx6i09-source`

output of nixos-rebuild switch:

error:
       … while calling the 'seq' builtin

         at /nix/store/3dr5pyja36lvvrszhzffww1jwyrx6i09-source/lib/modules.nix:322:18:

          321|         options = checked options;
          322|         config = checked (removeAttrs config [ "_module" ]);
             |                  ^
          323|         _module = checked (config._module);

       … while calling the 'throw' builtin

         at /nix/store/3dr5pyja36lvvrszhzffww1jwyrx6i09-source/lib/modules.nix:298:18:

          297|                     ''
          298|             else throw baseMsg
             |                  ^
          299|         else null;

       error: The option `home' does not exist. Definition values:
       - In `/nix/store/3dr5pyja36lvvrszhzffww1jwyrx6i09-source/flake.nix'

any help is appreciated!

Pinoinha avatar Jul 02 '24 16:07 Pinoinha

you're trying to add a home-manager module as a nixos system module
you need to add it to your home-manager options instead (for example home-manager.sharedModules) refer to the home-manager's documentation on how to configure it

griffi-gh avatar Aug 16 '24 06:08 griffi-gh

This does not seem to be an issue with nix-flatpak. @griffi-gh thanks for the pointers.

gmodena avatar Aug 19 '24 18:08 gmodena