/
flake.nix
42 lines (38 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
41
42
{
description = "Serverless shortlinking service";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
devshell.url = "github:numtide/devshell";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, devshell, utils, ... }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ devshell.overlays.default ];
};
in {
devShell = pkgs.devshell.mkShell {
name = "mark-devshell";
commands = [
{
name = "develop";
command = "wrangler dev";
help = "Start a local server for developing worker";
}
{
name = "publish";
command = "wrangler publish";
help = "Publish worker to CloudFlare";
}
{
name = "secrets";
command = "op inject -i $PRJ_ROOT/wrangler.toml.tpl -o $PRJ_ROOT/wrangler.toml";
help = "Inject secrets from 1Password into wrangler.toml";
}
];
packages = with pkgs; [ wrangler nodePackages.pnpm nodejs_latest ];
};
});
}