-
Notifications
You must be signed in to change notification settings - Fork 17
/
flake.nix
96 lines (86 loc) · 2.46 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
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
{
description = "A self-hostable pastebin for your tailnet";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
utils,
}:
utils.lib.eachSystem [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
] (system: let
version = builtins.substring 0 8 self.lastModifiedDate;
pkgs = import nixpkgs {inherit system;};
in {
packages = rec {
tclipd = pkgs.buildGo123Module {
pname = "tclipd";
version = "0.1.0-${version}";
inherit (pkgs) go;
src = ./.;
subPackages = "cmd/tclipd";
vendorHash = "sha256-8QE9lSru4DLG77v0ZduKjAnLYbOsCIkQMSBykKNtTPM=";
};
tclip = pkgs.buildGo123Module {
pname = "tclip";
inherit (tclipd) src version vendorHash;
subPackages = "cmd/tclip";
inherit (pkgs) go;
CGO_ENABLED = "0";
};
portable-service = let
web-service = pkgs.substituteAll {
name = "tclip.service";
src = ./run/portable-service/tclip.service.in;
inherit tclipd;
};
in
pkgs.portableService {
inherit (tclipd) version;
pname = "tclip";
description = "The tclip service";
homepage = "https://github.com/tailscale-dev/tclip";
units = [web-service];
symlinks = [
{
object = "${pkgs.cacert}/etc/ssl";
symlink = "/etc/ssl";
}
];
};
# default = docker;
default = tclipd;
};
apps.default =
utils.lib.mkApp {drv = self.packages.${system}.default;};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go_1_23
gopls
gotools
go-tools
sqlite-interactive
yarn
nodejs
(pkgs.buildGo123Module rec {
name = "mkctr";
src = pkgs.fetchFromGitHub {
owner = "tailscale";
repo = "mkctr";
rev = "42e5cb39d30bc804bd9a0071095cbd5de78e54f8";
sha256 = "sha256-MN47+aiJXqzAir3hhCKgY7OAys/ZLFi3OKkwH/wgFco=";
};
vendorHash = "sha256-nIoe79dZwrFqrYLVfqASQDDjG1x0GmZpxDpnEdfny8k=";
})
];
TSNET_HOSTNAME = "paste-devel";
};
})
// {};
}