nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
7.2k stars 1.85k forks source link

bug: option already exists #3098

Open ThatOneOcto opened 2 years ago

ThatOneOcto commented 2 years ago

Is there an existing issue for this?

Issue description

the error message is below

error: The option `home-manager.users' in `/home/octo/.nix-defexpr/channels/home-manager/nixos' is already declar
ed in `/home/octo/.nix-defexpr/channels/home-manager/nix-darwin'.

Maintainer CC

No response

System information

these 2 paths will be fetched (0.07 MiB download, 0.34 MiB unpacked):
  /nix/store/9m5k22zdy4s1yh003ma0igqmmrvncww1-bash-interactive-5.1-p16-dev
  /nix/store/w4yyp4pm2czqhr0078c0wwlx2dk2dzqw-stdenv-linux
copying path '/nix/store/9m5k22zdy4s1yh003ma0igqmmrvncww1-bash-interactive-5.1-p16-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/w4yyp4pm2czqhr0078c0wwlx2dk2dzqw-stdenv-linux' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.49, NixOS, 22.05 (Quokka), 22.05.1257.cd90e773eae`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.8.1`
 - channels(root): `"home-manager-22.05.tar.gz, nixos-22.05"`
 - channels(octo): `"home-manager-22.05.tar.gz"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
rcerc commented 2 years ago

Could you please post the code you are using to import Home Manager into your NixOS configuration? I have a feeling that <home-manager/nix-darwin> is being imported alongside <home-manager/nixos>, but I don't understand how their home-manager.users option definition could conflict (as they both seem to inherit it from Home Manager's nixos/common.nix).

ThatOneOcto commented 2 years ago

I am importing both

ThatOneOcto commented 2 years ago

This is my code that I am using to import

  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
      <home-manager/nixos>
      <home-manager/nix-darwin>
    ];
ThatOneOcto commented 2 years ago

After removing nix-darwin I am getting this error home-manager.users.octo.home.gtk I thought home-manager could manage GTK themes, if not is there another way

ThatOneOcto commented 2 years ago
   home-manager.users.octo = {pkgs, ...}: {
       home.pointerCursor = { package = pkgs.breeze-icons; gtk.enable = true; name = "breeze_cursors"; size = 24; };
       home.gtk = {
           enable = true;
           iconTheme = { name = "ePapirus-dark"; package = "pkgs.papirus-icon-theme"; };
           theme = { name = "Equilux"; package = "pkgs.equilux-theme"; };
         };
     };
rcerc commented 2 years ago

The options for configuring GTK are under the gtk attribute (as opposed to home.gtk). When specifying the GTK themes, you should not quote the packages (i.e., use package = pkgs.papirus-icon-theme; and package = pkgs.equilux-theme; instead of package = "pkgs.papirus-icon-theme"; and package = "pkgs.equilux-theme";).

stale[bot] commented 2 years ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.