Skip to content

Commit

Permalink
chore: Let shell.nix depend on nix flake
Browse files Browse the repository at this point in the history
It's usually better to have one source of truth (regarding package
sources/versions) than two. So, use the compatibility mixin for those
who want to keep using shell.nix.

GHC 9.2 is not supported anymore ("end of life".) Thus, we don't need
overrides for it.
  • Loading branch information
supersven authored and blackheaven committed Oct 19, 2024
1 parent 76a27a4 commit 0ee5afe
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
15 changes: 15 additions & 0 deletions flake.lock

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

1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
};

outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
Expand Down
27 changes: 10 additions & 17 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
let
# cure = x: pkgs.haskell.lib.dontCheck (pkgs.haskell.lib.doJailbreak x);
haskellOverlay = self: super: {
haskellPackages = super.haskell.packages.ghc922.override {
overrides = hself: hsuper: rec {
ghc-lib-parser = hsuper.ghc-lib-parser_9_2_2_20220307;
};
};
};
in
{ pkgs ? import <nixpkgs> { overlays = [ haskellOverlay ]; } }:

pkgs.mkShell {
buildInputs = [
pkgs.haskellPackages.ormolu_0_5_0_0
];
}
(import
(
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
fetchTarball {
url = lock.nodes.flake-compat.locked.url or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{ src = ./.; }
).shellNix

0 comments on commit 0ee5afe

Please sign in to comment.