From e30cf42f0cd541763671baf57d084d89face9463 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Tue, 4 May 2021 12:54:16 +0200 Subject: [PATCH 1/2] haskellPackages.cabal2nix-latest: use unstable-YYYY-MM-DD format This is the preferred format for things fetched from git or similar that are not proper releases: https://nixos.org/manual/nixpkgs/stable/#sec-package-naming Also we should think about making name and attribute name more consistent: cabal2nix-latest -> cabal2nix-unstable --- maintainers/scripts/haskell/update-cabal2nix-latest.sh | 2 +- pkgs/development/haskell-modules/cabal2nix-latest.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/maintainers/scripts/haskell/update-cabal2nix-latest.sh b/maintainers/scripts/haskell/update-cabal2nix-latest.sh index 1f22bb1792f8..e8018e1384d8 100755 --- a/maintainers/scripts/haskell/update-cabal2nix-latest.sh +++ b/maintainers/scripts/haskell/update-cabal2nix-latest.sh @@ -14,4 +14,4 @@ commit="$(jq -r .commit.sha <<< "$head_info")" date="$(date "--date=$(jq -r .commit.commit.committer.date <<< "$head_info")" +%F)" # generate nix expression from cabal file, replacing the version with the commit date echo '# This file defines cabal2nix-latest, used by maintainers/scripts/haskell/regenerate-hackage-packages.sh.' > pkgs/development/haskell-modules/cabal2nix-latest.nix -cabal2nix "https://github.com/NixOS/cabal2nix/archive/$commit.tar.gz" | sed -e 's/version = ".*"/version = "'"$date"'"/' >> pkgs/development/haskell-modules/cabal2nix-latest.nix +cabal2nix "https://github.com/NixOS/cabal2nix/archive/$commit.tar.gz" | sed -e 's/version = ".*"/version = "'"unstable-$date"'"/' >> pkgs/development/haskell-modules/cabal2nix-latest.nix diff --git a/pkgs/development/haskell-modules/cabal2nix-latest.nix b/pkgs/development/haskell-modules/cabal2nix-latest.nix index 75c9de963a07..a8b37e4e46e1 100644 --- a/pkgs/development/haskell-modules/cabal2nix-latest.nix +++ b/pkgs/development/haskell-modules/cabal2nix-latest.nix @@ -8,7 +8,7 @@ }: mkDerivation { pname = "cabal2nix"; - version = "2021-05-01"; + version = "unstable-2021-05-01"; src = fetchzip { url = "https://github.com/NixOS/cabal2nix/archive/849a3507c849e3e2331efbc5ebe391b70a215ddc.tar.gz"; sha256 = "0g91d2bd72l3kkykc47a2raymvgw6427n7cg9ayzvrpldkd0silc"; From 794bc5e9ed7ebb17822b510f24dcc607e727484d Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Tue, 4 May 2021 13:38:29 +0200 Subject: [PATCH 2/2] haskellPackages.cabal2nix-unstable: rename from cabal2nix-latest --- .../scripts/haskell/regenerate-hackage-packages.sh | 4 ++-- ...e-cabal2nix-latest.sh => update-cabal2nix-unstable.sh} | 8 ++++---- .../{cabal2nix-latest.nix => cabal2nix-unstable.nix} | 2 +- pkgs/development/haskell-modules/configuration-common.nix | 4 ++-- pkgs/development/haskell-modules/non-hackage-packages.nix | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) rename maintainers/scripts/haskell/{update-cabal2nix-latest.sh => update-cabal2nix-unstable.sh} (68%) rename pkgs/development/haskell-modules/{cabal2nix-latest.nix => cabal2nix-unstable.nix} (93%) diff --git a/maintainers/scripts/haskell/regenerate-hackage-packages.sh b/maintainers/scripts/haskell/regenerate-hackage-packages.sh index 2408d893dae1..a56d8a0a0e2d 100755 --- a/maintainers/scripts/haskell/regenerate-hackage-packages.sh +++ b/maintainers/scripts/haskell/regenerate-hackage-packages.sh @@ -1,5 +1,5 @@ #! /usr/bin/env nix-shell -#! nix-shell -i bash -p coreutils haskellPackages.cabal2nix-latest -I nixpkgs=. +#! nix-shell -i bash -p coreutils haskellPackages.cabal2nix-unstable -I nixpkgs=. # This script is used to regenerate nixpkgs' Haskell package set, using a tool # called hackage2nix. hackage2nix looks at @@ -9,7 +9,7 @@ # companion tool cabal2nix. # # Related scripts are update-hackage.sh, for updating the snapshot of the -# Hackage database used by hackage2nix, and update-cabal2nix-latest.sh, +# Hackage database used by hackage2nix, and update-cabal2nix-unstable.sh, # for updating the version of hackage2nix used to perform this task. set -euo pipefail diff --git a/maintainers/scripts/haskell/update-cabal2nix-latest.sh b/maintainers/scripts/haskell/update-cabal2nix-unstable.sh similarity index 68% rename from maintainers/scripts/haskell/update-cabal2nix-latest.sh rename to maintainers/scripts/haskell/update-cabal2nix-unstable.sh index e8018e1384d8..415837045602 100755 --- a/maintainers/scripts/haskell/update-cabal2nix-latest.sh +++ b/maintainers/scripts/haskell/update-cabal2nix-unstable.sh @@ -1,7 +1,7 @@ #! /usr/bin/env nix-shell -#! nix-shell -i bash -p coreutils curl jq gnused haskellPackages.cabal2nix-latest -I nixpkgs=. +#! nix-shell -i bash -p coreutils curl jq gnused haskellPackages.cabal2nix-unstable -I nixpkgs=. -# Updates cabal2nix-latest to the latest master of the nixos/cabal2nix repository. +# Updates cabal2nix-unstable to the latest master of the nixos/cabal2nix repository. # See regenerate-hackage-packages.sh for details on the purpose of this script. set -euo pipefail @@ -13,5 +13,5 @@ commit="$(jq -r .commit.sha <<< "$head_info")" # extract commit timestamp and convert to date date="$(date "--date=$(jq -r .commit.commit.committer.date <<< "$head_info")" +%F)" # generate nix expression from cabal file, replacing the version with the commit date -echo '# This file defines cabal2nix-latest, used by maintainers/scripts/haskell/regenerate-hackage-packages.sh.' > pkgs/development/haskell-modules/cabal2nix-latest.nix -cabal2nix "https://github.com/NixOS/cabal2nix/archive/$commit.tar.gz" | sed -e 's/version = ".*"/version = "'"unstable-$date"'"/' >> pkgs/development/haskell-modules/cabal2nix-latest.nix +echo '# This file defines cabal2nix-unstable, used by maintainers/scripts/haskell/regenerate-hackage-packages.sh.' > pkgs/development/haskell-modules/cabal2nix-unstable.nix +cabal2nix "https://github.com/NixOS/cabal2nix/archive/$commit.tar.gz" | sed -e 's/version = ".*"/version = "'"unstable-$date"'"/' >> pkgs/development/haskell-modules/cabal2nix-unstable.nix diff --git a/pkgs/development/haskell-modules/cabal2nix-latest.nix b/pkgs/development/haskell-modules/cabal2nix-unstable.nix similarity index 93% rename from pkgs/development/haskell-modules/cabal2nix-latest.nix rename to pkgs/development/haskell-modules/cabal2nix-unstable.nix index a8b37e4e46e1..3b8a85881f52 100644 --- a/pkgs/development/haskell-modules/cabal2nix-latest.nix +++ b/pkgs/development/haskell-modules/cabal2nix-unstable.nix @@ -1,4 +1,4 @@ -# This file defines cabal2nix-latest, used by maintainers/scripts/haskell/regenerate-hackage-packages.sh. +# This file defines cabal2nix-unstable, used by maintainers/scripts/haskell/regenerate-hackage-packages.sh. { mkDerivation, aeson, ansi-wl-pprint, base, bytestring, Cabal , containers, deepseq, directory, distribution-nixpkgs, fetchzip , filepath, hackage-db, hopenssl, hpack, language-nix, lens, lib diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 8b2151e995b0..baa65bb21811 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -1793,8 +1793,8 @@ self: super: { # https://github.com/obsidiansystems/database-id/issues/1 database-id-class = doJailbreak super.database-id-class; - cabal2nix-latest = overrideCabal super.cabal2nix-latest { - passthru.updateScript = ../../../maintainers/scripts/haskell/update-cabal2nix-latest.sh; + cabal2nix-unstable = overrideCabal super.cabal2nix-unstable { + passthru.updateScript = ../../../maintainers/scripts/haskell/update-cabal2nix-unstable.sh; }; # Too strict version bounds on base and optparse-applicative diff --git a/pkgs/development/haskell-modules/non-hackage-packages.nix b/pkgs/development/haskell-modules/non-hackage-packages.nix index 7c3c43fd9dc4..1882d68f2343 100644 --- a/pkgs/development/haskell-modules/non-hackage-packages.nix +++ b/pkgs/development/haskell-modules/non-hackage-packages.nix @@ -13,7 +13,7 @@ self: super: { # Used by maintainers/scripts/regenerate-hackage-packages.sh, and generated # from the latest master instead of the current version on Hackage. - cabal2nix-latest = self.callPackage ./cabal2nix-latest.nix { }; + cabal2nix-unstable = self.callPackage ./cabal2nix-unstable.nix { }; # https://github.com/channable/vaultenv/issues/1 vaultenv = self.callPackage ../tools/haskell/vaultenv { };