Unable to Use Unstable Service Option on Flake-Based Configuration

I have been trying to install an application called coolercontrol, which, according to its official GitLab repository README, can be installed with the following option:

programs.coolercontrol.enable = true;

This option is only available in the unstable channel. I have declared the unstable channel in my flake:

inputs = {
  nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
  home-manager = {
    url = "github:nix-community/home-manager/master";
    inputs.nixpkgs.follows = "nixpkgs";
  };
  nix-colors.url = "github:misterio77/nix-colors";
  hyprland.url = "github:hyprwm/Hyprland";
  hyprland-plugins = {
    url = "github:hyprwm/hyprland-plugins";
    inputs.hyprland.follows = "hyprland";
  };
  nixvim = {
    url = "github:nix-community/nixvim";
    inputs.nixpkgs.follows = "nixpkgs";
  };
  impermanence.url = "github:nix-community/impermanence";
};

I have even run the nix-channel --add command to add the unstable channel as a last resort, even though it shouldn’t matter when using flakes.

sudo nix-channel --list
nixos https://nixos.org/channels/nixpkgs-unstable

But when I try to rebuild the system, I get:

error: The option `programs.coolercontrol' does not exist.

I have verified that this option does actually exist in the unstable channel.

An issue that is definitely related to this is that I haven’t been able to install exclusively unstable packages without using overlays.

Any idea how to fix this? Thank you in advance.

Yeah, that will make no differences.


Did you run nix flake update recently?

1 Like

Thanks for the reply! Yes, I have run nix flake update. It has made no difference.

Edit: It has. This was the correct solution.

Having your NixOS configuration (or at least your flake.lock) would be more useful for us :grin:

I will take an extremely wild guess and say maybe you added programs.coolercontrol.enable to your Home Manager configuration instead.

I don’t understand what you mean by this, is Nix pulling packages from the stable channel even after you set up the unstable channel?

1 Like

Thank you for the reply!

I have verified that is not the case.

Correct. Nix is pulling packages from the stable channel. I think so because when I was trying to install a font that’s exclusively available in the unstable channel I got an error saying that it doesn’t exist, or something along those lines. I had to resort to declaring the same URL under a different variable name in my flake, after which the font installed without any issues.

Unfortunately, I’m not comfortable sharing my entire configuration for anonymity, privacy, and security reasons. I will, however, provide all the relevant modules below:

# flake.nix
{
  description = "my flake";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
    home-manager = {
      url = "github:nix-community/home-manager/master";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    nix-colors.url = "github:misterio77/nix-colors";
    hyprland.url = "github:hyprwm/Hyprland";
    hyprland-plugins = {
      url = "github:hyprwm/hyprland-plugins";
      inputs.hyprland.follows = "hyprland";
    };
    nixvim = {
      url = "github:nix-community/nixvim";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    impermanence.url = "github:nix-community/impermanence";
  };

  outputs = inputs@{ nixpkgs, nixpkgs-unstable, home-manager, impermanence, ... }:

  let
    system = "x86_64-linux";
    inherit (import ./options.nix) username hostname;
    pkgs = import nixpkgs {
      inherit system;
      config = {
	      allowUnfree = true;
      };
    };
    pkgs-unstable = import nixpkgs-unstable {
      inherit system;
      config = {
	      allowUnfree = true;
      };
    };
  in
  {
    nixosConfigurations = {
      "${hostname}" = nixpkgs.lib.nixosSystem {
	      specialArgs = { 
          inherit system;
          inherit inputs; 
          inherit username;
          inherit hostname;
          inherit pkgs-unstable;
        };
	      modules = [ 
	        ./system.nix
	        impermanence.nixosModules.impermanence
          home-manager.nixosModules.home-manager {
            home-manager = {
              extraSpecialArgs = {
	              inherit username;
                inherit inputs;
                inherit pkgs-unstable;
                inherit (inputs.nix-colors.lib-contrib {inherit pkgs;}) gtkThemeFromScheme;
              };
              useGlobalPkgs = true;
              useUserPackages = true;
              backupFileExtension = "backup";
              users.${username} = import ./home.nix;
            };
	        }
	      ];
      };
    };
  };
}

# flake.lock
{
  "nodes": {
    "base16-schemes": {
      "flake": false,
      "locked": {
        "lastModified": 1696158499,
        "narHash": "sha256-5yIHgDTPjoX/3oDEfLSQ0eJZdFL1SaCfb9d6M0RmOTM=",
        "owner": "tinted-theming",
        "repo": "base16-schemes",
        "rev": "a9112eaae86d9dd8ee6bb9445b664fba2f94037a",
        "type": "github"
      },
      "original": {
        "owner": "tinted-theming",
        "repo": "base16-schemes",
        "type": "github"
      }
    },
    "flake-compat": {
      "flake": false,
      "locked": {
        "lastModified": 1696426674,
        "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
        "owner": "edolstra",
        "repo": "flake-compat",
        "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
        "type": "github"
      },
      "original": {
        "owner": "edolstra",
        "repo": "flake-compat",
        "type": "github"
      }
    },
    "flake-parts": {
      "inputs": {
        "nixpkgs-lib": [
          "nixvim",
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1706830856,
        "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=",
        "owner": "hercules-ci",
        "repo": "flake-parts",
        "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f",
        "type": "github"
      },
      "original": {
        "owner": "hercules-ci",
        "repo": "flake-parts",
        "type": "github"
      }
    },
    "flake-utils": {
      "inputs": {
        "systems": "systems_2"
      },
      "locked": {
        "lastModified": 1701680307,
        "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
        "owner": "numtide",
        "repo": "flake-utils",
        "rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
        "type": "github"
      },
      "original": {
        "owner": "numtide",
        "repo": "flake-utils",
        "type": "github"
      }
    },
    "gitignore": {
      "inputs": {
        "nixpkgs": [
          "nixvim",
          "pre-commit-hooks",
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1703887061,
        "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=",
        "owner": "hercules-ci",
        "repo": "gitignore.nix",
        "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5",
        "type": "github"
      },
      "original": {
        "owner": "hercules-ci",
        "repo": "gitignore.nix",
        "type": "github"
      }
    },
    "home-manager": {
      "inputs": {
        "nixpkgs": [
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1706798041,
        "narHash": "sha256-BbvuF4CsVRBGRP8P+R+JUilojk0M60D7hzqE0bEvJBQ=",
        "owner": "nix-community",
        "repo": "home-manager",
        "rev": "4d53427bce7bf3d17e699252fd84dc7468afc46e",
        "type": "github"
      },
      "original": {
        "owner": "nix-community",
        "ref": "master",
        "repo": "home-manager",
        "type": "github"
      }
    },
    "home-manager_2": {
      "inputs": {
        "nixpkgs": [
          "nixvim",
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1706955260,
        "narHash": "sha256-W3y0j77IDVbmbajudHoUr46RpswujUCl+D5Vru53UsI=",
        "owner": "nix-community",
        "repo": "home-manager",
        "rev": "880d9bc2110f7cae59698f715b8ca42cdc53670c",
        "type": "github"
      },
      "original": {
        "owner": "nix-community",
        "repo": "home-manager",
        "type": "github"
      }
    },
    "hyprland": {
      "inputs": {
        "hyprland-protocols": "hyprland-protocols",
        "nixpkgs": "nixpkgs",
        "systems": "systems",
        "wlroots": "wlroots",
        "xdph": "xdph"
      },
      "locked": {
        "lastModified": 1706838674,
        "narHash": "sha256-umU1VC3bI4L/ZHpl/bZsm4MSUnX9wZrQRmbEjNLeQV4=",
        "owner": "hyprwm",
        "repo": "Hyprland",
        "rev": "7447be822080fac5b8515a177773ec74b4d6c925",
        "type": "github"
      },
      "original": {
        "owner": "hyprwm",
        "repo": "Hyprland",
        "type": "github"
      }
    },
    "hyprland-plugins": {
      "inputs": {
        "hyprland": [
          "hyprland"
        ]
      },
      "locked": {
        "lastModified": 1706478736,
        "narHash": "sha256-V1T0x16p4r+/fdWR5RU2lV0tTW0YrA8K9+GIibsZAeQ=",
        "owner": "hyprwm",
        "repo": "hyprland-plugins",
        "rev": "24e33780589f5c15132fc86c97ea033e56b06f59",
        "type": "github"
      },
      "original": {
        "owner": "hyprwm",
        "repo": "hyprland-plugins",
        "type": "github"
      }
    },
    "hyprland-protocols": {
      "inputs": {
        "nixpkgs": [
          "hyprland",
          "nixpkgs"
        ],
        "systems": [
          "hyprland",
          "systems"
        ]
      },
      "locked": {
        "lastModified": 1691753796,
        "narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=",
        "owner": "hyprwm",
        "repo": "hyprland-protocols",
        "rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03",
        "type": "github"
      },
      "original": {
        "owner": "hyprwm",
        "repo": "hyprland-protocols",
        "type": "github"
      }
    },
    "hyprlang": {
      "inputs": {
        "nixpkgs": [
          "hyprland",
          "xdph",
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1704287638,
        "narHash": "sha256-TuRXJGwtK440AXQNl5eiqmQqY4LZ/9+z/R7xC0ie3iA=",
        "owner": "hyprwm",
        "repo": "hyprlang",
        "rev": "6624f2bb66d4d27975766e81f77174adbe58ec97",
        "type": "github"
      },
      "original": {
        "owner": "hyprwm",
        "repo": "hyprlang",
        "type": "github"
      }
    },
    "impermanence": {
      "locked": {
        "lastModified": 1706639736,
        "narHash": "sha256-CaG4j9+UwBDfinxxvJMo6yOonSmSo0ZgnbD7aj2Put0=",
        "owner": "nix-community",
        "repo": "impermanence",
        "rev": "cd13c2917eaa68e4c49fea0ff9cada45440d7045",
        "type": "github"
      },
      "original": {
        "owner": "nix-community",
        "repo": "impermanence",
        "type": "github"
      }
    },
    "nix-colors": {
      "inputs": {
        "base16-schemes": "base16-schemes",
        "nixpkgs-lib": "nixpkgs-lib"
      },
      "locked": {
        "lastModified": 1706637303,
        "narHash": "sha256-K6SqE9diWDCoEQ+MzuVlTfNrAKcdIa/dLHBtKfz445U=",
        "owner": "misterio77",
        "repo": "nix-colors",
        "rev": "fc080c51d2a219b40d886870e364243783ed5ca1",
        "type": "github"
      },
      "original": {
        "owner": "misterio77",
        "repo": "nix-colors",
        "type": "github"
      }
    },
    "nix-darwin": {
      "inputs": {
        "nixpkgs": [
          "nixvim",
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1706833576,
        "narHash": "sha256-w7BL0EWRts+nD1lbLECIuz6fRzmmV+z8oWwoY7womR0=",
        "owner": "lnl7",
        "repo": "nix-darwin",
        "rev": "bdbae6ecff8fcc322bf6b9053c0b984912378af7",
        "type": "github"
      },
      "original": {
        "owner": "lnl7",
        "repo": "nix-darwin",
        "type": "github"
      }
    },
    "nixpkgs": {
      "locked": {
        "lastModified": 1706191920,
        "narHash": "sha256-eLihrZAPZX0R6RyM5fYAWeKVNuQPYjAkCUBr+JNvtdE=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "ae5c332cbb5827f6b1f02572496b141021de335f",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixos-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "nixpkgs-lib": {
      "locked": {
        "lastModified": 1697935651,
        "narHash": "sha256-qOfWjQ2JQSQL15KLh6D7xQhx0qgZlYZTYlcEiRuAMMw=",
        "owner": "nix-community",
        "repo": "nixpkgs.lib",
        "rev": "e1e11fdbb01113d85c7f41cada9d2847660e3902",
        "type": "github"
      },
      "original": {
        "owner": "nix-community",
        "repo": "nixpkgs.lib",
        "type": "github"
      }
    },
    "nixpkgs-unstable": {
      "locked": {
        "lastModified": 1712791164,
        "narHash": "sha256-3sbWO1mbpWsLepZGbWaMovSO7ndZeFqDSdX0hZ9nVyw=",
        "owner": "nixos",
        "repo": "nixpkgs",
        "rev": "1042fd8b148a9105f3c0aca3a6177fd1d9360ba5",
        "type": "github"
      },
      "original": {
        "owner": "nixos",
        "ref": "nixos-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "nixpkgs_2": {
      "locked": {
        "lastModified": 1706550542,
        "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=",
        "owner": "nixos",
        "repo": "nixpkgs",
        "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652",
        "type": "github"
      },
      "original": {
        "owner": "nixos",
        "ref": "nixos-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "nixvim": {
      "inputs": {
        "flake-parts": "flake-parts",
        "home-manager": "home-manager_2",
        "nix-darwin": "nix-darwin",
        "nixpkgs": [
          "nixpkgs"
        ],
        "pre-commit-hooks": "pre-commit-hooks"
      },
      "locked": {
        "lastModified": 1706997840,
        "narHash": "sha256-GbfTveveq/FNJ+xVcj1w3jW2ftsc8dmwxVS5vFehq+I=",
        "owner": "nix-community",
        "repo": "nixvim",
        "rev": "81f54bcdd6f6a83372dce7723c83b8605769e9a5",
        "type": "github"
      },
      "original": {
        "owner": "nix-community",
        "repo": "nixvim",
        "type": "github"
      }
    },
    "pre-commit-hooks": {
      "inputs": {
        "flake-compat": "flake-compat",
        "flake-utils": "flake-utils",
        "gitignore": "gitignore",
        "nixpkgs": [
          "nixvim",
          "nixpkgs"
        ],
        "nixpkgs-stable": [
          "nixvim",
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1706424699,
        "narHash": "sha256-Q3RBuOpZNH2eFA1e+IHgZLAOqDD9SKhJ/sszrL8bQD4=",
        "owner": "cachix",
        "repo": "pre-commit-hooks.nix",
        "rev": "7c54e08a689b53c8a1e5d70169f2ec9e2a68ffaf",
        "type": "github"
      },
      "original": {
        "owner": "cachix",
        "repo": "pre-commit-hooks.nix",
        "type": "github"
      }
    },
    "root": {
      "inputs": {
        "home-manager": "home-manager",
        "hyprland": "hyprland",
        "hyprland-plugins": "hyprland-plugins",
        "impermanence": "impermanence",
        "nix-colors": "nix-colors",
        "nixpkgs": "nixpkgs_2",
        "nixpkgs-unstable": "nixpkgs-unstable",
        "nixvim": "nixvim"
      }
    },
    "systems": {
      "locked": {
        "lastModified": 1689347949,
        "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
        "owner": "nix-systems",
        "repo": "default-linux",
        "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
        "type": "github"
      },
      "original": {
        "owner": "nix-systems",
        "repo": "default-linux",
        "type": "github"
      }
    },
    "systems_2": {
      "locked": {
        "lastModified": 1681028828,
        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
        "owner": "nix-systems",
        "repo": "default",
        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
        "type": "github"
      },
      "original": {
        "owner": "nix-systems",
        "repo": "default",
        "type": "github"
      }
    },
    "wlroots": {
      "flake": false,
      "locked": {
        "host": "gitlab.freedesktop.org",
        "lastModified": 1706359063,
        "narHash": "sha256-5HUTG0p+nCJv3cn73AmFHRZdfRV5AD5N43g8xAePSKM=",
        "owner": "wlroots",
        "repo": "wlroots",
        "rev": "00b869c1a96f300a8f25da95d624524895e0ddf2",
        "type": "gitlab"
      },
      "original": {
        "host": "gitlab.freedesktop.org",
        "owner": "wlroots",
        "repo": "wlroots",
        "rev": "00b869c1a96f300a8f25da95d624524895e0ddf2",
        "type": "gitlab"
      }
    },
    "xdph": {
      "inputs": {
        "hyprland-protocols": [
          "hyprland",
          "hyprland-protocols"
        ],
        "hyprlang": "hyprlang",
        "nixpkgs": [
          "hyprland",
          "nixpkgs"
        ],
        "systems": [
          "hyprland",
          "systems"
        ]
      },
      "locked": {
        "lastModified": 1706145785,
        "narHash": "sha256-j9MP4fv2U/vdRKAXXc2gyMTmYwVnHP6kHx1/y6jprrU=",
        "owner": "hyprwm",
        "repo": "xdg-desktop-portal-hyprland",
        "rev": "5a592647587cd20b9692a347df6939b6d371b3bb",
        "type": "github"
      },
      "original": {
        "owner": "hyprwm",
        "repo": "xdg-desktop-portal-hyprland",
        "type": "github"
      }
    }
  },
  "root": "root",
  "version": 7
}

# coolercontrol.nix
{ config, pkgs, ... }:

{
  programs.coolercontrol = {
		enable = true;
		nvidiaSupport = true;
	};
}

coolercontrol.nix is then imported into system.nix, which is then imported into flake.nix.

I think the problem lies in the

      "${hostname}" = nixpkgs.lib.nixosSystem {

line. I think the options that will be available for your system are determined by which revision of nixpkgs you’re calling lib.nixosSystem from, and since the lockfile says the timestamp for your current revision of the nixpkgs input is the 25th of January it might be old enough that the option you want to enable isn’t available. You should either update your nixpkgs input as well or call lib.nixosSystem from your nixpkgs-unstable input.

2 Likes

Or remove the nixpkgs-unstable input and only use nixpkgs, since both are pointing to the same channel (I’m actually surprised nix flake update didn’t sync them to the same rev).

1 Like

Turns out I made a mistake and ran a git reset right after running nix flake update because the update caused another error. After taking a more careful look at it, I realized that the new error had nothing to do with the original issue, and I have already fixed it. The suggestion to run the flake update was indeed the solution. Thank you everyone for the help!

1 Like