about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2023-11-19 12:18:52 +0100
committerRobert Hensing <robert@roberthensing.nl>2023-11-19 12:44:18 +0100
commit2e1a0993183796f2beb47d413da25742c865a4b7 (patch)
treed47ae80ce2c9f377835abe0bb24588ad63808679
parente98183be079f66bc6e880465087741e2284561c0 (diff)
changelog-d: init
Move the overrides to top-level (pkgs/by-name).
-rw-r--r--pkgs/by-name/ch/changelog-d/package.nix62
-rw-r--r--pkgs/development/haskell-modules/non-hackage-packages.nix2
-rw-r--r--pkgs/development/misc/haskell/changelog-d/default.nix51
3 files changed, 63 insertions, 52 deletions
diff --git a/pkgs/by-name/ch/changelog-d/package.nix b/pkgs/by-name/ch/changelog-d/package.nix
new file mode 100644
index 0000000000000..770673714475e
--- /dev/null
+++ b/pkgs/by-name/ch/changelog-d/package.nix
@@ -0,0 +1,62 @@
+{
+  cabal2nix,
+  lib,
+  haskell,
+  haskellPackages,
+  runCommand,
+  writeShellApplication,
+}:
+
+let
+  hsPkg = haskellPackages.changelog-d;
+
+  haskellModifications = x: x;
+
+  mkDerivationOverrides = finalAttrs: oldAttrs: {
+
+    version = oldAttrs.version + "-git-${lib.strings.substring 0 7 oldAttrs.src.rev}";
+
+    passthru.updateScript = lib.getExe (writeShellApplication {
+      name = "update-changelog-d";
+      runtimeInputs = [
+        cabal2nix
+      ];
+      text = ''
+        cd pkgs/development/misc/haskell/changelog-d
+        cabal2nix https://codeberg.org/fgaz/changelog-d >changelog-d.nix
+      '';
+    });
+    passthru.tests = {
+      basic = runCommand "changelog-d-basic-test" {
+          nativeBuildInputs = [ finalAttrs.finalPackage ];
+        } ''
+          mkdir changelogs
+          cat > changelogs/config <<EOF
+          organization: NixOS
+          repository: boondoggle
+          EOF
+          cat > changelogs/a <<EOF
+          synopsis: Support numbers with incrementing base-10 digits
+          issues: #1234
+          description: {
+          This didn't work before.
+          }
+          EOF
+          changelog-d changelogs >$out
+          cat -n $out
+          echo Checking the generated output
+          set -x
+          grep -F 'Support numbers with incrementing base-10 digits' $out >/dev/null
+          grep -F 'https://github.com/NixOS/boondoggle/issues/1234' $out >/dev/null
+          set +x
+        '';
+    };
+
+    meta = oldAttrs.meta // {
+      homepage = "https://codeberg.org/fgaz/changelog-d";
+      maintainers = [ lib.maintainers.roberth ];
+    };
+
+  };
+in
+  (haskellModifications hsPkg).overrideAttrs mkDerivationOverrides
diff --git a/pkgs/development/haskell-modules/non-hackage-packages.nix b/pkgs/development/haskell-modules/non-hackage-packages.nix
index f78e333ae1d78..81dae23301d66 100644
--- a/pkgs/development/haskell-modules/non-hackage-packages.nix
+++ b/pkgs/development/haskell-modules/non-hackage-packages.nix
@@ -7,7 +7,7 @@
 # files.
 self: super: {
 
-  changelog-d = self.callPackage ../misc/haskell/changelog-d {};
+  changelog-d = self.callPackage ../misc/haskell/changelog-d/changelog-d.nix {};
 
   dconf2nix = self.callPackage ../tools/haskell/dconf2nix/dconf2nix.nix { };
 
diff --git a/pkgs/development/misc/haskell/changelog-d/default.nix b/pkgs/development/misc/haskell/changelog-d/default.nix
deleted file mode 100644
index e4ba565808cf6..0000000000000
--- a/pkgs/development/misc/haskell/changelog-d/default.nix
+++ /dev/null
@@ -1,51 +0,0 @@
-{ callPackage
-, lib
-, pkgs
-}:
-
-(callPackage ./changelog-d.nix { }).overrideAttrs (finalAttrs: oldAttrs: {
-
-  version = oldAttrs.version + "-git-${lib.strings.substring 0 7 oldAttrs.src.rev}";
-
-  passthru.updateScript = lib.getExe (pkgs.writeShellApplication {
-    name = "update-changelog-d";
-    runtimeInputs = [
-      pkgs.cabal2nix
-    ];
-    text = ''
-      cd pkgs/development/misc/haskell/changelog-d
-      cabal2nix https://codeberg.org/fgaz/changelog-d >changelog-d.nix
-    '';
-  });
-  passthru.tests = {
-    basic = pkgs.runCommand "changelog-d-basic-test" {
-        nativeBuildInputs = [ finalAttrs.finalPackage ];
-      } ''
-        mkdir changelogs
-        cat > changelogs/config <<EOF
-        organization: NixOS
-        repository: boondoggle
-        EOF
-        cat > changelogs/a <<EOF
-        synopsis: Support numbers with incrementing base-10 digits
-        issues: #1234
-        description: {
-        This didn't work before.
-        }
-        EOF
-        changelog-d changelogs >$out
-        cat -n $out
-        echo Checking the generated output
-        set -x
-        grep -F 'Support numbers with incrementing base-10 digits' $out >/dev/null
-        grep -F 'https://github.com/NixOS/boondoggle/issues/1234' $out >/dev/null
-        set +x
-      '';
-  };
-
-  meta = oldAttrs.meta // {
-    homepage = "https://codeberg.org/fgaz/changelog-d";
-    maintainers = [ lib.maintainers.roberth ];
-  };
-
-})