Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
, ghc ? (import ./versions.nix).ghc.preferred
}:

with pkgs.haskell.lib;

let inherit (pkgs) lib;
let
postInstallGenerateOptparseApplicativeCompletion = exeName: ''
bashCompDir="''${!outputBin}/share/bash-completion/completions"
zshCompDir="''${!outputBin}/share/zsh/vendor-completions"
Expand Down Expand Up @@ -55,9 +53,14 @@ in rec {
# thing to install
command = project.nix-thunk.components.exes.nix-thunk;

inherit (import ./dep/gitignore.nix { inherit lib; }) gitignoreSource;
inherit (import ./dep/gitignore.nix { inherit (pkgs) lib; }) gitignoreSource;

lib = pkgs.callPackage ./lib.nix {
inherit gitignoreSource;
inherit (pkgs) fetchgitPrivate;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, idk why. i know fetchgitPrivate has since been removed, but it should still show up w/ callPackage on our checkout. I wanted to look further into this.

};

inherit (import ./lib.nix { inherit pkgs gitignoreSource; })
inherit (lib)
thunkSource
mapSubdirectories
;
Expand Down
15 changes: 8 additions & 7 deletions lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
# that is what these functions help with.

{
lib ? pkgs.lib,
pkgs,
gitignoreSource ?
(import ./dep/gitignore.nix { inherit lib; }).gitignoreSource,
lib,
fetchgit,
fetchgitPrivate,
gitignoreSource ? (import ./dep/gitignore.nix { inherit lib; }).gitignoreSource,
fetchFromGitHub,
}:

{
Expand Down Expand Up @@ -47,11 +48,11 @@
else if hasValidThunk "git.json" then (
let gitArgs = filterArgs (builtins.fromJSON (builtins.readFile (p + "/git.json")));
in if builtins.elem "@" (lib.stringToCharacters gitArgs.url)
then pkgs.fetchgitPrivate gitArgs
else pkgs.fetchgit gitArgs
then fetchgitPrivate gitArgs
else fetchgit gitArgs
)
else if hasValidThunk "github.json" then
pkgs.fetchFromGitHub (filterArgs (builtins.fromJSON (builtins.readFile (p + "/github.json"))))
fetchFromGitHub (filterArgs (builtins.fromJSON (builtins.readFile (p + "/github.json"))))
else {
name = baseNameOf p;
outPath = gitignoreSource p;
Expand Down