diff --git a/fetchNixpkgs.nix b/fetchNixpkgs.nix deleted file mode 100644 index accd0b1e..00000000 --- a/fetchNixpkgs.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ rev # The Git revision of nixpkgs to fetch -, sha256 # The SHA256 of the downloaded data -, outputSha256 ? null # The SHA256 fixed-output hash -, system ? builtins.currentSystem # This is overridable if necessary -}: - -if (0 <= builtins.compareVersions builtins.nixVersion "1.12") - -# In Nix 1.12, we can just give a `sha256` to `builtins.fetchTarball`. -then ( - builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz"; - sha256 = outputSha256; - }) - -# This hack should at least work for Nix 1.11 -else ( - (rec { - tarball = import { - url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz"; - inherit sha256; - }; - - builtin-paths = import ; - - script = builtins.toFile "nixpkgs-unpacker" '' - "$coreutils/mkdir" "$out" - cd "$out" - "$gzip" --decompress < "$tarball" | "$tar" -x --strip-components=1 - ''; - - nixpkgs = builtins.derivation ({ - name = "nixpkgs-${builtins.substring 0 6 rev}"; - - builder = builtins.storePath builtin-paths.shell; - - args = [ script ]; - - inherit tarball system; - - tar = builtins.storePath builtin-paths.tar; - gzip = builtins.storePath builtin-paths.gzip; - coreutils = builtins.storePath builtin-paths.coreutils; - } // (if null == outputSha256 then { } else { - outputHashMode = "recursive"; - outputHashAlgo = "sha256"; - outputHash = outputSha256; - })); - }).nixpkgs) - diff --git a/nixpkgs.nix b/nixpkgs.nix new file mode 100644 index 00000000..746f7528 --- /dev/null +++ b/nixpkgs.nix @@ -0,0 +1,10 @@ +let + rev = "c5f9cd4cde81bcef2c8882d359d9d30313bebeb3"; + outputSha256 = "1nilhz6rhfg3ckp8yfmgy6v3q6spbyxfg0yn8rc2ydyn7119h4fn"; + + nixpkgs = builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz"; + sha256 = outputSha256; + }; +in + import nixpkgs {} diff --git a/release.nix b/release.nix index e6c72249..be52eee1 100644 --- a/release.nix +++ b/release.nix @@ -1,15 +1,5 @@ let - fetchNixpkgs = import ./fetchNixpkgs.nix; - - nixpkgs = fetchNixpkgs { - rev = "c5f9cd4cde81bcef2c8882d359d9d30313bebeb3"; - - sha256 = "12w6g50hgk5nmijgs3rv7kq5mdybnkyv3cr2zm0q3ka9ax180dk6"; - - outputSha256 = "1nilhz6rhfg3ckp8yfmgy6v3q6spbyxfg0yn8rc2ydyn7119h4fn"; - }; - - pkgs = import nixpkgs {}; + pkgs = import ./nixpkgs.nix; dhall-kubernetes-smoketests = pkgs.runCommand @@ -42,4 +32,3 @@ in ]; }; } - diff --git a/shell.nix b/shell.nix new file mode 100644 index 00000000..83125430 --- /dev/null +++ b/shell.nix @@ -0,0 +1,14 @@ +let + pkgs = import ./nixpkgs.nix; +in + pkgs.stdenv.mkDerivation { + name = "dhall-kubernetes-shell"; + buildInputs = [ + pkgs.git + pkgs.dhall + pkgs.dhall-json + pkgs.python3 + pkgs.python3Packages.requests + pkgs.glibcLocales + ]; + }