-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
40 lines (34 loc) · 1.2 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
{
description = "GGT development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
(flake-utils.lib.eachDefaultSystem (system: nixpkgs.lib.fix (flake:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages = {
direnv = pkgs.direnv;
git = pkgs.git;
mkcert = pkgs.mkcert;
nix-direnv = pkgs.nix-direnv;
nixpkgs-fmt = pkgs.nixpkgs-fmt;
nodejs = pkgs.nodejs-18_x;
yarn = pkgs.yarn.override { nodejs = flake.packages.nodejs; };
ggt = pkgs.writeShellScriptBin "ggt" ''
GGT_ENV=production node --loader @swc-node/register/esm --no-warnings "$WORKSPACE_ROOT"/src/main.ts "$@"
'';
dggt = pkgs.writeShellScriptBin "dggt" ''
GGT_ENV=development node --loader @swc-node/register/esm --no-warnings "$WORKSPACE_ROOT"/src/main.ts "$@"
'';
};
devShell = pkgs.mkShell {
packages = builtins.attrValues flake.packages;
};
}
)));
nixConfig.bash-prompt = "\[ggt-develop:\\w\]$ ";
}