the-argus / spicetify-nix

A nix flake for configuring spicetify. Includes packaging for many popular themes and extensions.
GNU General Public License v3.0
139 stars 22 forks source link

infinite recursion encountered #8

Closed wizardwatch closed 1 year ago

wizardwatch commented 1 year ago

I am hitting the error infinite recursion encountered when trying to install for the first time. It occurs when

spicetify-nix.homeManagerModule

is imported.

(Thank you for putting in all of the effort to make this :+1: )

My flake.nix looks lke this

{
  description = "My system conf";
  inputs = rec {
    # set the channel
    nixpkgs.url = "nixpkgs/nixos-unstable";
    # enable home-manager
    home-manager.url = "github:nix-community/home-manager/master";
    # tell home manager to use the nixpkgs channel set above.
    home-manager.inputs.nixpkgs.follows = "nixpkgs";
    # master channel
    nixmaster.url = "github:NixOS/nixpkgs";
    neovim-nightly.url = "github:nix-community/neovim-nightly-overlay";
    eww.url = "github:elkowar/eww";
    nix-doom-emacs.url = "github:vlaci/nix-doom-emacs";
    spicetify-nix = { 
      url = "github:the-argus/spicetify-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    # custom package
    wizardwatch_utils = {
      url = "path:/etc/nixos/packages/wizardwatch_utils";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    xtodoc = {
      url = "github:wizardwatch/xtodoc";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    nixos-generators = {
      url = "github:nix-community/nixos-generators";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    flake-utils.url = "github:numtide/flake-utils";
    nix-alien = {
      url = "github:thiagokokada/nix-alien";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    nix-ld = {
      url = "github:Mic92/nix-ld/main";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };
  outputs =
    { self
    , nixpkgs
    , home-manager
    , neovim-nightly
    , nixmaster
    , eww
    , nix-doom-emacs
    , wizardwatch_utils
    , xtodoc
    , nixos-generators
    , flake-utils
    , nix-alien
    , spicetify-nix
    , ...
    }@inputs:
    let
      system = "x86_64-linux";
      username = "wyatt";
      pkgs = import nixpkgs {
        # imports the system variable
        inherit system;
        # enable non free packages
        config = {
          allowUnfree = true;
        };
      };
      overlays = {
        nixmaster = final: prev: {
          nixmaster = (import nixmaster {
            inherit system;
            config = {
              allowUnfree = true;
            };
          });
        };
      };
      overrides = self: super: rec {
          minecraft-bedrock-appimage = super.appimageTools.wrapType2 {
            name = "minecraft-bedrock";
            src = super.fetchurl {
              url = "https://github.com/ChristopherHX/linux-packaging-scripts/releases/download/v0.3.4-688/Minecraft_Bedrock_Launcher-x86_64-v0.3.4.688.AppImage";
              sha256 = "sha256-TP76SypSk9JIOPnSGzpYmp+g40RE4pCuBmAapL7vqzY=";
            };
            extraPkgs = pkgs: with super; [ libpulseaudio alsa-lib alsa-utils zlib ];
          };
      };
      # install helper functions
      lib = nixpkgs.lib;
    in
    {
      homeManagerConfigurations = {
        wyatt = home-manager.lib.homeManagerConfiguration {
          inherit pkgs;
          modules = [
            ./users/wyatt/dotfiles/home.nix
            {
              nixpkgs = {
                #config.allowUnfreePredicate = (pkg: true);
                overlays = [ neovim-nightly.overlay ];
              };
              home = {
                username = "wyatt";
                homeDirectory = "/home/wyatt/.config";
                stateVersion = "20.09";
              };
            }
          ];
        };
      };
      nixosConfigurations = {
        wizardwatch = lib.makeOverridable lib.nixosSystem {
          # imports the system variable
          inherit system;
          # Taken from nix alien github
          specialArgs = { inherit self; };
          # import the config file
          modules = [
            { _module.args = inputs; }
            { nixpkgs.overlays = [ overlays.nixmaster (import ./overlays) overrides]; }
            (./common/common.nix)
            (./machines/wizardwatch/main.nix)
          ];
        };
        pc1 = lib.makeOverridable lib.nixosSystem {
          # imports the system variable
          inherit system;
          # import the config file
          modules = [
            { _module.args = inputs; }
            {
              nixpkgs.overlays = [
                overlays.nixmaster
                (import ./overlays)
              ];
            }
            (./common/common.nix)
            (./machines/pc1/main.nix)
          ];
        };
      };
      installer = nixos-generators.nixosGenerate {
        pkgs = nixpkgs.legacyPackages.x86_64-linux;
        modules = [
          { _module.args = inputs; }
          {
            nixpkgs.overlays = [
              overlays.nixmaster
              (import ./overlays)
            ];
          }
          ./machines/installer/main.nix
        ];
        format = "iso";
      };

    };
}

My home.nix looks like this

{ pkgs, unstable, spicetify-nix, lib, ... }: {
  fonts.fontconfig = {
    enable = true;
  };
  services.mpd = {
    enable = false;
    package = pkgs.mpd;
    dataDir = "/home/wyatt/.config/mpd";
    musicDirectory = "/home/wyatt/Music";
    extraConfig = ''
                      audio_output {
                        type "pulse"
                        name "fakepipe"
                      }
                      audio_output {
                        type    "fifo"
                        name    "my_fifo"
                        path    "/tmp/mpd.fifo"
                        format  "44100:16:2"
      }
    '';
  };
  gtk = {
    enable = true;
    font.name = "Iosevka";
    font.size = 14;
    theme.package = pkgs.dracula-theme;
    theme.name = "Dracula";
  };
  home.file = {
    river = {
      source = ./wayland/init;
      target = "./.config/river/init";
    };
    eww = {
      source = ./other/eww;
      recursive = true;
      target = "./.config/eww/";
    };
  };
  imports = [
    #./textEditors/neovim.nix
    #./textEditors/emacs/main.nix
    #./wayland/main.nix
    #./x/main.nix
    #./other/ncmpcpp.nix
    #./other/starship.nix
    #./spotify_plus.nix
    spicetify-nix.homeManagerModule
  ];

  # import the flake's module for your system

  # configure spicetify :)
    programs = {
      #spicetify = {
        #enable = true;
      #};
      foot = {
        enable = true;
        settings = {
          main = {
            term = "xterm-256color";
            font = "Iosevka:size=14";
            dpi-aware = "yes";
          };
          mouse = {
            hide-when-typing = "yes";
          };
          colors = {
            background = "0x282a36";
        };
      };
    };
  };
}
wizardwatch commented 1 year ago

The problem was that I was importing spicetify-nix.homeManagerModule in a module rather than in the main file.

luisnquin commented 1 year ago

@wizardwatch I'm having exactly the same problem, I also stealed some configs of you but nothing apparently the outputs.homeManagerConfigurations isn't not being taked into account, do you know why? How do you rebuild your computer? Anyway, thanks