generated from srid/haskell-template
-
Notifications
You must be signed in to change notification settings - Fork 5
/
flake.nix
61 lines (60 loc) · 1.95 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
description = "tailwind-haskell's description";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils/v1.0.0";
};
outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs =
nixpkgs.legacyPackages.${system};
tailwindCss =
pkgs.nodePackages.tailwindcss.overrideAttrs (oa: {
plugins = [
pkgs.nodePackages."@tailwindcss/aspect-ratio"
pkgs.nodePackages."@tailwindcss/forms"
pkgs.nodePackages."@tailwindcss/language-server"
pkgs.nodePackages."@tailwindcss/line-clamp"
pkgs.nodePackages."@tailwindcss/typography"
];
});
project = returnShellEnv:
pkgs.haskellPackages.developPackage {
inherit returnShellEnv;
name = "tailwind-haskell";
root = ./.;
withHoogle = false;
modifier = drv:
pkgs.haskell.lib.addBuildTools drv
(with pkgs.haskellPackages; [
# Specify your build/dev dependencies here.
cabal-fmt
cabal-install
ghcid
haskell-language-server
ormolu
pkgs.nixpkgs-fmt
tailwindCss
]);
};
in
rec {
packages.tailwind = project false;
apps.default = {
type = "app";
program = pkgs.writeShellApplication
{
name = "tailwind-run.sh";
text = ''
set -xe
exec ${packages.tailwind}/bin/tailwind-run "$@"
'';
} + /bin/tailwind-run.sh;
};
# Used by `nix develop` (dev shell)
devShell = project true;
defaultPackage = packages.tailwind;
defaultApp = apps.default;
});
}