···11+{ dhallPackages, dhallPackageToNix}:
22+33+# `dhallDirectoryToNix is a utility function to take a directory of Dhall files
44+# and read them in as a Nix expression.
55+#
66+# This function is similar to `dhallToNix`, but takes a Nixpkgs Dhall package
77+# as input instead of raw Dhall code.
88+#
99+# Note that this uses "import from derivation" (IFD), meaning that Nix will
1010+# perform a build during the evaluation phase if you use this
1111+# `dhallDirectoryToNix` utility. It is not possible to use
1212+# `dhallDirectoryToNix` in Nixpkgs, since the Nixpkgs Hydra doesn't allow IFD.
1313+1414+{ src
1515+, # The file to import, relative to the src root directory
1616+ file ? "package.dhall"
1717+}@args:
1818+1919+let
2020+ generatedPkg = dhallPackages.generateDhallDirectoryPackage args;
2121+2222+ builtPkg = dhallPackages.callPackage generatedPkg { };
2323+2424+in
2525+ dhallPackageToNix builtPkg
+36
pkgs/build-support/dhall/package-to-nix.nix
···11+22+# `dhallPackageToNix` is a utility function to take a Nixpkgs Dhall package
33+# (created with a function like `dhallPackages.buildDhallDirectoryPackage`)
44+# and read it in as a Nix expression.
55+#
66+# This function is similar to `dhallToNix`, but takes a Nixpkgs Dhall package
77+# as input instead of raw Dhall code.
88+#
99+# Note that this uses "import from derivation" (IFD), meaning that Nix will
1010+# perform a build during the evaluation phase if you use this
1111+# `dhallPackageToNix` utility. It is not possible to use `dhallPackageToNix`
1212+# in Nixpkgs, since the Nixpkgs Hydra doesn't allow IFD.
1313+1414+{ stdenv, dhall-nix }:
1515+1616+dhallPackage:
1717+ let
1818+ drv = stdenv.mkDerivation {
1919+ name = "dhall-compiled-package.nix";
2020+2121+ buildCommand = ''
2222+ # Dhall requires that the cache is writable, even if it is never written to.
2323+ # We copy the cache from the input package to the current directory and
2424+ # set the cache as writable.
2525+ cp -r "${dhallPackage}/.cache" ./
2626+ export XDG_CACHE_HOME=$PWD/.cache
2727+ chmod -R +w ./.cache
2828+2929+ dhall-to-nix <<< "${dhallPackage}/binary.dhall" > $out
3030+ '';
3131+3232+ nativeBuildInputs = [ dhall-nix ];
3333+ };
3434+3535+ in
3636+ import drv
···11+{ dhallPackages, fetchFromGitHub }:
22+33+# This file tests that dhallPackages.generateDhallDirectoryPackage works.
44+#
55+# TODO: It would be nice to extend this test to make sure that the resulting
66+# Nix file has the expected contents, but it might be tough to do that easily
77+# without IFD.
88+99+dhallPackages.generateDhallDirectoryPackage {
1010+ src = fetchFromGitHub {
1111+ owner = "cdepillabout";
1212+ repo = "example-dhall-nix";
1313+ rev = "e6a675c72ecd4dd23d254a02aea8181fe875747f";
1414+ sha256 = "sha256-c/EZq76s/+hmLkaeJWKqgh2KrHuJRYI6kWry0E0YQ6s=";
1515+ };
1616+ file = "mydhallfile.dhall";
1717+}
···2233stdenv.mkDerivation rec {
44 pname = "jdupes";
55- version = "1.20.1";
55+ version = "1.20.2";
6677 src = fetchFromGitHub {
88 owner = "jbruchon";
99 repo = "jdupes";
1010 rev = "v${version}";
1111- sha256 = "sha256-qGYMLLksbC6bKbK+iRkZ2eSNU5J/wEvTfzT0IkKukvA=";
1111+ sha256 = "sha256-3hKO+hNwYiJZ9Wn53vM7DHZmtvDhtgtSbW7bCMCT7s0=";
1212 # Unicode file names lead to different checksums on HFS+ vs. other
1313 # filesystems because of unicode normalisation. The testdir
1414 # directories have such files and will be removed.