Skip to content

Commit

Permalink
fixup! Flake-ify dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
magthe committed Aug 2, 2023
1 parent cacd945 commit 7a69149
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

outputs = { self, nixpkgs }:
with nixpkgs.legacyPackages.x86_64-linux;
with builtins;
let
hl = haskell.lib;
hsPkgs = haskell.packages.ghc94;
Expand All @@ -14,6 +15,15 @@
};
};

hsDevToolFn = p:
with p;
if getEnv "NIX_BUILD_SHELL" == "" then [
cabal-fmt
haskell-language-server
hlint
] else
[ ];

hsPkgsFn = p:
with p; [
cmdargs
Expand All @@ -25,13 +35,8 @@
];
in {
devShell.x86_64-linux = mkShell {
buildInputs = with extraHsPkgs; [
(ghcWithPackages hsPkgsFn)
cabal-fmt
cabal-install
haskell-language-server
hlint
];
buildInputs = [ (extraHsPkgs.ghcWithPackages hsPkgsFn) cabal-install ]
++ hsDevToolFn extraHsPkgs;
};
};
}

0 comments on commit 7a69149

Please sign in to comment.