diff --git a/language-tools/haskell/flake.nix b/language-tools/haskell/flake.nix index 16d56c7c..fc0da557 100644 --- a/language-tools/haskell/flake.nix +++ b/language-tools/haskell/flake.nix @@ -1,7 +1,7 @@ { inputs.flakes.url = "github:deemp/flakes"; outputs = inputs: inputs.flakes.makeFlake { - inputs = { inherit (inputs.flakes.all) nixpkgs; }; + inputs = { inherit (inputs.flakes.all) nixpkgs drv-tools; }; perSystem = { inputs, system }: let pkgs = inputs.nixpkgs.legacyPackages.${system}; @@ -9,15 +9,15 @@ inherit (pkgs.lib.lists) genAttrs; inherit (pkgs.lib.strings) concatMapStringsSep; inherit (pkgs.lib.attrsets) recursiveUpdate; - concatMapStringsNewline = concatMapStringsSep "\n"; - genAttrsId = list: genAttrs list (x: x); - withAttrs = recursiveUpdate; + inherit (inputs.drv-tools.lib.${system}) withMeta concatMapStringsNewline genAttrsId withAttrs getExe; # `GHC` of a specific version # With haskell packages that are dependencies of the given packages ghcGHC = ghcVersion: override: packages: - ((haskellPackagesGHCOverride ghcVersion override).ghcWithPackages - (ps: getHaskellPackagesDeps (packages ps))) // { pname = "ghc"; }; + withMeta + ((haskellPackagesGHCOverride ghcVersion override).ghcWithPackages + (ps: getHaskellPackagesDeps (packages ps)) // { pname = "ghc"; }) + (_: { mainProgram = "ghc"; }); # build tool with `GHC` of a specific version available on PATH buildToolWithFlagsGHC = { name, drv, flags, ghcVersion, override, packages, runtimeDependencies }: @@ -85,7 +85,7 @@ # package that contains an executable package , # name of the executable - executableName ? package.pname + executableName ? builtins.baseNameOf (getExe package) , # new name of the executable binaryName ? executableName , # runtime dependencies of the executable @@ -145,7 +145,7 @@ inherit (haskellPackagesGHC version) callCabal2nix; implicit-hie = pkgs.haskellPackages.implicit-hie_0_1_4_0; - fourmolu = pkgs.haskellPackages.fourmolu_0_13_0_0; + fourmolu = pkgs.haskellPackages.fourmolu; inherit (pkgs) ghcid hpack; haskellPackages = haskellPackagesGHCOverride version override; @@ -187,7 +187,7 @@ runtimeDependencies = [ pkgs.hello ]; }; - ghcVersion_ = "945"; + ghcVersion_ = "948"; executableName = "hello-world"; binaryName = "hello"; test = @@ -201,7 +201,7 @@ }; in { - inherit (tools) cabal stack hls ghc implicit-hie ghcid hpack haskellPackages; + inherit (tools) cabal stack hls ghc implicit-hie ghcid hpack haskellPackages fourmolu; inherit hello-world; deps = "${packageName}".getCabalDeps; }; @@ -222,7 +222,7 @@ ${test.${packageName}}/bin/${binaryName} ''; buildInputs = __attrValues { - inherit (test) cabal stack hls ghc implicit-hie ghcid hpack; + inherit (test) cabal stack hls ghc implicit-hie ghcid hpack fourmolu; }; }; }; diff --git a/language-tools/haskell/stack.yaml b/language-tools/haskell/stack.yaml index 9600eead..7ef7fc34 100644 --- a/language-tools/haskell/stack.yaml +++ b/language-tools/haskell/stack.yaml @@ -1 +1 @@ -resolver: nightly-2023-06-10 \ No newline at end of file +resolver: lts-21.24 \ No newline at end of file diff --git a/language-tools/haskell/stack.yaml.lock b/language-tools/haskell/stack.yaml.lock index 3ed11e05..ae6c0c5b 100644 --- a/language-tools/haskell/stack.yaml.lock +++ b/language-tools/haskell/stack.yaml.lock @@ -6,7 +6,7 @@ packages: [] snapshots: - completed: - sha256: e0e80195c91d8d8daefd1ef71cf470b0e59124f98abe946a2390bbf88a410a46 - size: 632966 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2023/6/10.yaml - original: nightly-2023-06-10 + sha256: abcc4a65c15c7c2313f1a87f01bfd4d910516e1930b99653eef1d2d006515916 + size: 640074 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/24.yaml + original: lts-21.24