commit 040294dbf233454a8654f168a22c570aeb529a87 Author: Emery Hemingway Date: Thu Sep 2 12:16:35 2021 +0200 Package syndicate-rs diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..944b3a2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,75 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1623875721, + "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1630572390, + "narHash": "sha256-xPqD/SFQ/QKxR85ZQ/WkNEAI6yfCW0XFXmmWBp2KKLw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f6645fdf90d443c38fbc98125a4665f5e798e807", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1628186154, + "narHash": "sha256-r2d0wvywFnL9z4iptztdFMhaUIAaGzrSs7kSok0PgmE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "06552b72346632b6943c8032e57e702ea12413bf", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "rust": "rust" + } + }, + "rust": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1630548746, + "narHash": "sha256-SLzeWhEN0kRDTzL+AHfDxwbYEZm09UEcdIcPDdOIZew=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "00f6332f8c690480c7b7137fb8b1f069e7b2e18a", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..778acac --- /dev/null +++ b/flake.nix @@ -0,0 +1,28 @@ +{ + description = "Syndicate helper"; + + inputs.rust.url = "github:oxalica/rust-overlay"; + + outputs = { self, nixpkgs, rust }: + let forEachSystem = nixpkgs.lib.genAttrs [ "aarch64-linux" "x86_64-linux" ]; + in { + + overlay = final: prev: + with final; { + syndicate-rs = callPackage ./syndicate-rs { + rust = rust-bin.nightly.latest.default; + }; + }; + + legacyPackages = forEachSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in (pkgs.extend rust.overlay).extend self.overlay); + + packages = forEachSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in with (pkgs.extend rust.overlay).extend self.overlay; { + inherit syndicate-rs; + }); + + }; +} diff --git a/syndicate-rs/default.nix b/syndicate-rs/default.nix new file mode 100644 index 0000000..746e28b --- /dev/null +++ b/syndicate-rs/default.nix @@ -0,0 +1,14 @@ +{ lib, rustPlatform, rust, fetchgit, pkg-config, openssl }: + +rustPlatform.buildRustPackage rec { + pname = "syndicate-rs"; + version = "2021-09-01"; + src = fetchgit { + url = "https://git.syndicate-lang.org/syndicate-lang/syndicate-rs.git"; + rev = "622115e13c69397dfa0beb433fdaf382949252b3"; + sha256 = "sha256-7XcCiDlUntLRB0MLYk+57RSe4f6NyqRa/Jc42xrPOnQ="; + }; + cargoHash = "sha256-sagyE3yCmSNwqgZrgnw1ar7S37iZhVYYpn3WtIoBIU8="; + nativeBuildInputs = [ rust pkg-config ]; + buildInputs = [ openssl ]; +}