Skip to content

Commit

Permalink
go.mod, nix.flake: update tailscale to 1.76, remove docker from flake (
Browse files Browse the repository at this point in the history
…#67)

* go.mod: upgrade tailscale to v1.74.1

* go.mod: add github.com/tailscale/mkctr

* flake.nix: try to remove gomod2nix

* stuff

Signed-off-by: Kristoffer Dalby <[email protected]>

* flake.nix: remove docker, integrate mkctr

* add docker to readme, update to 1.76

* yarn.lock: upgrade frontend deps

* Revert "yarn.lock: upgrade frontend deps"

This reverts commit 60cca1a.

---------

Signed-off-by: Kristoffer Dalby <[email protected]>
Co-authored-by: Kristoffer Dalby <[email protected]>
  • Loading branch information
Erisa and kradalby authored Oct 23, 2024
1 parent a0cf1c7 commit 98daa25
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 633 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/nix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
nix build .#tclip .#tclipd
- name: "Docker image build (dry run)"
run: |
nix develop --command go run github.com/tailscale/mkctr --gopaths="./cmd/tclipd:/bin/tclipd" --tags="latest" --base="gcr.io/distroless/static" --repos=ghcr.io/tailscale-dev/tclip --ldflags="-w -s" -- /bin/tclipd
nix develop --command -- mkctr --gopaths="./cmd/tclipd:/bin/tclipd" --tags="latest" --base="gcr.io/distroless/static" --repos=ghcr.io/tailscale-dev/tclip --ldflags="-w -s" -- /bin/tclipd
- name: "docker login"
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
if: "github.event_name == 'push' && github.ref_name == 'main'"
Expand All @@ -31,7 +31,7 @@ jobs:
- name: "Docker image push"
if: "github.event_name == 'push' && github.ref_name == 'main'"
run: |
nix develop --command go run github.com/tailscale/mkctr --gopaths="./cmd/tclipd:/bin/tclipd" --tags="latest" --base="gcr.io/distroless/static" --repos=ghcr.io/tailscale-dev/tclip --push --ldflags="-w -s" -- /bin/tclipd
nix develop --command -- mkctr --gopaths="./cmd/tclipd:/bin/tclipd" --tags="latest" --base="gcr.io/distroless/static" --repos=ghcr.io/tailscale-dev/tclip --push --ldflags="-w -s" -- /bin/tclipd
- name: "Portable service build"
run: |
nix build .#portable-service
Expand All @@ -41,4 +41,3 @@ jobs:
with:
name: portable-service
path: ./var/*.raw

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ nix build .#tclipd
The docker image:

```
nix build .#docker
docker load < ./result
nix develop --command -- mkctr --gopaths="./cmd/tclipd:/bin/tclipd" --tags="latest" --base="gcr.io/distroless/static" --repos=tclip --ldflags="-w -s" --target=local --push -- /bin/tclipd
docker run tclip
```

The portable service image:
Expand Down
36 changes: 6 additions & 30 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

143 changes: 68 additions & 75 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,100 +4,93 @@
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";

gomod2nix = {
url = "github:tweag/gomod2nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "utils";
};
};

outputs = { self, nixpkgs, utils, gomod2nix }:
outputs = {
self,
nixpkgs,
utils,
}:
utils.lib.eachSystem [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
] (system:
let
graft = pkgs: pkg: pkg.override {
buildGoModule = pkgs.buildGo122Module;
};
pkgs = import nixpkgs {
inherit system;
overlays = [ gomod2nix.overlays.default (final: prev: {
go = prev.go;
go-tools = graft prev prev.go-tools;
gotools = graft prev prev.gotools;
gopls = graft prev prev.gopls;
}) ];
] (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-Al6UxRE4zsFgaKUZoczR8xhXtGEKrkBR3FforOt+a20=";
};
version = builtins.substring 0 8 self.lastModifiedDate;
in {
packages = rec {
tclipd = pkgs.buildGoApplication {
pname = "tclipd";
version = "0.1.0-${version}";
go = pkgs.go;
src = ./.;
subPackages = "cmd/tclipd";
modules = ./gomod2nix.toml;
};

tclip = pkgs.buildGoApplication {
pname = "tclip";
inherit (tclipd) src version modules;
subPackages = "cmd/tclip";
go = pkgs.go;

CGO_ENABLED = "0";
};
tclip = pkgs.buildGo123Module {
pname = "tclip";
inherit (tclipd) src version vendorHash;
subPackages = "cmd/tclip";
inherit (pkgs) go;
CGO_ENABLED = "0";
};

docker = pkgs.dockerTools.buildLayeredImage {
name = "ghcr.io/tailscale-dev/tclip";
tag = "latest";
config.Cmd = [ "${tclipd}/bin/tclipd" ];
contents = [ pkgs.cacert ];
portable-service = let
web-service = pkgs.substituteAll {
name = "tclip.service";
src = ./run/portable-service/tclip.service.in;
inherit tclipd;
};

portable-service = let
web-service = pkgs.substituteAll {
name = "tclip.service";
src = ./run/portable-service/tclip.service.in;
inherit tclipd;
};
in pkgs.portableService {
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";
}];
units = [web-service];
symlinks = [
{
object = "${pkgs.cacert}/etc/ssl";
symlink = "/etc/ssl";
}
];
};

default = docker;
};
# default = docker;
default = tclipd;
};

apps.default =
utils.lib.mkApp { drv = self.packages.${system}.default; };
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
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go_1_23
gopls
gotools
go-tools
sqlite-interactive

yarn
nodejs
];
yarn
nodejs
(pkgs.buildGo123Module rec {
name = "mkctr";
src = pkgs.fetchFromGitHub {
owner = "tailscale";
repo = "mkctr";
rev = "42e5cb39d30bc804bd9a0071095cbd5de78e54f8";
sha256 = "sha256-MN47+aiJXqzAir3hhCKgY7OAys/ZLFi3OKkwH/wgFco=";
};

TSNET_HOSTNAME = "paste-devel";
};
}) // {};
vendorHash = "sha256-nIoe79dZwrFqrYLVfqASQDDjG1x0GmZpxDpnEdfny8k=";
})
];

TSNET_HOSTNAME = "paste-devel";
};
})
// {};
}
45 changes: 9 additions & 36 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/tailscale-dev/tclip

go 1.22.0
go 1.23.1

toolchain go1.22.5
toolchain go1.23.2

require (
github.com/go-enry/go-enry/v2 v2.8.4
Expand All @@ -11,12 +11,11 @@ require (
github.com/niklasfasching/go-org v1.7.0
github.com/russross/blackfriday v1.6.0
modernc.org/sqlite v1.30.2
tailscale.com v1.72.0
tailscale.com v1.76.3
)

require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/akutz/memconn v0.1.0 // indirect
github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa // indirect
github.com/aws/aws-sdk-go-v2 v1.24.1 // indirect
Expand All @@ -36,91 +35,65 @@ require (
github.com/aymerick/douceur v0.2.0 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/coder/websocket v1.8.12 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
github.com/coreos/go-iptables v0.7.1-0.20240112124308-65c67c9f46e6 // indirect
github.com/dblohm7/wingoes v0.0.0-20240119213807-a09d6be7affa // indirect
github.com/digitalocean/go-smbios v0.0.0-20180907143718-390a4f403a8e // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/cli v27.1.1+incompatible // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker v27.1.1+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.2 // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fxamacker/cbor/v2 v2.6.0 // indirect
github.com/gaissmai/bart v0.11.1 // indirect
github.com/go-enry/go-oniguruma v1.2.1 // indirect
github.com/go-json-experiment/json v0.0.0-20231102232822-2e55bd4e08b0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-containerregistry v0.20.1 // indirect
github.com/google/nftables v0.2.1-0.20240414091927-5e242ec57806 // indirect
github.com/gorilla/csrf v1.7.2 // indirect
github.com/gorilla/css v1.0.1 // indirect
github.com/gorilla/securecookie v1.1.2 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hdevalence/ed25519consensus v0.2.0 // indirect
github.com/illarion/gonotify v1.0.1 // indirect
github.com/illarion/gonotify/v2 v2.0.3 // indirect
github.com/insomniacslk/dhcp v0.0.0-20231206064809-8c70d406f6d2 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86 // indirect
github.com/jsimonetti/rtnetlink v1.4.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/compress v1.17.10 // indirect
github.com/kortschak/wol v0.0.0-20200729010619-da482cc4850a // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mdlayher/genetlink v1.3.2 // indirect
github.com/mdlayher/netlink v1.7.2 // indirect
github.com/mdlayher/sdnotify v1.0.0 // indirect
github.com/mdlayher/socket v0.5.0 // indirect
github.com/miekg/dns v1.1.58 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-ps v1.0.0 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus-community/pro-bing v0.4.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/safchain/ethtool v0.3.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/tailscale/certstore v0.1.1-0.20231202035212-d3fa0460f47e // indirect
github.com/tailscale/go-winio v0.0.0-20231025203758-c4f33415bf55 // indirect
github.com/tailscale/golang-x-crypto v0.0.0-20240604161659-3fde5e568aa4 // indirect
github.com/tailscale/goupnp v1.0.1-0.20210804011211-c64d0f06ea05 // indirect
github.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a // indirect
github.com/tailscale/mkctr v0.0.0-20240730144311-42e5cb39d30b // indirect
github.com/tailscale/netlink v1.1.1-0.20211101221916-cabfb018fe85 // indirect
github.com/tailscale/netlink v1.1.1-0.20240822203006-4d49adab4de7 // indirect
github.com/tailscale/peercred v0.0.0-20240214030740-b535050b2aa4 // indirect
github.com/tailscale/web-client-prebuilt v0.0.0-20240226180453-5db17b287bf1 // indirect
github.com/tailscale/wireguard-go v0.0.0-20240731203015-71393c576b98 // indirect
github.com/tailscale/wireguard-go v0.0.0-20240905161824-799c1978fafc // indirect
github.com/tcnksm/go-httpstat v0.2.0 // indirect
github.com/u-root/uio v0.0.0-20240118234441-a3c409a6018e // indirect
github.com/vbatts/tar-split v0.11.5 // indirect
github.com/vishvananda/netlink v1.2.1-beta.2 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
go4.org/mem v0.0.0-20220726221520-4f986261bf13 // indirect
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect
golang.org/x/mod v0.19.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/term v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
Expand Down
Loading

0 comments on commit 98daa25

Please sign in to comment.