Skip to content

Commit

Permalink
Expose experimentalFetchTree in home-manager
Browse files Browse the repository at this point in the history
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...)
  • Loading branch information
marienz committed Jul 1, 2024
1 parent ceb72ac commit 0fb952b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Doom Emacs and (almost) all module dependencies.
Not yet tested on macOS. Likely works as long as you do not need an "app" (you
launch Emacs from the commandline or through other means). I intend to fix this.

You may encounter "Cannot find Git revision" errors on Nix versions newer than
2.18.x (see #14). Try enabling `experimentalFetchTree` to work around this (see
below).

Please report any issues.

## How to use
Expand Down Expand Up @@ -177,6 +181,10 @@ support use without flakes.
For example to include Emacs package `treesit-grammars.with-all-grammars`:
`extraPackages = epkgs: [ epkgs.treesit-grammars.with-all-grammars ];`.

- `experimentalFetchTree`: fetch packages using `fetchTree`, which is more
efficient but considered experimental in Nix (subject to changes which might
break fetches).

There are a few other settings but they are not typically useful. See the
source.

Expand Down
22 changes: 21 additions & 1 deletion home-manager.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit 0fb952b

Please sign in to comment.