Expose experimentalFetchTree in home-manager

This should work around #14, which breaks fetches on newer versions of
Nix. I was hesitant to expose this as Nix changes may break things with
no warning, but it gives users already willing to run newer versions of
Nix a workaround for the fetch failures they're currently getting.

(And the feature itself seems to work fine on current Nix, since CI is
using it...)
This commit is contained in:
Marien Zwart 2024-07-01 23:14:08 +10:00
parent ceb72ac458
commit 0fb952b3ce
No known key found for this signature in database
2 changed files with 29 additions and 1 deletions

View file

@ -81,6 +81,25 @@ in {
'';
};
experimentalFetchTree = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Fetch packages using fetchTree instead of fetchGit.
This makes use of Nix's "github" fetcher, which is more efficient:
it fetches tarballs generated by GitHub instead of using git.
It is not enabled by default because that fetcher is still "subject
to change" according to Nix's documentation.
This should be safe to enable, as long as you remember to disable it
if you encounter fetch issues, especially if they start after an
upgrade of Nix.
'';
};
finalEmacsPackage = mkOption {
type = types.package;
visible = false;
@ -138,7 +157,8 @@ in {
config = mkIf cfg.enable (mkMerge [
(let
doomPackages = doomFromPackages pkgs {
inherit (cfg) emacs doomDir doomLocalDir profileName noProfileHack extraPackages;
inherit (cfg) emacs doomDir doomLocalDir profileName noProfileHack extraPackages
experimentalFetchTree;
};
in
{