Skip to content

Commit

Permalink
flake.nix: remove docker, integrate mkctr
Browse files Browse the repository at this point in the history
  • Loading branch information
Erisa committed Oct 23, 2024
1 parent 4b417c4 commit d880c24
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 326 deletions.
4 changes: 2 additions & 2 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 Down
6 changes: 3 additions & 3 deletions flake.lock

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

32 changes: 12 additions & 20 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@
"x86_64-darwin"
"aarch64-darwin"
] (system: let
# graft = pkgs: pkg: pkg.override {
# buildGoModule = pkgs.buildGo123Module;
# };
# pkgs = import nixpkgs {
# inherit system;
# overlays = [ gomod2nix.overlays.default (final: prev: {
# go = prev.go_1_23;
# go-tools = graft prev prev.go-tools;
# gotools = graft prev prev.gotools;
# gopls = graft prev prev.gopls;
# }) ];
# };
version = builtins.substring 0 8 self.lastModifiedDate;
pkgs = import nixpkgs {inherit system;};
in {
Expand All @@ -46,17 +34,10 @@
pname = "tclip";
inherit (tclipd) src version vendorHash;
subPackages = "cmd/tclip";
go = pkgs.go;
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";
Expand Down Expand Up @@ -95,6 +76,17 @@

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";
Expand Down
Loading

0 comments on commit d880c24

Please sign in to comment.