-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
98 lines (94 loc) · 3.81 KB
/
flake.nix
File metadata and controls
98 lines (94 loc) · 3.81 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{
inputs.flakes.url = "github:deemp/flakes";
outputs = inputs:
let flakes = inputs.flakes; in
flakes.makeFlake {
inputs = {
inherit (inputs.flakes.all)
nixpkgs lima formatter codium drv-tools devshell
flakes-tools workflows purescript-tools;
inherit flakes;
};
perSystem = { inputs, system }:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
purescript-tools = inputs.purescript-tools.packages.${system};
inherit (inputs.devshell.lib.${system}) mkShell mkCommands mkRunCommands mkDefaultCommands;
inherit (inputs.drv-tools.lib.${system}) mkShellApps mkBin;
inherit (inputs.codium.lib.${system}) extensions extensionsCommon settingsNix settingsCommonNix writeSettingsJSON mkCodium;
inherit (inputs.flakes-tools.lib.${system}) mkFlakesTools;
inherit (inputs) workflows;
tools = __attrValues {
inherit (purescript-tools)
purescript purs-tidy purescript-language-server
nodejs_18 spago dhall-lsp-server;
};
packages = mkShellApps {
default = {
text = "${pkgs.nodejs_18}/bin/npm run quick-start";
description = "Run dev";
runtimeInputs = [ pkgs.nodejs_18 pkgs.spago purescript-tools.purescript ];
};
npmCleanCache = {
text = ''npm cache clean --force'';
runtimeInputs = [ pkgs.nodejs_18 ];
};
buildGHPages = {
text = ''npm run build:gh-pages'';
runtimeInputs = [ pkgs.nodejs_18 pkgs.spago purescript-tools.purescript ];
description = "Build GitHub Pages";
};
codium = mkCodium {
extensions = extensionsCommon // { inherit (extensions) purescript; };
runtimeDependencies = tools;
};
writeSettings = writeSettingsJSON (settingsCommonNix // { inherit (settingsNix) vscode-dhall-lsp-server ide-purescript; });
writeWorkflows = import ./nix-files/workflow.nix {
name = "ci";
inherit workflows system packages;
};
inherit (mkFlakesTools { dirs = [ "." ]; root = ./.; }) updateLocks saveFlakes format;
};
devShells.default = mkShell {
packages = tools;
commands =
mkCommands "tools" tools
++ mkRunCommands "ide" { "codium ." = packages.codium; inherit (packages) writeSettings; }
++ mkRunCommands "scripts" { inherit (packages) default buildGHPages; }
++ mkRunCommands "infra" { inherit (packages) writeWorkflows; }
++ mkDefaultCommands "scripts"
[
{
name = "npm run sass";
help = "sass watch .sass files and generate CSS";
}
{
name = "npm run dev";
help = "parcel watch files and reload browser window";
}
{
name = "npx lt -p <PORT> -s <SUBDOMAIN>";
help = "expose the app running at <PORT> at https://<SUBDOMAIN>.loca.lt";
}
]
;
};
in
{
inherit packages devShells;
formatter = inputs.formatter.${system};
};
};
nixConfig = {
extra-substituters = [
"https://nix-community.cachix.org"
"https://hydra.iohk.io"
"https://deemp.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
"deemp.cachix.org-1:9shDxyR2ANqEPQEEYDL/xIOnoPwxHot21L5fiZnFL18="
];
};
}