From 45f2a5eea089ffdf8cc96fd10a81de81387f3317 Mon Sep 17 00:00:00 2001 From: figsoda Date: Tue, 11 Oct 2022 19:56:31 -0400 Subject: [PATCH] toml2nix: switch to rustPlatform.buildRustPackage --- pkgs/development/tools/toml2nix/Cargo.lock | 25 +++++++++++++++++++++ pkgs/development/tools/toml2nix/default.nix | 24 ++++++++++++++++++++ pkgs/tools/toml2nix/default.nix | 18 --------------- pkgs/top-level/all-packages.nix | 2 +- 4 files changed, 50 insertions(+), 19 deletions(-) create mode 100644 pkgs/development/tools/toml2nix/Cargo.lock create mode 100644 pkgs/development/tools/toml2nix/default.nix delete mode 100644 pkgs/tools/toml2nix/default.nix diff --git a/pkgs/development/tools/toml2nix/Cargo.lock b/pkgs/development/tools/toml2nix/Cargo.lock new file mode 100644 index 000000000000..f6b37fbc189d --- /dev/null +++ b/pkgs/development/tools/toml2nix/Cargo.lock @@ -0,0 +1,25 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "serde" +version = "1.0.145" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" + +[[package]] +name = "toml" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" +dependencies = [ + "serde", +] + +[[package]] +name = "toml2nix" +version = "0.1.1" +dependencies = [ + "toml", +] diff --git a/pkgs/development/tools/toml2nix/default.nix b/pkgs/development/tools/toml2nix/default.nix new file mode 100644 index 000000000000..6987619dbcb5 --- /dev/null +++ b/pkgs/development/tools/toml2nix/default.nix @@ -0,0 +1,24 @@ +{ lib, rustPlatform, fetchCrate }: + +rustPlatform.buildRustPackage rec { + pname = "toml2nix"; + version = "0.1.1"; + + src = fetchCrate { + inherit pname version; + sha256 = "sha256-YhluLS4tFMibFrDzgIvNtfjM5dAqJQvygeZocKn3+Jg="; + }; + + cargoLock.lockFile = ./Cargo.lock; + + postPatch = '' + ln -s ${./Cargo.lock} Cargo.lock + ''; + + meta = with lib; { + description = "A tool to convert TOML files to Nix expressions"; + homepage = "https://crates.io/crates/toml2nix"; + license = with licenses; [ mit /* or */ asl20 ]; + maintainers = with maintainers; [ figsoda ]; + }; +} diff --git a/pkgs/tools/toml2nix/default.nix b/pkgs/tools/toml2nix/default.nix deleted file mode 100644 index ac4de4eee144..000000000000 --- a/pkgs/tools/toml2nix/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by carnix 0.9.7: carnix generate-nix -{ lib, buildPlatform, buildRustCrate, buildRustCrateHelpers, cratesIO, fetchgit }: -with buildRustCrateHelpers; -let inherit (lib.lists) fold; - inherit (lib.attrsets) recursiveUpdate; -in -let crates = cratesIO; in -rec { - toml2nix = crates.crates.toml2nix."0.1.1" deps; - __all = [ (toml2nix {}) ]; - deps.serde."1.0.84" = {}; - deps.toml."0.4.10" = { - serde = "1.0.84"; - }; - deps.toml2nix."0.1.1" = { - toml = "0.4.10"; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 987f3341dc00..4a83bf434b3d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11890,7 +11890,7 @@ with pkgs; toml2json = callPackage ../development/tools/toml2json { }; - toml2nix = (callPackage ../tools/toml2nix { }).toml2nix { }; + toml2nix = callPackage ../development/tools/toml2nix { }; topgrade = callPackage ../tools/misc/topgrade { inherit (darwin.apple_sdk.frameworks) Cocoa Foundation;