Skip to content

Commit

Permalink
Use flake-compat to get the host configurations instead of getFlake
Browse files Browse the repository at this point in the history
getFlake is really slow (~25 seconds) compared to flake-compat (~5 seconds)
since getFlake copies the source into the store. There's an issue open for doing
the copying lazily[1].

[1]: NixOS/nix#3121
  • Loading branch information
bigolu committed Oct 20, 2024
1 parent e070b08 commit 86fdceb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/get-host-configurations.bash
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ echo

printf '\n%s\n' '- Home Manager'
# shellcheck disable=2016
nix eval --raw --impure --expr 'let x = builtins.getFlake (builtins.toString ./.); in (builtins.concatStringsSep "\n" (map (name: "\n - ${name} / ${x.outputs.homeConfigurations.${name}.activationPackage.system}") (builtins.attrNames x.outputs.homeConfigurations))) + "\n"'
nix eval --raw --impure --expr 'let x = import ./default.nix; in (builtins.concatStringsSep "\n" (map (name: "\n - ${name} / ${x.outputs.homeConfigurations.${name}.activationPackage.system}") (builtins.attrNames x.outputs.homeConfigurations))) + "\n"'

printf '\n%s\n' '- nix-darwin'
# shellcheck disable=2016
nix eval --raw --impure --expr 'let x = builtins.getFlake (builtins.toString ./.); in (builtins.concatStringsSep "\n" (map (name: "\n - ${name} / ${x.outputs.darwinConfigurations.${name}.system.system}") (builtins.attrNames x.outputs.darwinConfigurations))) + "\n"'
nix eval --raw --impure --expr 'let x = import ./default.nix; in (builtins.concatStringsSep "\n" (map (name: "\n - ${name} / ${x.outputs.darwinConfigurations.${name}.system.system}") (builtins.attrNames x.outputs.darwinConfigurations))) + "\n"'

0 comments on commit 86fdceb

Please sign in to comment.