diff --git a/dep/nix-daml-sdk/default.nix b/dep/nix-daml-sdk/default.nix new file mode 100644 index 0000000..2b4d4ab --- /dev/null +++ b/dep/nix-daml-sdk/default.nix @@ -0,0 +1,2 @@ +# DO NOT HAND-EDIT THIS FILE +import (import ./thunk.nix) \ No newline at end of file diff --git a/dep/nix-daml-sdk/git.json b/dep/nix-daml-sdk/git.json new file mode 100644 index 0000000..c192387 --- /dev/null +++ b/dep/nix-daml-sdk/git.json @@ -0,0 +1,7 @@ +{ + "url": "ssh://git@code.obsidian.systems/daml/nix-daml-sdk", + "rev": "b29698abd21bdfe1e0ab96271c0c7189e90f05dd", + "sha256": "1y9ak1vdyplqk2c6www9h75yqks58q6iwyv7py0c700vyav8wk51", + "private": true, + "fetchSubmodules": false +} diff --git a/dep/nix-daml-sdk/thunk.nix b/dep/nix-daml-sdk/thunk.nix new file mode 100644 index 0000000..3e23b43 --- /dev/null +++ b/dep/nix-daml-sdk/thunk.nix @@ -0,0 +1,17 @@ +# DO NOT HAND-EDIT THIS FILE +let fetch = {url, rev, branch ? null, sha256 ? null, fetchSubmodules ? false, private ? false, ...}: + let realUrl = let firstChar = builtins.substring 0 1 url; in + if firstChar == "/" then /. + url + else if firstChar == "." then ./. + url + else url; + in if !fetchSubmodules && private then builtins.fetchGit { + url = realUrl; inherit rev; + ${if branch == null then null else "ref"} = branch; + } else (import (builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/3aad50c30c826430b0270fcf8264c8c41b005403.tar.gz"; + sha256 = "0xwqsf08sywd23x0xvw4c4ghq0l28w2ki22h0bdn766i16z9q2gr"; +}) {}).fetchgit { + url = realUrl; inherit rev sha256; + }; + json = builtins.fromJSON (builtins.readFile ./git.json); +in fetch json \ No newline at end of file diff --git a/dep/nix-thunk/default.nix b/dep/nix-thunk/default.nix new file mode 100644 index 0000000..2b4d4ab --- /dev/null +++ b/dep/nix-thunk/default.nix @@ -0,0 +1,2 @@ +# DO NOT HAND-EDIT THIS FILE +import (import ./thunk.nix) \ No newline at end of file diff --git a/dep/nix-thunk/github.json b/dep/nix-thunk/github.json new file mode 100644 index 0000000..42dcedf --- /dev/null +++ b/dep/nix-thunk/github.json @@ -0,0 +1,7 @@ +{ + "owner": "obsidiansystems", + "repo": "nix-thunk", + "private": false, + "rev": "0982911d78fbd9932c3ed8104a930f313f49b69b", + "sha256": "130n8mzywbvyqd6aap6yk98zynq3r3kpj2hfzdym26plwz0rr3bj" +} diff --git a/dep/nix-thunk/thunk.nix b/dep/nix-thunk/thunk.nix new file mode 100644 index 0000000..20f2d28 --- /dev/null +++ b/dep/nix-thunk/thunk.nix @@ -0,0 +1,12 @@ +# DO NOT HAND-EDIT THIS FILE +let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }: + if !fetchSubmodules && !private then builtins.fetchTarball { + url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256; + } else (import (builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/3aad50c30c826430b0270fcf8264c8c41b005403.tar.gz"; + sha256 = "0xwqsf08sywd23x0xvw4c4ghq0l28w2ki22h0bdn766i16z9q2gr"; +}) {}).fetchFromGitHub { + inherit owner repo rev sha256 fetchSubmodules private; + }; + json = builtins.fromJSON (builtins.readFile ./github.json); +in fetch json \ No newline at end of file diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..3b9edfe --- /dev/null +++ b/shell.nix @@ -0,0 +1,5 @@ +{ vimMode ? false }: +let + thunkSource = (import ./dep/nix-thunk {}).thunkSource; +in + import (thunkSource ./dep/nix-daml-sdk + "/shell.nix") { inherit vimMode; }