From a5c6e2d291afe795bd9651f5699732bd57de85c6 Mon Sep 17 00:00:00 2001 From: Arjun Kathuria Date: Fri, 28 Apr 2023 16:34:31 +0530 Subject: [PATCH 1/6] Adds new custom GHC-9.2.7 nix package set * Adds the custom package set for GHC-9.2.7 * This tracks specifically the `ghc927` haskell nix packages set. * This package set is meant to be used with the nammayatri set of projects. making ghc-9.2.7 and the accompanying package set the default going forward. * This is meant to upgrade the previous ghc810 package stack. --- nix/ghc927.nix | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 nix/ghc927.nix diff --git a/nix/ghc927.nix b/nix/ghc927.nix new file mode 100644 index 0000000..c82d8e8 --- /dev/null +++ b/nix/ghc927.nix @@ -0,0 +1,46 @@ +# To use this package set in your `haskell-flake` projects, set the +# `basePackages` option as follows: +# +# > basePackages = config.haskellProjects.ghc927.outputs.finalPackages; +# +{ self, lib, ... }: + +let + # A function that enables us to write `foo = [ dontCheck ]` instead of `foo = + # lib.pipe super.foo [ dontCheck ]` in haskell-flake's `overrides`. + compilePipe = f: self: super: + lib.mapAttrs + (name: value: + if lib.isList value then + lib.pipe super.${name} value + else + value + ) + (f self super); +in +{ + perSystem = { pkgs, lib, config, ... }: { + haskellProjects.ghc927 = { + # This is not a local project, so disable those options. + packages = { }; + devShell.enable = false; + autoWire = [ ]; + + # Uses GHC-9.2.7 package set as base + basePackages = pkgs.haskell.packages.ghc927; + + source-overrides = { + # Dependencies from Hackage + + }; + + overrides = compilePipe (self: super: with pkgs.haskell.lib.compose; { + binary-parsers = [ unmarkBroken doJailbreak ]; + mysql-haskell = [ doJailbreak ]; + prometheus-proc = [ unmarkBroken doJailbreak ]; + lrucaching = [ unmarkBroken doJailbreak ]; + wire-streams = [doJailbreak]; + }); + }; + }; +} From b07e2adfee3a05b8a51aef8b5207021523865105 Mon Sep 17 00:00:00 2001 From: Arjun Kathuria Date: Thu, 4 May 2023 19:13:11 +0530 Subject: [PATCH 2/6] Adds a comment wrt to the package-set version * Adds a comment w.r.t to the package-set version choice. * This was requested as a PR feedback, found here:- https://github.com/nammayatri/common/pull/5#discussion_r1183729847 --- nix/ghc927.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nix/ghc927.nix b/nix/ghc927.nix index c82d8e8..0049721 100644 --- a/nix/ghc927.nix +++ b/nix/ghc927.nix @@ -27,6 +27,13 @@ in autoWire = [ ]; # Uses GHC-9.2.7 package set as base + + # We use a versioned package-set instead of the more + # general `pkgs.haskellPackages` set in order to be + # more explicit about our intentions to use a + # specific GHC version and by extension the related + # packages versions that come with this snapshot + basePackages = pkgs.haskell.packages.ghc927; source-overrides = { From 5d41a4d322681b77eb2b677024cd849df17d23bf Mon Sep 17 00:00:00 2001 From: Arjun Kathuria Date: Wed, 7 Jun 2023 14:33:49 +0530 Subject: [PATCH 3/6] Make the newly added GHC-9.2.7 package set the default `basePackges` in nix/haskell/default.nix * Makes the newly added GHC-9.2.7 the default `basePackages` set in nix/haskell/default.nix file * This commit replaces the old gch810 set with the new ghc927 set. --- nix/haskell/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/haskell/default.nix b/nix/haskell/default.nix index c056fc2..7496da4 100644 --- a/nix/haskell/default.nix +++ b/nix/haskell/default.nix @@ -5,7 +5,7 @@ ./no-global-cache.nix ./devtools.nix ]; - basePackages = config.haskellProjects.ghc810.outputs.finalPackages; + basePackages = config.haskellProjects.ghc927.outputs.finalPackages; }; }; } From 7585ce37edd865a97ae956dd3cee3fe1cf2edbdf Mon Sep 17 00:00:00 2001 From: Arjun Kathuria Date: Wed, 7 Jun 2023 14:36:57 +0530 Subject: [PATCH 4/6] Replace ghc810 artifacts with ghc927 in the common flake/modules. * Replaces the old ghc810 artifacts and references in the codebase with the newer ghc927 ones, effectively replacing them. * "flake.nix" now exports `ghc927` instead of `ghc810` fields/attribute in flakeModules. * The older ghc810 references have been commented out across the codebase, to be deprecated and removed in the future. --- flake-module.nix | 3 ++- flake.nix | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/flake-module.nix b/flake-module.nix index bae299b..80d14ef 100644 --- a/flake-module.nix +++ b/flake-module.nix @@ -8,7 +8,8 @@ common: common.inputs.haskell-flake.flakeModule (import ./nix/treefmt.nix common) ./nix/haskell - ./nix/ghc810.nix + # ./nix/ghc810.nix + ./nix/ghc927.nix ./nix/pre-commit.nix ./nix/arion.nix common.inputs.cachix-push.flakeModule diff --git a/flake.nix b/flake.nix index 2c344d0..69ad617 100644 --- a/flake.nix +++ b/flake.nix @@ -20,7 +20,8 @@ outputs = inputs: { flakeModules = { default = import ./flake-module.nix { inherit inputs; }; - ghc810 = ./nix/ghc810.nix; + # ghc810 = ./nix/ghc810.nix; + ghc927 = ./nix/ghc927.nix; }; lib.mkFlake = args: mod: From 6c0c07436d94b5ff7d11dc8291b0cb9d9c5779c9 Mon Sep 17 00:00:00 2001 From: Arjun Kathuria Date: Wed, 7 Jun 2023 14:39:27 +0530 Subject: [PATCH 5/6] Updates Readme * Adds GHC-9.2.7 package set reference in `what's provided` section * Updates readme with 810 deprecation note --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e9bafb6..2311769 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,8 @@ Nix-based project configuration shared between nammayatri repositories - The common flakeModule provides: - treefmt-based autoformatters: ormolu, hlint, dhall-format, nixpkgs-fmt - Common Haskell configuration - - GHC 8.10 package set (matching LTS 16.31 in part) + - ~~GHC 8.10 package set (matching LTS 16.31 in part)~~ (DEPRECATED, file and references kept for posterity only) + - GHC 9.2.7 package set - Avoid global tool caches (`no-global-cache.nix`) - `mission-control` - `process-compose-flake` From 3a12f086b9523c5be28d1da0d4e587eb2759da38 Mon Sep 17 00:00:00 2001 From: Arjun Kathuria Date: Thu, 8 Jun 2023 12:45:27 +0530 Subject: [PATCH 6/6] Make the ghc-927 pacakge-set compatible with updated haskell-flake * Migrates the ghc-927 package set to work with the new updated haskell-flake 0.4.0 syntax * Deletes a now-redundant function in the ghc-927 package-set file --- nix/ghc927.nix | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/nix/ghc927.nix b/nix/ghc927.nix index 0049721..f8ebeab 100644 --- a/nix/ghc927.nix +++ b/nix/ghc927.nix @@ -3,26 +3,13 @@ # # > basePackages = config.haskellProjects.ghc927.outputs.finalPackages; # -{ self, lib, ... }: - -let - # A function that enables us to write `foo = [ dontCheck ]` instead of `foo = - # lib.pipe super.foo [ dontCheck ]` in haskell-flake's `overrides`. - compilePipe = f: self: super: - lib.mapAttrs - (name: value: - if lib.isList value then - lib.pipe super.${name} value - else - value - ) - (f self super); -in { perSystem = { pkgs, lib, config, ... }: { haskellProjects.ghc927 = { + projectFlakeName = "nammayatri:common"; + # This is not a local project, so disable those options. - packages = { }; + defaults.packages = {}; devShell.enable = false; autoWire = [ ]; @@ -36,18 +23,31 @@ in basePackages = pkgs.haskell.packages.ghc927; - source-overrides = { + packages = { # Dependencies from Hackage }; - overrides = compilePipe (self: super: with pkgs.haskell.lib.compose; { - binary-parsers = [ unmarkBroken doJailbreak ]; - mysql-haskell = [ doJailbreak ]; - prometheus-proc = [ unmarkBroken doJailbreak ]; - lrucaching = [ unmarkBroken doJailbreak ]; - wire-streams = [doJailbreak]; - }); + settings = { + binary-parsers = { + broken = false; + jailbreak = true; + }; + mysql-haskell = { + jailbreak = true; + }; + prometheus-proc = { + broken = false; + jailbreak = true; + }; + lrucaching = { + broken = false; + jailbreak = true; + }; + wire-streams = { + jailbreak = true; + }; + }; }; }; }