From b2a39806bd65c31f3f6e2c2ffb671dc5e6358e51 Mon Sep 17 00:00:00 2001 From: "Julie B." Date: Sun, 3 Mar 2024 19:17:46 +0100 Subject: [PATCH] refactor --- flake.lock | 36 +------------------ flake.nix | 18 +++++----- go.mod => integration/go.mod | 0 go.sum => integration/go.sum | 0 spec_test.go => integration/spec_test.go | 0 .../testdata}/24words.txt | 0 {testdata => integration/testdata}/index0.txt | 0 {testdata => integration/testdata}/index1.txt | 0 .../testdata}/nopassphrase.txt | 0 .../testdata}/trivial.txt | 0 10 files changed, 9 insertions(+), 45 deletions(-) rename go.mod => integration/go.mod (100%) rename go.sum => integration/go.sum (100%) rename spec_test.go => integration/spec_test.go (100%) rename {testdata => integration/testdata}/24words.txt (100%) rename {testdata => integration/testdata}/index0.txt (100%) rename {testdata => integration/testdata}/index1.txt (100%) rename {testdata => integration/testdata}/nopassphrase.txt (100%) rename {testdata => integration/testdata}/trivial.txt (100%) diff --git a/flake.lock b/flake.lock index 5ddb277..b7c68c0 100644 --- a/flake.lock +++ b/flake.lock @@ -242,22 +242,6 @@ "type": "github" } }, - "go": { - "flake": false, - "locked": { - "lastModified": 1708106374, - "narHash": "sha256-hERriQM0+kPP1+cTuHfbkMSuESnSdwFUDC7rshrhmU4=", - "owner": "bbjubjub2494", - "repo": "age-hier-go", - "rev": "c0ea9ed2e5328ed800042dbf90f1f23a5c2a04bb", - "type": "github" - }, - "original": { - "owner": "bbjubjub2494", - "repo": "age-hier-go", - "type": "github" - } - }, "hercules-ci-effects": { "inputs": { "flake-parts": "flake-parts_3", @@ -408,26 +392,8 @@ "inputs": { "crate2nix": "crate2nix", "flake-parts": "flake-parts_2", - "go": "go", "hercules-ci-effects": "hercules-ci-effects", - "nixpkgs": "nixpkgs_4", - "rust": "rust" - } - }, - "rust": { - "flake": false, - "locked": { - "lastModified": 1708106547, - "narHash": "sha256-a4V4YH/HW2fuCsQbS2F7ciC3GVKK9sNXkLml3BlbSjk=", - "owner": "bbjubjub2494", - "repo": "age-hier-rust", - "rev": "93b2bf13656bd89514aadc66e775976d9f45d0f7", - "type": "github" - }, - "original": { - "owner": "bbjubjub2494", - "repo": "age-hier-rust", - "type": "github" + "nixpkgs": "nixpkgs_4" } }, "systems": { diff --git a/flake.nix b/flake.nix index abb16bf..2819534 100644 --- a/flake.nix +++ b/flake.nix @@ -7,12 +7,6 @@ inputs.hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects"; - inputs.go.url = "github:bbjubjub2494/age-hier-go"; - inputs.go.flake = false; - - inputs.rust.url = "github:bbjubjub2494/age-hier-rust"; - inputs.rust.flake = false; - nixConfig.extra-substituters = "https://age-hier.cachix.org"; nixConfig.extra-trusted-public-keys = "age-hier.cachix.org-1:8l0mOCbUxA1HGRXpYfphkNnmchO77eD4UQjef+wfPsM="; @@ -50,13 +44,17 @@ implementations.age-hier-go = pkgs.buildGoModule { pname = "age-hier-go"; version = "unstable"; - src = inputs.go; + src = builtins.path { + path = ./go; + # workaround: a source called go is confused with GOPATH + name = "src"; + }; vendorHash = "sha256-RYkc6z/GmW9EY2077xyxJzcDQt0SUlmjfc5pLUUsz4M="; }; cargoNix = inputs.crate2nix.tools.${pkgs.system}.appliedCargoNix { name = "age-hier-rust"; - src = inputs.rust; + src = ./rust; }; implementations.age-hier-rust = cargoNix.rootCrate.build.override {runTests = true;}; in { @@ -64,8 +62,8 @@ checks = builtins.mapAttrs (_: impl: pkgs.buildGoModule { - name = "age-hier-go-check"; - src = self; + name = "${impl.name}-check"; + src = ./integration; vendorHash = "sha256-GDw5dPGPv7TGKWiEH2YjtQLKw/jel1V1JWjQAGjfWVw="; nativeCheckInputs = [impl]; diff --git a/go.mod b/integration/go.mod similarity index 100% rename from go.mod rename to integration/go.mod diff --git a/go.sum b/integration/go.sum similarity index 100% rename from go.sum rename to integration/go.sum diff --git a/spec_test.go b/integration/spec_test.go similarity index 100% rename from spec_test.go rename to integration/spec_test.go diff --git a/testdata/24words.txt b/integration/testdata/24words.txt similarity index 100% rename from testdata/24words.txt rename to integration/testdata/24words.txt diff --git a/testdata/index0.txt b/integration/testdata/index0.txt similarity index 100% rename from testdata/index0.txt rename to integration/testdata/index0.txt diff --git a/testdata/index1.txt b/integration/testdata/index1.txt similarity index 100% rename from testdata/index1.txt rename to integration/testdata/index1.txt diff --git a/testdata/nopassphrase.txt b/integration/testdata/nopassphrase.txt similarity index 100% rename from testdata/nopassphrase.txt rename to integration/testdata/nopassphrase.txt diff --git a/testdata/trivial.txt b/integration/testdata/trivial.txt similarity index 100% rename from testdata/trivial.txt rename to integration/testdata/trivial.txt