-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathflake.nix
More file actions
66 lines (57 loc) · 1.78 KB
/
Copy pathflake.nix
File metadata and controls
66 lines (57 loc) · 1.78 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
{
description = "Pushwork: Bidirectional directory synchronization using Automerge CRDTs";
inputs = {
command-utils.url = "git+https://codeberg.org/expede/nix-command-utils";
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
};
outputs = {
self,
command-utils,
flake-utils,
nixpkgs,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
nodejs = pkgs.nodejs_24;
pnpm-pkg = pkgs.pnpm;
pnpm' = "${pnpm-pkg}/bin/pnpm";
asModule = command-utils.asModule.${system};
cmd = command-utils.cmd.${system};
pnpm = command-utils.pnpm.${system};
pnpm-cfg = {pnpm = pnpm';};
menu =
command-utils.commands.${system}
[
(pnpm.build pnpm-cfg)
(pnpm.dev pnpm-cfg)
(pnpm.install pnpm-cfg)
(pnpm.lint pnpm-cfg)
(pnpm.test pnpm-cfg)
(pnpm.typecheck pnpm-cfg)
(asModule {
"clean" = cmd "Remove dist and node_modules" "rm -rf dist node_modules";
"start" = cmd "Run pushwork CLI" "node dist/cli.js \"$@\"";
"sync" = cmd "Build and run sync" "${pnpm'} build && node dist/cli.js sync \"$@\"";
"watch" = cmd "Watch, build, and sync loop" "node dist/cli.js watch \"$@\"";
})
];
in {
devShells.default = pkgs.mkShell {
name = "Pushwork Dev Shell";
nativeBuildInputs =
[
nodejs
pkgs.nodePackages.vscode-langservers-extracted
pkgs.typescript
pkgs.typescript-language-server
pnpm-pkg
]
++ menu;
shellHook = ''
menu
'';
};
formatter = pkgs.alejandra;
});
}