From 0a9ac5fd07b52467d81163b1f8c94c12e5c9aff9 Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Thu, 5 Jan 2023 23:31:25 -0500 Subject: [PATCH] Prepare 0.6.0 (#94) * Prepare 0.6.0 * Update actions * Update default.nix * Update actions * Update test --- .github/workflows/nix.yml | 9 +++---- CHANGELOG.md | 10 ++++++++ flake.lock | 18 ++++++------- flake.nix | 53 +++++++++++++++++++++------------------ nix/default.nix | 3 ++- nvfetcher.cabal | 4 +-- test/PrefetchSpec.hs | 2 +- 7 files changed, 56 insertions(+), 43 deletions(-) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index c96277b..efe43d3 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -7,13 +7,10 @@ jobs: nix-tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.3.4 - - uses: cachix/install-nix-action@v13 + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v18 with: - install_url: https://nixos-nix-install-tests.cachix.org/serve/i6laym9jw3wg9mw6ncyrk6gjx4l34vvx/install - install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' - extra_nix_config: | - experimental-features = nix-command flakes + github_access_token: ${{ secrets.GITHUB_TOKEN }} nix_path: nixpkgs=channel:nixos-unstable - name: Run Nix Flake Check diff --git a/CHANGELOG.md b/CHANGELOG.md index 11597c4..44a380f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Revision history for nvfetcher +## 0.6.0.0 + +* Parse error output from nvchecker +* Add source and fetcher for Docker containers (Thanks to @amesgen) +* Add option fetch.force to always rerun the prefetch rule +* Add `fetchGitHubRelease'` to `PackageSet` +* Add `GetGitCommitDate` rule +* Add `--keyfile` to pass [nvchecker keyfile](https://nvchecker.readthedocs.io/en/latest/usage.html#configuration-table) +* Remove IFD from extracing sources + ## 0.5.0.0 There have been many significant changes since the last release. diff --git a/flake.lock b/flake.lock index 964b3c6..0c55db4 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "lastModified": 1668681692, + "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", "owner": "edolstra", "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "rev": "009399224d5e398d03b22badca40a37ac85412a1", "type": "github" }, "original": { @@ -18,11 +18,11 @@ }, "flake-utils": { "locked": { - "lastModified": 1667077288, - "narHash": "sha256-bdC8sFNDpT0HK74u9fUkpbf1MEzVYJ+ka7NXCdgBoaA=", + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "owner": "numtide", "repo": "flake-utils", - "rev": "6ee9ebb6b1ee695d2cacc4faa053a7b9baa76817", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "type": "github" }, "original": { @@ -33,11 +33,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1667050928, - "narHash": "sha256-xOn0ZgjImIyeecEsrjxuvlW7IW5genTwvvnDQRFncB8=", + "lastModified": 1672791794, + "narHash": "sha256-mqGPpGmwap0Wfsf3o2b6qHJW1w2kk/I6cGCGIU+3t6o=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fdebb81f45a1ba2c4afca5fd9f526e1653ad0949", + "rev": "9813adc7f7c0edd738c6bdd8431439688bb0cb3d", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 28c068e..fc62bce 100644 --- a/flake.nix +++ b/flake.nix @@ -7,17 +7,16 @@ }; outputs = { self, nixpkgs, flake-utils, flake-compat, ... }: with flake-utils.lib; - # FIXME: ghc currently doesn't build on aarch64-darwin - eachSystem (nixpkgs.lib.remove "aarch64-darwin" defaultSystems) (system: + eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; - overlays = [ self.overlay ]; + overlays = [ self.overlays.default ]; config = { allowBroken = true; }; }; in with pkgs; rec { - defaultPackage = nvfetcher-bin; - devShell = with haskell.lib; + packages.default = nvfetcher-bin; + devShells.default = with haskell.lib; (addBuildTools (haskellPackages.nvfetcher) [ haskell-language-server cabal-install @@ -41,26 +40,32 @@ }; hydraJobs = { inherit packages; }; }) // { - overlay = final: prev: { - + overlays.default = final: prev: { haskellPackages = prev.haskellPackages.override (old: { - overrides = final.lib.composeExtensions (old.overrides or (_: _: {})) (hself: hsuper: { - nvfetcher = with final.haskell.lib; - generateOptparseApplicativeCompletion "nvfetcher" - (overrideCabal (prev.haskellPackages.callPackage ./nix { }) - (drv: { - # test needs network - doCheck = false; - buildTools = drv.buildTools or [ ] ++ [ final.makeWrapper ]; - postInstall = with final; - drv.postInstall or "" + '' - wrapProgram $out/bin/nvfetcher \ - --prefix PATH ":" "${ - lib.makeBinPath [ nvchecker nix-prefetch nix-prefetch-docker ] - }" - ''; - })); - }); + overrides = + final.lib.composeExtensions (old.overrides or (_: _: { })) + (hself: hsuper: { + nvfetcher = with final.haskell.lib; + hself.generateOptparseApplicativeCompletions [ "nvfetcher" ] + (overrideCabal (prev.haskellPackages.callPackage ./nix { }) + (drv: { + # test needs network + doCheck = false; + buildTools = drv.buildTools or [ ] + ++ [ final.makeWrapper ]; + postInstall = with final; + drv.postInstall or "" + '' + wrapProgram $out/bin/nvfetcher \ + --prefix PATH ":" "${ + lib.makeBinPath [ + nvchecker + nix-prefetch + nix-prefetch-docker + ] + }" + ''; + })); + }); }); nvfetcher-bin = with final; haskell.lib.justStaticExecutables haskellPackages.nvfetcher; diff --git a/nix/default.nix b/nix/default.nix index 95d492a..9ce87be 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -7,7 +7,7 @@ }: mkDerivation { pname = "nvfetcher"; - version = "0.5.0.0"; + version = "0.6.0.0"; src = ../.; isLibrary = true; isExecutable = true; @@ -34,4 +34,5 @@ mkDerivation { homepage = "https://github.com/berberman/nvfetcher"; description = "Generate nix sources expr for the latest version of packages"; license = lib.licenses.mit; + mainProgram = "nvfetcher"; } diff --git a/nvfetcher.cabal b/nvfetcher.cabal index 9db415b..1074676 100644 --- a/nvfetcher.cabal +++ b/nvfetcher.cabal @@ -1,6 +1,6 @@ cabal-version: 2.4 name: nvfetcher -version: 0.5.0.0 +version: 0.6.0.0 synopsis: Generate nix sources expr for the latest version of packages @@ -13,7 +13,7 @@ license: MIT license-file: LICENSE author: berberman maintainer: berberman -copyright: 2021-2022 berberman +copyright: 2021-2023 berberman category: Nix build-type: Simple extra-doc-files: diff --git a/test/PrefetchSpec.hs b/test/PrefetchSpec.hs index 7b0f900..41b8541 100644 --- a/test/PrefetchSpec.hs +++ b/test/PrefetchSpec.hs @@ -41,7 +41,7 @@ spec = aroundShake $ runPrefetchRule' (_sha256 &&& _imageDigest) testDockerFetcher `shouldReturnJust` ( Checksum "1ly61z3bcs5qvqi2xxp3dd3llh61r9gygphl1ib8pxv64ix738mr", - ContainerDigest "sha256:bc41182d7ef5ffc53a40b044e725193bc10142a1243f395ee852a8d9730fc2ad" + ContainerDigest "sha256:65a2763f593ae85fab3b5406dc9e80f744ec5b449f269b699b5efd37a07ad32e" ) testDockerFetcher :: NixFetcher Fresh