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

NixOS: Cannot install - infinite recursion

Open hermann-p opened this issue 1 year ago • 8 comments

In my home-manager on NixOS, I added the flake input and activated the program just as the readme suggested. When building the new home-manager generation, it will fail with

error: infinite recursion encountered

       at /nix/store/j3cnzmjq5b3naz1nckh6p39fnkaabv5d-source/lib/modules.nix:506:28:

          505|         builtins.addErrorContext (context name)
          506|           (args.${name} or config._module.args.${name})
             |                            ^
          507|       ) (lib.functionArgs f);

I disabled all optional extensions, so it must be something within the core module.

Home manager `flake.nix`

{
  description = "Home Manager configuration";

  inputs = {
    spicetify-nix.url = "github:the-argus/spicetify-nix";
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
      inputs.nixos.follows = "nixos";
    };
  };

  outputs = { nixpkgs, emacs-overlay, home-manager, ... }:
    let
      system = "x86_64-linux";
      pkgs = nixpkgs.legacyPackages.${system};
    in {
      homeConfigurations."hermann" = home-manager.lib.homeManagerConfiguration {
        inherit pkgs;
        modules = [ ./home.nix ];
      };
    };
}

My home.nix imports spicetify.nix

spicetify.nix

{ spicetify-nix, config, lib, pkgs, ... }:

let spicePkgs = spicetify-nix.packages.${pkgs.system}.default;
in {
  # allow spotify to be installed if you don't have unfree enabled already
  nixpkgs.config.allowUnfreePredicate = pkg:
    builtins.elem (lib.getName pkg) [ "spotify" ];

  # import the flake's module for your system
  imports = [ spicetify-nix.homeManagerModule ];

  # configure spicetify :)
  programs.spicetify = {
    enable = true;
    theme = spicePkgs.themes.catppuccin-mocha;
    colorScheme = "flamingo";

    enabledExtensions = with spicePkgs.extensions; [
      ...
    ];
  };
}

hermann-p avatar Jul 31 '23 10:07 hermann-p