summaryrefslogtreecommitdiff
path: root/Biz/Bild.nix
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2024-05-03 22:34:10 -0400
committerBen Sima <ben@bsima.me>2024-05-09 21:38:52 -0400
commitd71c6f8c5955e8a9861e3f3957b293a369aac954 (patch)
treeda77bbbec8e082a77c0d553cf2216dce9b4ced0b /Biz/Bild.nix
parentd36b4360c9c359e6eea480b39e9699b1deae70f1 (diff)
Switch to nixpkgs-23.11, ghc 9.6.3
This brings a bunch of improvements. I got rid of some custom packages, I can now build exllama without using a non-default cuda version. Oh yeah and I get to use GHC 9.6.2 now, a huge upgrade from 9.4. Unfortunately I also updated ormolu and some unrelated formatting changed, but that's life I guess.
Diffstat (limited to 'Biz/Bild.nix')
-rw-r--r--Biz/Bild.nix34
1 files changed, 18 insertions, 16 deletions
diff --git a/Biz/Bild.nix b/Biz/Bild.nix
index c92f749..c6e2f27 100644
--- a/Biz/Bild.nix
+++ b/Biz/Bild.nix
@@ -5,15 +5,12 @@ let
# expose some attrs from stable, keep this minimal and simple
stable = {
- inherit (nixpkgs.nixos-23_05)
- sources lib makeWrapper ccacheStdenv haskellPackages haskell
- lispPackages_new python3 nixos mkShell dockerTools;
- stdenv = nixpkgs.nixos-23_05.ccacheStdenv;
+ inherit (nixpkgs.nixos-23_11)
+ sources lib makeWrapper ccacheStdenv haskell lispPackages_new python3
+ nixos mkShell dockerTools pkgs;
+ stdenv = nixpkgs.nixos-23_11.ccacheStdenv;
};
- # for exposing packages as bild.pkgs
- stable-pkgs = nixpkgs.nixos-23_05.pkgs;
-
# this is the main library definitions, recursive references can be made with
# `self.thing`, like in Python objects
self = {
@@ -25,9 +22,12 @@ let
haskell = rec {
inherit (constants) ghcCompiler;
+ ghcVersion = ghcPackageSetFull.version;
+
# all available packages
deps = import ./Bild/Deps/Haskell.nix;
- packages = self.lib.attrsets.getAttrs self.deps stable.haskellPackages;
+ packages = self.lib.attrsets.getAttrs self.haskell.deps
+ stable.haskell.packages."${constants.ghcCompiler}";
# make a ghc with dependencies
ghcWith = stable.haskell.packages.${ghcCompiler}.ghcWithHoogle;
@@ -72,14 +72,15 @@ let
# c packages are just stable, filtered to just the list of deps i want
c.packages =
- self.lib.attrsets.getAttrs (import ./Bild/Deps/C.nix) stable-pkgs;
+ self.lib.attrsets.getAttrs (import ./Bild/Deps/C.nix) stable.pkgs;
# exposed packages for inclusion in builds
- pkgs = with stable-pkgs; {
+ pkgs = with stable.pkgs; {
inherit bat bc cmark ctags deadnix fd figlet fzf git git-branchless
gitlint guile hlint indent jq lolcat mypy nixfmt ormolu pkg-config
- ripgrep rustc shellcheck tree wemux;
+ ripgrep rustc tree wemux;
ruff = nixpkgs.nixos-unstable-small.ruff;
+ shellcheck = nixpkgs.nixos-unstable-small.shellcheck;
};
# a standard nix build for bild, for bootstrapping. this should be the only
@@ -101,11 +102,12 @@ let
(p: with p; [ asdf alexandria ])) # just enough to build Example.lisp
];
strictDeps = true;
+ ghcVersion = self.haskell.ghcVersion;
buildPhase = ''
- mkdir -p $out/bin $out/lib/ghc-${self.haskell.ghcPackageSetFull.version}
+ mkdir -p $out/bin $out/lib/ghc-$ghcVersion
cp -r \
- ${self.haskell.ghcPackageSetFull}/lib/ghc-${self.haskell.ghcPackageSetFull.version}/package.conf.d \
- $out/lib/ghc-${self.haskell.ghcPackageSetFull.version}
+ ${self.haskell.ghcPackageSetFull}/lib/ghc-$ghcVersion/package.conf.d \
+ $out/lib/ghc-$ghcVersion
ghc \
-threaded \
-Werror \
@@ -123,7 +125,7 @@ let
]
} \
--set GHC_PACKAGE_PATH \
- $out/lib/ghc-${self.haskell.ghcPackageSetFull.version}/package.conf.d
+ $out/lib/ghc-$ghcVersion/package.conf.d
'';
};
@@ -184,7 +186,7 @@ let
wemux
];
shellHook = ''
- export GHC_PACKAGE_PATH=${self.bild}/lib/ghc-${self.haskell.ghcPackageSetFull.version}/package.conf.d
+ export GHC_PACKAGE_PATH=${self.bild}/lib/ghc-${self.haskell.ghcVersion}/package.conf.d
'';
};