2022-12-08 19:43:13 +00:00
|
|
|
{
|
|
|
|
description = "A self-hostable pastebin for your tailnet";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "nixpkgs/nixos-unstable";
|
|
|
|
utils.url = "github:numtide/flake-utils";
|
|
|
|
};
|
|
|
|
|
2024-03-30 16:34:22 +00:00
|
|
|
outputs = { self, nixpkgs, utils }:
|
2022-12-08 19:43:13 +00:00
|
|
|
utils.lib.eachSystem [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
"x86_64-darwin"
|
|
|
|
"aarch64-darwin"
|
|
|
|
] (system:
|
|
|
|
let
|
|
|
|
version = builtins.substring 0 8 self.lastModifiedDate;
|
2024-03-30 16:34:22 +00:00
|
|
|
pkgs = import nixpkgs { inherit system; };
|
2022-12-08 19:43:13 +00:00
|
|
|
in {
|
|
|
|
packages = rec {
|
2024-03-30 16:34:22 +00:00
|
|
|
tclipd = pkgs.buildGo122Module {
|
2023-09-19 17:09:17 +01:00
|
|
|
pname = "tclipd";
|
2023-01-16 16:23:53 +00:00
|
|
|
version = "0.1.0-${version}";
|
2024-03-30 13:56:02 +00:00
|
|
|
go = pkgs.go;
|
2022-12-08 19:43:13 +00:00
|
|
|
src = ./.;
|
2023-09-19 17:09:17 +01:00
|
|
|
subPackages = "cmd/tclipd";
|
2024-05-18 23:02:27 +01:00
|
|
|
vendorHash = "sha256-nxKlKxpr7PZhDLk/J3TBjdhLjy7EYqmMGF+y4hgRgRQ=";
|
2022-12-08 19:43:13 +00:00
|
|
|
};
|
|
|
|
|
2024-03-30 16:34:22 +00:00
|
|
|
tclip = pkgs.buildGo122Module {
|
2023-01-16 19:14:45 +00:00
|
|
|
pname = "tclip";
|
2024-03-30 16:34:22 +00:00
|
|
|
inherit (tclipd) src version vendorHash;
|
2023-01-16 19:14:45 +00:00
|
|
|
subPackages = "cmd/tclip";
|
2024-03-30 13:56:02 +00:00
|
|
|
go = pkgs.go;
|
2022-12-13 15:59:28 +00:00
|
|
|
|
|
|
|
CGO_ENABLED = "0";
|
|
|
|
};
|
2022-12-08 20:45:45 +00:00
|
|
|
|
2022-12-08 19:43:13 +00:00
|
|
|
docker = pkgs.dockerTools.buildLayeredImage {
|
2024-03-30 16:49:51 +00:00
|
|
|
name = "ghcr.io/gmemstr/tclip";
|
2023-01-31 16:33:33 +00:00
|
|
|
tag = "latest";
|
2023-09-19 17:09:17 +01:00
|
|
|
config.Cmd = [ "${tclipd}/bin/tclipd" ];
|
2022-12-13 15:59:28 +00:00
|
|
|
contents = [ pkgs.cacert ];
|
2022-12-08 19:43:13 +00:00
|
|
|
};
|
|
|
|
|
2023-01-16 16:23:53 +00:00
|
|
|
portable-service = let
|
|
|
|
web-service = pkgs.substituteAll {
|
2023-01-16 19:14:45 +00:00
|
|
|
name = "tclip.service";
|
|
|
|
src = ./run/portable-service/tclip.service.in;
|
2023-09-19 17:09:17 +01:00
|
|
|
inherit tclipd;
|
2023-01-16 16:23:53 +00:00
|
|
|
};
|
|
|
|
in pkgs.portableService {
|
2023-09-19 17:09:17 +01:00
|
|
|
inherit (tclipd) version;
|
2023-01-16 19:14:45 +00:00
|
|
|
pname = "tclip";
|
|
|
|
description = "The tclip service";
|
|
|
|
homepage = "https://github.com/tailscale-dev/tclip";
|
2023-01-16 16:23:53 +00:00
|
|
|
units = [ web-service ];
|
|
|
|
symlinks = [{
|
|
|
|
object = "${pkgs.cacert}/etc/ssl";
|
|
|
|
symlink = "/etc/ssl";
|
|
|
|
}];
|
|
|
|
};
|
|
|
|
|
2022-12-08 19:43:13 +00:00
|
|
|
default = docker;
|
|
|
|
};
|
|
|
|
|
|
|
|
apps.default =
|
|
|
|
utils.lib.mkApp { drv = self.packages.${system}.default; };
|
|
|
|
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
go
|
|
|
|
gopls
|
|
|
|
gotools
|
|
|
|
go-tools
|
|
|
|
sqlite-interactive
|
2023-08-22 17:43:17 +01:00
|
|
|
|
|
|
|
yarn
|
|
|
|
nodejs
|
2022-12-08 19:43:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
TSNET_HOSTNAME = "paste-devel";
|
|
|
|
};
|
2023-01-16 16:23:53 +00:00
|
|
|
}) // {};
|
2022-12-08 19:43:13 +00:00
|
|
|
}
|