pietdevries94 / spicetify-nix

DEPRICATED: A nix package for using spicetify
MIT License
11 stars 37 forks source link

Infinite recursion encoutered installing the SolarizedDark theme #1

Closed svrana closed 3 years ago

svrana commented 3 years ago

Encountering this error when attempting to use spicetify-nix to install spotify with the SolarizedDark theme.

Installation is using a package that I'm including from home-manage on nixos 20.09 (just copied the config from your spotify.nix from your nixos-configuration). Dribbblish does work and is a big improvement, but SolarizedDark would match my color scheme so shooting for that one. SolarizedDark theme is simpler with just a user.css and color.ini.

Here's what I'm working with:

{ config, pkgs, lib, ... }:

let
  spicetify = fetchTarball https://github.com/pietdevries94/spicetify-nix/archive/master.tar.gz;
in
{
  imports = [ (import "${spicetify}/module.nix") ];

  programs.spicetify = {
    enable = true;
    theme = "SolarizedDark";
    injectCss = true;
    replaceColors = true;
    overwriteAssets = true;
  };
}

home-manager switch error: while evaluating the attribute 'buildCommand' of the derivation 'home-manager-generation' at /nix/store/ws19k4r7wik6jrd3f2rjxhi8w3q8dlv9-nixpkgs-20.09.1889.58f9c4c7d3a/nixpkgs/pkgs/build-support/trivial-builders.nix:7:7: while evaluating the attribute 'text' of the derivation 'activation-script' at /nix/store/ws19k4r7wik6jrd3f2rjxhi8w3q8dlv9-nixpkgs-20.09.1889.58f9c4c7d3a/nixpkgs/pkgs/build-support/trivial-builders.nix:7:7: while evaluating 'mkCmd' at /nix/store/lc4np3b1gi4fh8wr98h1xshwqcn8mipl-source/modules/home-environment.nix:502:17, called from undefined position: while evaluating the attribute 'data' at /nix/store/lc4np3b1gi4fh8wr98h1xshwqcn8mipl-source/modules/lib/dag.nix:91:37: while evaluating the attribute 'data' at /nix/store/lc4np3b1gi4fh8wr98h1xshwqcn8mipl-source/modules/lib/dag.nix:85:9: while evaluating the attribute 'data' at undefined position: while evaluating 'g' at /nix/store/ws19k4r7wik6jrd3f2rjxhi8w3q8dlv9-nixpkgs-20.09.1889.58f9c4c7d3a/nixpkgs/lib/attrsets.nix:276:19, called from undefined position: while evaluating anonymous function at /nix/store/ws19k4r7wik6jrd3f2rjxhi8w3q8dlv9-nixpkgs-20.09.1889.58f9c4c7d3a/nixpkgs/lib/modules.nix:98:72, called from /nix/store/ws19k4r7wik6jrd3f2rjxhi8w3q8dlv9-nixpkgs-20.09.1889.58f9c4c7d3a/nixpkgs/lib/attrsets.nix:279:20: while evaluating the attribute 'value' at /nix/store/ws19k4r7wik6jrd3f2rjxhi8w3q8dlv9-nixpkgs-20.09.1889.58f9c4c7d3a/nixpkgs/lib/modules.nix:465:9: while evaluating the option home.activation.installPackages.data': while evaluating the attribute 'mergedValue' at /nix/store/ws19k4r7wik6jrd3f2rjxhi8w3q8dlv9-nixpkgs-20.09.1889.58f9c4c7d3a/nixpkgs/lib/modules.nix:497:5: while evaluating the attribute 'values' at /nix/store/ws19k4r7wik6jrd3f2rjxhi8w3q8dlv9-nixpkgs-20.09.1889.58f9c4c7d3a/nixpkgs/lib/modules.nix:491:9: while evaluating the attribute 'values' at /nix/store/ws19k4r7wik6jrd3f2rjxhi8w3q8dlv9-nixpkgs-20.09.1889.58f9c4c7d3a/nixpkgs/lib/modules.nix:590:7: while evaluating anonymous function at /nix/store/ws19k4r7wik6jrd3f2rjxhi8w3q8dlv9-nixpkgs-20.09.1889.58f9c4c7d3a/nixpkgs/lib/modules.nix:477:28, called from /nix/store/ws19k4r7wik6jrd3f2rjxhi8w3q8dlv9-nixpkgs-20.09.1889.58f9c4c7d3a/nixpkgs/lib/modules.nix:477:17: while evaluating definitions from/nix/store/lc4np3b1gi4fh8wr98h1xshwqcn8mipl-source/modules/home-environment.nix': while evaluating 'dischargeProperties' at /nix/store/ws19k4r7wik6jrd3f2rjxhi8w3q8dlv9-nixpkgs-20.09.1889.58f9c4c7d3a/nixpkgs/lib/modules.nix:549:25, called from /nix/store/ws19k4r7wik6jrd3f2rjxhi8w3q8dlv9-nixpkgs-20.09.1889.58f9c4c7d3a/nixpkgs/lib/modules.nix:478:137: while evaluating the attribute 'value' at /nix/store/ws19k4r7wik6jrd3f2rjxhi8w3q8dlv9-nixpkgs-20.09.1889.58f9c4c7d3a/nixpkgs/lib/modules.nix:338:44: while evaluating the attribute 'passAsFile' of the derivation 'home-manager-path' at /nix/store/ws19k4r7wik6jrd3f2rjxhi8w3q8dlv9-nixpkgs-20.09.1889.58f9c4c7d3a/nixpkgs/pkgs/build-support/trivial-builders.nix:7:7: while evaluating the attribute 'postInstall' of the derivation 'spotify-1.1.26.501.gbe11e53b-15' at /nix/store/ws19k4r7wik6jrd3f2rjxhi8w3q8dlv9-nixpkgs-20.09.1889.58f9c4c7d3a/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:192:11: while evaluating 'boolToString' at /nix/store/27h5npm0d71ld7a6768sl5i00q6i9wx7-source/package.nix:36:18, called from /nix/store/27h5npm0d71ld7a6768sl5i00q6i9wx7-source/package.nix:55:15: infinite recursion encountered, at /nix/store/27h5npm0d71ld7a6768sl5i00q6i9wx7-source/package.nix:55:

I'm staring at boolToString and just not seeing the problem! User error perhaps?

pietdevries94 commented 3 years ago

Thanks for the detailed feedback! I'll look into this this week and will keep you updated.

pietdevries94 commented 3 years ago

The problem was pretty silly.

There were a few booleans which set themselves, such as:

injectCss = boolToString (isDribblish || injectCss);

If you're using Dribblish, it never entered the loop, because of the "early return". I also fixed another issue I came across when testing your config and I can proudly tell that you're settings "work on my machine".

Have fun with your spiced up Spotify!

svrana commented 3 years ago

Confirmed that my desktop is now completely solarized :)

Thanks for the fixes! Interesting, guess I was zeroing in on boolToString, but it was the expression passed to it that's problematic..

You thought about trying to get this in nixpkgs? spicetify made it in recently.. but there' s no module around it, so it doesn't do much.. I like the approach you took here overriding the post install process of spotify. I wonder if that would be something acceptable upstream or if there's other things that I'm not seeing that you think might not make it acceptable?

pietdevries94 commented 3 years ago

To be honest, I have no clue if this code is up to par with the standards of Nix. I haven't noticed that Spicetify was added to the repo. I'll look at that for further steps in possibly upstreaming this package!

svrana commented 3 years ago

Was added here. There must be a similar type of program-- one that goes in and modifies the contents of the deployables of another, but I just can't think of one atm that might show us an approach that's already accepted. Happy to help in any way, by starting a discussion in nixpkgs, or doing the port, or anything. I can't be the only new nix user who will find this useful!

Thanks again!

pietdevries94 commented 3 years ago

Thanks for the suggestion. I'll start with making a pull request soon. When I do, I'll make sure to notify you ;)

pietdevries94 commented 3 years ago

Was added here. There must be a similar type of program-- one that goes in and modifies the contents of the deployables of another, but I just can't think of one atm that might show us an approach that's already accepted. Happy to help in any way, by starting a discussion in nixpkgs, or doing the port, or anything. I can't be the only new nix user who will find this useful!

Thanks again!

It's been a few months, but I'm currently working on getting a version of this in nixpkgs. You can check the progress here https://github.com/NixOS/nixpkgs/pull/111946