diff options
author | Silvan Mosberger <infinisil@icloud.com> | 2019-08-26 18:23:55 +0200 |
---|---|---|
committer | Silvan Mosberger <infinisil@icloud.com> | 2019-08-26 18:23:55 +0200 |
commit | 1ffdf01777360f548cc7c10ef5b168cbe78fd183 (patch) | |
tree | be0d58c6630a28db146c139c72d6f1b82ee14851 /pkgs/development/compilers/mint | |
parent | a3aec20f266c57d989524f02b1243b4ad24020a2 (diff) |
crystal2nix: Put it into pkgs
Diffstat (limited to 'pkgs/development/compilers/mint')
-rw-r--r-- | pkgs/development/compilers/mint/crystal2nix.cr | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/pkgs/development/compilers/mint/crystal2nix.cr b/pkgs/development/compilers/mint/crystal2nix.cr deleted file mode 100644 index f608102a37b4d..0000000000000 --- a/pkgs/development/compilers/mint/crystal2nix.cr +++ /dev/null @@ -1,42 +0,0 @@ -require "yaml" -require "json" - -class PrefetchJSON - JSON.mapping(sha256: String) -end - -class ShardLock - YAML.mapping( - version: Float32, - shards: Hash(String, Hash(String, String)) - ) -end - -File.open "shards.nix", "w+" do |file| - file.puts %({) - yaml = ShardLock.from_yaml(File.read("shard.lock")) - yaml.shards.each do |key, value| - owner, repo = value["github"].split("/") - url = "https://github.com/#{value["github"]}" - rev = if value["version"]? - "v#{value["version"]}" - else - value["commit"] - end - - sha256 = "" - args = ["--url", url, "--rev", rev] - Process.run("nix-prefetch-git", args: args) do |x| - x.error.each_line { |e| puts e } - sha256 = PrefetchJSON.from_json(x.output).sha256 - end - - file.puts %( #{key} = {) - file.puts %( owner = "#{owner}";) - file.puts %( repo = "#{repo}";) - file.puts %( rev = "#{rev}";) - file.puts %( sha256 = "#{sha256}";) - file.puts %( };) - end - file.puts %(}) -end |