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";
|
|
|
|
|
|
|
|
gomod2nix = {
|
|
|
|
url = "github:tweag/gomod2nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.utils.follows = "utils";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, utils, gomod2nix }:
|
|
|
|
utils.lib.eachSystem [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
"x86_64-darwin"
|
|
|
|
"aarch64-darwin"
|
|
|
|
] (system:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [ gomod2nix.overlays.default ];
|
|
|
|
};
|
|
|
|
version = builtins.substring 0 8 self.lastModifiedDate;
|
|
|
|
in {
|
|
|
|
packages = rec {
|
2022-12-13 15:59:28 +00:00
|
|
|
web = pkgs.buildGoApplication {
|
|
|
|
pname = "tailpaste-web";
|
2022-12-08 19:43:13 +00:00
|
|
|
version = "0.1.0-dev";
|
|
|
|
src = ./.;
|
2022-12-13 15:59:28 +00:00
|
|
|
subPackages = "cmd/web";
|
2022-12-08 19:43:13 +00:00
|
|
|
modules = ./gomod2nix.toml;
|
|
|
|
};
|
|
|
|
|
2022-12-13 15:59:28 +00:00
|
|
|
tailpaste = pkgs.buildGoApplication {
|
|
|
|
pname = "tailpaste";
|
|
|
|
inherit (web) src version modules;
|
|
|
|
subPackages = "cmd/tailpaste";
|
|
|
|
|
|
|
|
CGO_ENABLED = "0";
|
|
|
|
};
|
2022-12-08 20:45:45 +00:00
|
|
|
|
2022-12-08 19:43:13 +00:00
|
|
|
docker = pkgs.dockerTools.buildLayeredImage {
|
|
|
|
name = "tailpaste";
|
|
|
|
tag = "latest";
|
2022-12-08 20:45:45 +00:00
|
|
|
config.Cmd = [ "${web}/bin/web" ];
|
2022-12-13 15:59:28 +00:00
|
|
|
contents = [ pkgs.cacert ];
|
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
|
|
|
|
gomod2nix.packages.${system}.default
|
|
|
|
sqlite-interactive
|
|
|
|
|
|
|
|
jo
|
|
|
|
jq
|
|
|
|
];
|
|
|
|
|
|
|
|
TSNET_HOSTNAME = "paste-devel";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|