Skip to content

Commit

Permalink
Use short compiler-nix-names
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed Sep 28, 2023
1 parent cedfae2 commit 1a77851
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 27 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ jobs:
- ghc8107
- ghc928
- ghc962
# TODO find a nice way to avoid manually updating these
- ghc98020230824
- ghc9920230923
- ghc980
- ghc99
target-platform:
- ""
- "-static"
Expand Down
4 changes: 2 additions & 2 deletions cross-js.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ pkgs.mkShell ({
(tool "alex")
stdenv.cc.cc.lib ]) ++ (with pkgs.buildPackages; [
])
++ pkgs.lib.optional (withHLS) (tool "haskell-language-server")
++ pkgs.lib.optional (withHlint && (compiler-not-in ["ghc961" "ghc962"] "HLint")) (tool "hlint")
++ pkgs.lib.optional (withHLS && (compiler-not-in (["ghc980" "ghc99"] ++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "Haskell Language Server")) (tool "haskell-language-server")
++ pkgs.lib.optional (withHlint && (compiler-not-in (["ghc961" "ghc962" "ghc980" "ghc99"] ++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "HLint")) (tool "hlint")
++ pkgs.lib.optional withIOG
(with pkgs; [ cddl cbor-diag ]
++ map pkgs.lib.getDev (with pkgs; [
Expand Down
4 changes: 2 additions & 2 deletions cross-windows.nix
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ pkgs.pkgsBuildBuild.mkShell ({
(pkgsBuildBuild.haskell-nix.tool compiler-nix-name "happy" "1.20.1.1")
(pkgsBuildBuild.haskell-nix.tool compiler-nix-name "alex" "3.2.7.3")
stdenv.cc.cc.lib ])
++ pkgs.lib.optional (withHLS && (compiler-not-in (pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "Haskell Language Server")) (tool "haskell-language-server")
++ pkgs.lib.optional (withHlint && (compiler-not-in (["ghc961" "ghc962"] ++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "HLint")) (tool "hlint")
++ pkgs.lib.optional (withHLS && (compiler-not-in (["ghc980" "ghc99"] ++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "Haskell Language Server")) (tool "haskell-language-server")
++ pkgs.lib.optional (withHlint && (compiler-not-in (["ghc961" "ghc962" "ghc980" "ghc99"] ++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "HLint")) (tool "hlint")
++ pkgs.lib.optional withIOG
(with pkgs.pkgsBuildBuild; [ cddl cbor-diag ]
++ map pkgs.lib.getDev (with pkgs; [
Expand Down
4 changes: 2 additions & 2 deletions dynamic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ pkgs.mkShell {
]
++ pkgs.lib.optional pkgs.stdenv.hostPlatform.isLinux systemd
)
++ pkgs.lib.optional (withHLS && (compiler-not-in (pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "Haskell Language Server")) (tool "haskell-language-server")
++ pkgs.lib.optional (withHlint && (compiler-not-in (["ghc961" "ghc962"] ++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "HLint")) (tool "hlint")
++ pkgs.lib.optional (withHLS && (compiler-not-in (["ghc980" "ghc99"] ++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "Haskell Language Server")) (tool "haskell-language-server")
++ pkgs.lib.optional (withHlint && (compiler-not-in (["ghc961" "ghc962" "ghc980" "ghc99"] ++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "HLint")) (tool "hlint")
++ pkgs.lib.optional withIOG
(with pkgs; [
cddl
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 12 additions & 13 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,18 @@
js-pkgs = pkgs.pkgsCross.ghcjs;
windows-pkgs = pkgs.pkgsCross.mingwW64;
devShellsWithToolsModule = toolsModule:
let compilers = pkgs: builtins.removeAttrs pkgs.haskell-nix.compiler
# Exclude old versions of GHC to speed up `nix flake check`
[ "ghc844"
"ghc861" "ghc862" "ghc863" "ghc864" "ghc865"
"ghc881" "ghc882" "ghc883" "ghc884"
"ghc8101" "ghc8102" "ghc8103" "ghc8104" "ghc8105" "ghc8106" "ghc810420210212"
"ghc901"
"ghc921" "ghc922" "ghc923" "ghc924" "ghc925" "ghc926" "ghc927"
"ghc941" "ghc942" "ghc943" "ghc944" "ghc945" "ghc946"
"ghc96020230302"
"ghc961"
"ghc9820230704"
];
# Map the compiler-nix-name to a final compiler-nix-name the way haskell.nix
# projects do (that way we can use short names)
let compilers = pkgs: pkgs.lib.genAttrs [
"ghc8107"
"ghc902"
"ghc928"
"ghc947"
"ghc962"
"ghc980"
"ghc99"] (compiler-nix-name:
pkgs.haskell-nix.compiler.${
(pkgs.haskell-nix.cabalProject' { inherit compiler-nix-name; }).args.compiler-nix-name});
js-compilers = pkgs: builtins.removeAttrs (compilers pkgs)
[
"ghc902"
Expand Down
4 changes: 2 additions & 2 deletions static.nix
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ pkgs.mkShell (rec {
(pkgs.pkg-config or pkgconfig)
stdenv.cc.cc.lib ]) ++ (with pkgs.buildPackages; [
])
++ pkgs.lib.optional (withHLS && (compiler-not-in (pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "Haskell Language Server")) (tool "haskell-language-server")
++ pkgs.lib.optional (withHlint && (compiler-not-in (["ghc961" "ghc962"] ++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "HLint")) (tool "hlint")
++ pkgs.lib.optional (withHLS && (compiler-not-in (["ghc980" "ghc99"] ++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "Haskell Language Server")) (tool "haskell-language-server")
++ pkgs.lib.optional (withHlint && (compiler-not-in (["ghc961" "ghc962" "ghc980" "ghc99"] ++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "HLint")) (tool "hlint")
++ pkgs.lib.optional withIOG (with pkgs; [ cddl cbor-diag ])
;
})

0 comments on commit 1a77851

Please sign in to comment.