`nixos-rebuild switch` gets stuck when using `builtins.fetchGit`

1.1k views Asked by At

I'm trying to download a package with a version that is not on nixpkgs. To do so, I'm using builtins.fetchGit. Here's a summary of the file where I use fetchGit (/etc/nixos/home/core.nix) for a better idea:

{ pkgs, username, homeDirectory }:

############################
# Custom package snapshots #
############################

let custom-ver-pkgs = {
  # Haskell Language Server
  hls = let pkgsSnapshot = import (builtins.fetchGit {
      name = "custom hls version";
      url = "https://github.com/nixos/nixpkgs-channels/";
      ref = "refs/heads/nixpkgs-unstable";                     
      rev = "2c162d49cd5b979eb66ff1653aecaeaa01690fcc";
    }) {}; in pkgsSnapshot.haskellPackages.haskell-language-server;
};

in

{
  # Actual config
}

And here's the point where I use the hls keyword defined above:

  # Packages
  home.packages = with pkgs; [
    ... # Normal packages
  ] ++

  # Packages with custom version (See start of file)
  (with custom-ver-pkgs; [
    hls
  ]);

As you can see, I also use home-manager. The above-mentioned .../core.nix file is imported directly into /etc/nixos/configuration.nix.

As the title says, if I run sudo nixos-rebuild switch, the terminal freezes (in the sense that the command goes on forever without doing anything). What could my problem be?

0

There are 0 answers