Skip to content

Commit

Permalink
refactor(nix): further simplified flake
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastián Estrella <[email protected]>
  • Loading branch information
DavidMazarro and sestrella committed Oct 1, 2024
1 parent dcdfc8e commit a5047a8
Showing 1 changed file with 24 additions and 31 deletions.
55 changes: 24 additions & 31 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,37 @@
# https://input-output-hk.github.io/haskell.nix/tutorials/getting-started-flakes.html
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
inherit (haskellNix) config;
overlays = [
haskellNix.overlay
(final: prev: {
hapistrano-ghc966 = final.haskell-nix.cabalProject' {
src = final.haskell-nix.haskellLib.cleanGit {
name = "hapistrano";
src = ./.;
};
# This is used by `nix develop .` to open a shell for use with
# `cabal`, `hlint` and `haskell-language-server`
shell.tools = {
cabal = {};
hlint = {};
haskell-language-server = {};
};
compiler-nix-name = "ghc966";
overlays = [
haskellNix.overlay
(final: prev: {
hapistrano = final.haskell-nix.cabalProject' {
src = final.haskell-nix.haskellLib.cleanGit {
name = "hapistrano";
src = ./.;
};
})
];
};
flake-ghc966 = pkgs.hapistrano-ghc966.flake { };
# This is used by `nix develop .` to open a shell for use with
# `cabal`, `hlint` and `haskell-language-server`
shell.tools = {
cabal = {};
hlint = {};
haskell-language-server = {};
};
compiler-nix-name = "ghc966";
};
})
];
pkgs = import nixpkgs { inherit system overlays; inherit (haskellNix) config; };
flake = pkgs.hapistrano.flake { };
in rec {
apps = {
test-ghc966 = {
test = {
type = "app";
program = "${packages.test-ghc966}/bin/test";
program = "${packages.test}/bin/test";
};
};
packages = {
default = flake-ghc966.packages."hapistrano:exe:hap";
test-ghc966 = flake-ghc966.packages."hapistrano:test:test".overrideAttrs (_: {
default = flake.packages."hapistrano:exe:hap";
test = flake.packages."hapistrano:test:test".overrideAttrs (_: {
postFixup = ''
wrapProgram $out/bin/test \
--set PATH ${pkgs.lib.makeBinPath [
Expand All @@ -67,9 +64,5 @@
'';
});
};
devShells = {
default = devShells.ghc966;
ghc966 = flake-ghc966.devShells.default;
};
});
}

0 comments on commit a5047a8

Please sign in to comment.