summaryrefslogtreecommitdiff
path: root/Biz/Bild.nix
diff options
context:
space:
mode:
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
'';
};