tailscale-dev / tclip

A pastebin for Tailscale users
BSD 3-Clause "New" or "Revised" License
154 stars 17 forks source link

Introduce nixos module for tclip #64

Open fzakaria opened 3 months ago

fzakaria commented 3 months ago

This how I tested it:

Validation


<<< Welcome to NixOS 24.05.20240811.a731b45 (x86_64) - ttyS0 >>>

Run 'nixos-help' for the NixOS manual.

nixos login: alice
Password: 

[alice@nixos:~]$ which tclip
/run/current-system/sw/bin/tclip

[alice@nixos:~]$ tclip --help
Usage: tclip [filename]

Takes a file or standard in and posts it to your tailnet's tclip service. Returns a URL on standard out for sharing.

Flags:
  -n string
        filename to use for pastes from standard input
  -target string
        tclip server URL (default "http://paste")

[alice@nixos:~]$ systemctl status tclip
● tclip.service
     Loaded: loaded (/etc/systemd/system/tclip.service; enabled; preset: enable>
     Active: activating (auto-restart) (Result: exit-code) since Tue 2024-08-13>
    Process: 931 ExecStart=/nix/store/qfs9i87qa3m3yx84fq2amfjaijx5s3zb-unit-scr>
   Main PID: 931 (code=exited, status=2)
         IP: 0B in, 0B out
        CPU: 39ms

fixes #63

fzakaria commented 3 months ago

I would love if someone else can test this out too; I'll post on my twitter.

fzakaria commented 3 months ago

@Erisa let me know what you think. I added more description to demonstrate it running in a VM.

The systemd service was failing to run because I gave it an invalid auth key.

fzakaria commented 2 months ago

@Erisa I plan to revisit your comments; I've just been busy.

For those who want to see a working version, I've been running in my NixOS configuration https://github.com/fzakaria/nix-home/blob/master/modules/nixos/tclip.nix

Erisa commented 2 months ago

Thanks for the example - and no worries about being busy, I have been as well!