diff options
author | sterni <sternenseemann@systemli.org> | 2021-04-02T19·59+0200 |
---|---|---|
committer | sterni <sternenseemann@systemli.org> | 2021-04-03T22·16+0000 |
commit | 0133fdc737286a678fbc46a97810dfb152588c77 (patch) | |
tree | c1900a1bb031a5af547d7843e79585a7ea4b8c37 /users | |
parent | 3e7073f106dba0b97484935347b94b1c11db9b81 (diff) |
chore: move all 3p buildRustCrate derivations to //third_party r/2419
Profpatsch and me are basically the only users of depot.users.Profpatsch.writers.rustSimple*. To pull in the odd dependency we usually use buildRustCrate which is rather convenient. However we've picked up the bad habit of inlining these in a let somewhere instead of managing them in a more central location although there has been an (unsuccesful) attempt at this in //users/Profpatsch/rust-crates.nix. This CL moves all buildRustCrate based derivations into third_party.rust-crates and deletes any duplicate derivations we have accumulated in the tree. Change-Id: I8f68b95ebd546708e9af07dca36d72dba9ca8c77 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2769 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: Profpatsch <mail@profpatsch.de>
Diffstat (limited to 'users')
-rw-r--r-- | users/Profpatsch/imap-idle.nix | 4 | ||||
-rw-r--r-- | users/Profpatsch/netencode/default.nix | 42 | ||||
-rw-r--r-- | users/Profpatsch/read-http.nix | 4 | ||||
-rw-r--r-- | users/Profpatsch/rust-crates.nix | 211 | ||||
-rw-r--r-- | users/Profpatsch/tree-sitter.nix | 4 | ||||
-rw-r--r-- | users/sterni/nint/default.nix | 41 |
6 files changed, 11 insertions, 295 deletions
diff --git a/users/Profpatsch/imap-idle.nix b/users/Profpatsch/imap-idle.nix index 30c7b6e8aac8..afd033533f3c 100644 --- a/users/Profpatsch/imap-idle.nix +++ b/users/Profpatsch/imap-idle.nix @@ -5,8 +5,8 @@ let name = "imap-idle"; dependencies = [ depot.users.Profpatsch.arglib.netencode.rust - depot.users.Profpatsch.rust-crates.imap - depot.users.Profpatsch.rust-crates.epoll + depot.third_party.rust-crates.imap + depot.third_party.rust-crates.epoll depot.users.Profpatsch.execline.exec-helpers ]; } (builtins.readFile ./imap-idle.rs); diff --git a/users/Profpatsch/netencode/default.nix b/users/Profpatsch/netencode/default.nix index dabf640d51e9..206e382c74c6 100644 --- a/users/Profpatsch/netencode/default.nix +++ b/users/Profpatsch/netencode/default.nix @@ -10,7 +10,7 @@ let (imports.writers.rustSimpleLib { name = "netencode"; dependencies = [ - depot.users.Profpatsch.rust-crates.nom + depot.third_party.rust-crates.nom depot.users.Profpatsch.execline.exec-helpers ]; release = false; @@ -19,50 +19,12 @@ let gen = import ./gen.nix { inherit lib; }; - cfg-if = pkgs.buildRustCrate { - pname = "cfg-if"; - version = "1.0.0"; - crateName = "cfg-if"; - sha256 = "1fzidq152hnxhg4lj6r2gv4jpnn8yivp27z6q6xy7w6v0dp6bai9"; - }; - - log = pkgs.buildRustCrate { - pname = "log"; - version = "0.4.11"; - crateName = "log"; - sha256 = "0m6xhqxsps5mgd7r91g5mqkndbh8zbjd58p7w75r330zl4n40l07"; - dependencies = [ cfg-if ]; - }; - - serde_derive = pkgs.buildRustCrate { - pname = "serde"; - crateName = "serde"; - version = "1.0.123"; - sha256 = "05xl2s1vpf3p7fi2yc9qlzw88d5ap0z3qmhmd7axa6pp9pn1s5xc"; - }; - - serde = pkgs.buildRustCrate { - pname = "serde"; - crateName = "serde"; - version = "1.0.123"; - sha256 = "05xl2s1vpf3p7fi2yc9qlzw88d5ap0z3qmhmd7axa6pp9pn1s5xc"; - features = [ "std" ]; - }; - - mustache = pkgs.buildRustCrate { - pname = "mustache"; - version = "0.9.0"; - crateName = "mustache"; - sha256 = "1zgl8l15i19lzp90icgwyi6zqdd31b9vm8w129f41d1zd0hs7ayq"; - dependencies = [ log serde ]; - }; - netencode-mustache = imports.writers.rustSimple { name = "netencode_mustache"; dependencies = [ depot.users.Profpatsch.arglib.netencode.rust netencode-rs - mustache + depot.third_party.rust-crates.mustache ]; } (builtins.readFile ./netencode-mustache.rs); diff --git a/users/Profpatsch/read-http.nix b/users/Profpatsch/read-http.nix index 614993c457e1..2b7465dab88a 100644 --- a/users/Profpatsch/read-http.nix +++ b/users/Profpatsch/read-http.nix @@ -5,8 +5,8 @@ let read-http = depot.users.Profpatsch.writers.rustSimple { name = "read-http"; dependencies = [ - depot.users.Profpatsch.rust-crates.ascii - depot.users.Profpatsch.rust-crates.httparse + depot.third_party.rust-crates.ascii + depot.third_party.rust-crates.httparse depot.users.Profpatsch.netencode.netencode-rs depot.users.Profpatsch.arglib.netencode.rust depot.users.Profpatsch.execline.exec-helpers diff --git a/users/Profpatsch/rust-crates.nix b/users/Profpatsch/rust-crates.nix deleted file mode 100644 index 7004a699c4ca..000000000000 --- a/users/Profpatsch/rust-crates.nix +++ /dev/null @@ -1,211 +0,0 @@ -{ depot, pkgs, ... }: -rec { - cfg-if = pkgs.buildRustCrate { - pname = "cfg-if"; - crateName = "cfg-if"; - version = "1.0.0"; - sha256 = "1fzidq152hnxhg4lj6r2gv4jpnn8yivp27z6q6xy7w6v0dp6bai9"; - }; - - cc = pkgs.buildRustCrate { - pname = "cc"; - crateName = "cc"; - version = "1.0.66"; - sha256 = "12q71z6ck8wlqrwgi25x3lrryyks9djymswn9b1c6qq0i01jpc1p"; - }; - - ascii = pkgs.buildRustCrate { - pname = "ascii"; - crateName = "ascii"; - version = "1.0.0"; - sha256 = "0gam8xsn981wfa40srsniivffjsfz1pg0xnigmczk9k7azb1ks1m"; - }; - - regex-syntax = pkgs.buildRustCrate { - pname = "regex-syntax"; - crateName = "regex-syntax"; - version = "0.6.22"; - sha256 = "0r00n2dgyixacl1sczqp18gxf0xh7x272hcdp62412lypba2gqyg"; - }; - - regex = pkgs.buildRustCrate { - pname = "regex"; - crateName = "regex"; - version = "1.4.3"; - features = [ "std" ]; - dependencies = [ regex-syntax ]; - sha256 = "0w0b4bh0ng20lf5y8raaxmxj46ikjqpgwy1iggzpby9lhv9vydkp"; - }; - - libloading = pkgs.buildRustCrate { - pname = "libloading"; - crateName = "libloading"; - version = "0.6.7"; - dependencies = [ cfg-if ]; - sha256 = "111d8zsizswnxiqn43vcgnc2ym9spsx1i6pcfp35ca3yw2ixq95j"; - }; - - tree-sitter = pkgs.buildRustCrate { - pname = "tree_sitter"; - crateName = "tree-sitter"; - # buildRustCrate isn’t really smart enough to detect the subdir - libPath = "binding_rust/lib.rs"; - # and the build.rs is also not where buildRustCrate would find it - build = "binding_rust/build.rs"; - version = "0.17.1"; - dependencies = [ regex ]; - buildDependencies = [ cc ]; - sha256 = "0jwwbvs4icpra7m1ycvnyri5h3sbw4qrfvgnnvnk72h4w93qhzhr"; - }; - - libc = pkgs.buildRustCrate { - pname = "libc"; - crateName = "libc"; - version = "0.2.82"; - sha256 = "02zgn6c0xwh331hky417lbr29kmvrw3ylxs8822syyhjfjqszvsx"; - }; - - bitflags = pkgs.buildRustCrate { - pname = "bitflags"; - crateName = "bitflags"; - version = "1.2.1"; - sha256 = "0b77awhpn7yaqjjibm69ginfn996azx5vkzfjj39g3wbsqs7mkxg"; - }; - - inotify-sys = pkgs.buildRustCrate { - pname = "inotify-sys"; - crateName = "inotify-sys"; - version = "0.1.5"; - dependencies = [ libc ]; - sha256 = "1yiy577xxhi0j90nbg9nkd8cqwc1xix62rz55jjngvxa5jl5613v"; - }; - - inotify = pkgs.buildRustCrate { - pname = "inotify"; - crateName = "inotify"; - version = "0.9.2"; - edition = "2018"; - dependencies = [ bitflags libc inotify-sys ]; - sha256 = "0fcknyvknglwwk1pdzdlb4m0ry2dym1yx8r5prf2v00pxnjk0hv2"; - }; - - httparse = pkgs.buildRustCrate { - pname = "httparse"; - version = "1.3.4"; - crateName = "httparse"; - sha256 = "0dggj4s0cq69bn63q9nqzzay5acmwl33nrbhjjsh5xys8sk2x4jw"; - }; - - version-check = pkgs.buildRustCrate { - pname = "version-check"; - version = "0.9.2"; - crateName = "version-check"; - sha256 = "1vwvc1mzwv8ana9jv8z933p2xzgj1533qwwl5zr8mi89azyhq21v"; - }; - - memchr = pkgs.buildRustCrate { - pname = "memchr"; - version = "2.3.3"; - crateName = "memchr"; - sha256 = "1ivxvlswglk6wd46gadkbbsknr94gwryk6y21v64ja7x4icrpihw"; - }; - nom = pkgs.buildRustCrate { - pname = "nom"; - version = "5.1.1"; - crateName = "nom"; - sha256 = "1gb4r6mjwd645jqh02nhn60i7qkw8cgy3xq1r4clnmvz3cmkv1l0"; - dependencies = [ memchr ]; - buildDependencies = [ version-check ]; - features = [ "std" "alloc" ]; - }; - - base64 = pkgs.buildRustCrate { - pname = "base64"; - version = "0.13.0"; - crateName = "base64"; - edition = "2018"; - sha256 = "0i0jk5sgq37kc4c90d1g7dp7zvphbg0dbqc1ajnn0vffjxblgamg"; - features = [ "alloc" "std" ]; - }; - - bufstream = pkgs.buildRustCrate { - pname = "bufstream"; - version = "0.1.4"; - crateName = "bufstream"; - sha256 = "10rqm7jly5jjx7wcc19q6q4m2zsrw3l2v3m1054wnbwvdh42xxf1"; - }; - - autocfg = pkgs.buildRustCrate { - pname = "autocfg"; - version = "1.0.1"; - crateName = "autocfg"; - sha256 = "1lsjz23jdcchcqbsmlzd4iksg3hc8bdvy677jy0938i2gp24frw1"; - }; - - num-traits = pkgs.buildRustCrate { - pname = "num-traits"; - version = "0.2.14"; - crateName = "num-traits"; - buildDependencies = [ autocfg ]; - sha256 = "09ac9dcp6cr57vjzyiy213y7312jqcy84mkamp99zr40qd1gwnyk"; - }; - - num-integer = pkgs.buildRustCrate { - pname = "num-integer"; - version = "0.1.44"; - crateName = "num-integer"; - dependencies = [ num-traits ]; - buildDependencies = [ autocfg ]; - sha256 = "1gdbnfgnivp90h644wmqj4a20yfmdga2xxxacx53pjbcazvfvajc"; - }; - - chrono = pkgs.buildRustCrate { - pname = "chrono"; - version = "0.4.19"; - crateName = "chrono"; - dependencies = [ num-traits num-integer ]; - features = [ "alloc" "std" ]; - sha256 = "0cjf5dnfbk99607vz6n5r6bhwykcypq5psihvk845sxrhnzadsar"; - }; - - imap-proto = pkgs.buildRustCrate { - pname = "imap-proto"; - version = "0.10.2"; - crateName = "imap-proto"; - dependencies = [ nom ]; - sha256 = "1bf5r4d0z7c8wxrvr7kjy26500wr7cd4sxz49ix3b3yzc6ayyqv1"; - }; - - lazy_static = pkgs.buildRustCrate { - pname = "lazy_static"; - version = "1.4.0"; - crateName = "lazy_static"; - sha256 = "13h6sdghdcy7vcqsm2gasfw3qg7ssa0fl3sw7lq6pdkbk52wbyfr"; - }; - - imap = pkgs.buildRustCrate { - pname = "imap"; - version = "2.4.0"; - crateName = "imap"; - edition = "2018"; - dependencies = [ - base64 - bufstream - chrono - imap-proto - lazy_static - nom - regex - ]; - sha256 = "1nj6x45qnid98nv637623rrh7imcxk0kad89ry8j5dkkgccvjyc0"; - }; - - epoll = pkgs.buildRustCrate { - pname = "epoll"; - version = "4.3.1"; - crateName = "epoll"; - dependencies = [ bitflags libc ]; - sha256 = "0dgmgdmrfbjkpxn1w3xmmwsm2a623a9qdwn90s8yl78n4a36kbh9"; - }; - -} diff --git a/users/Profpatsch/tree-sitter.nix b/users/Profpatsch/tree-sitter.nix index 8fc2a847c6bd..101ee03d4fe1 100644 --- a/users/Profpatsch/tree-sitter.nix +++ b/users/Profpatsch/tree-sitter.nix @@ -8,7 +8,7 @@ let print-ast = depot.users.Profpatsch.writers.rustSimple { name = "print-ast"; - dependencies = with depot.users.Profpatsch.rust-crates; [ + dependencies = with depot.third_party.rust-crates; [ libloading tree-sitter ]; @@ -61,7 +61,7 @@ let watch-file-modified = depot.users.Profpatsch.writers.rustSimple { name = "watch-file-modified"; dependencies = [ - depot.users.Profpatsch.rust-crates.inotify + depot.third_party.rust-crates.inotify depot.users.Profpatsch.netstring.rust-netstring ]; } '' diff --git a/users/sterni/nint/default.nix b/users/sterni/nint/default.nix index 69ca7283a50f..a7952393c6db 100644 --- a/users/sterni/nint/default.nix +++ b/users/sterni/nint/default.nix @@ -4,46 +4,11 @@ let inherit (depot.users.Profpatsch.writers) rustSimpleBin ; - - inherit (pkgs) - buildRustCrate - ; - - serde = buildRustCrate { - pname = "serde"; - crateName = "serde"; - version = "1.0.123"; - sha256 = "05xl2s1vpf3p7fi2yc9qlzw88d5ap0z3qmhmd7axa6pp9pn1s5xc"; - features = [ "std" ]; - }; - - ryu = buildRustCrate { - pname = "ryu"; - version = "1.0.5"; - crateName = "ryu"; - sha256 = "060y2ln1csix593ingwxr2y3wl236ls0ly1ffkv39h5im7xydhrc"; - }; - - itoa = buildRustCrate { - pname = "itoa"; - version = "0.4.7"; - crateName = "itoa"; - sha256 = "0079jlkcmcaw37wljrvb6r3dqq15nfahkqnl5npvlpdvkg31k11x"; - }; - - serde_json = buildRustCrate { - pname = "serde_json"; - version = "1.0.62"; - crateName = "serde_json"; - sha256 = "0sgc8dycigq0nxr4j613m4q733alfb2i10s6nz80lsbbqgrka21q"; - dependencies = [ serde ryu itoa ]; - features = [ "std" ]; - edition = "2018"; - }; - in rustSimpleBin { name = "nint"; - dependencies = [ serde_json ]; + dependencies = [ + depot.third_party.rust-crates.serde_json + ]; } (builtins.readFile ./nint.rs) |