mirror of
https://github.com/dhall-lang/dhall-kubernetes.git
synced 2024-09-10 23:15:30 +03:00
Add 'shell.nix' for local development
As part of this I created a new files `./nixpkgs` that obtains a specific version of the nixpkgs repo. This code was previously spread between `release.nix` and `fetchNixpkgs.nix`. I also removed the Nix 1.11 code to simplify things. If we need Nix 1.11 support we can add it again.
This commit is contained in:
parent
6e56cd699c
commit
dbbd53ba50
@ -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 <nix/fetchurl.nix> {
|
||||
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
builtin-paths = import <nix/config.nix>;
|
||||
|
||||
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)
|
||||
|
10
nixpkgs.nix
Normal file
10
nixpkgs.nix
Normal file
@ -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 {}
|
13
release.nix
13
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
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user