-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nix: make review-shell.nix code static
Previously, the whole shell.nix was created at runtime using string substitution and other crimes that made it hard to work on the expression itself. This patch turns the string substitutions into Nix function arguments to an otherwise static Nix expression and only generates the list of attrs to be built dynamically.
- Loading branch information
1 parent
d364838
commit d758033
Showing
2 changed files
with
78 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ system | ||
, nixpkgs-config-path # Path to Nix file containing the Nixpkgs config | ||
, attrs-path # Path to Nix file containing a list of attributes to build | ||
, nixpkgs-path # Path to this review's nixpkgs | ||
, pkgs ? import nixpkgs-path { inherit system; config = import nixpkgs-config-path; } | ||
, lib ? pkgs.lib | ||
}: | ||
|
||
let | ||
attrs = import attrs-path pkgs; | ||
env = pkgs.buildEnv { | ||
name = "env"; | ||
paths = attrs; | ||
ignoreCollisions = true; | ||
}; | ||
in | ||
(import nixpkgs-path { }).mkShell { | ||
name = "review-shell"; | ||
preferLocalBuild = true; | ||
allowSubstitutes = false; | ||
dontWrapQtApps = true; | ||
packages = if builtins.length attrs > 50 then [ env ] else attrs; | ||
} |