From bd7b5575502e2490218fe8e38e3cfb450d6d58a0 Mon Sep 17 00:00:00 2001 From: niten Date: Sat, 27 Jan 2024 09:53:47 -0800 Subject: [PATCH] Initial checkin --- flake.nix | 13 +++++++++++++ gomod2nix.toml | 39 +++++++++++++++++++++++++++++++++++++++ google-photo-uploader.nix | 25 +++++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 flake.nix create mode 100644 gomod2nix.toml create mode 100644 google-photo-uploader.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..a0f6e28 --- /dev/null +++ b/flake.nix @@ -0,0 +1,13 @@ +{ + description = "Google Photo Uploader"; + + inputs = { gomod2nix.url = "github:nix-community/gomod2nix"; }; + + outputs = { self, gomod2nix, ... }: { + packages = rec { + default = google-photo-uploader; + google-photo-uploader = + import ./google-photo-uploader.nix { inherit gomod2nix; }; + }; + }; +} diff --git a/gomod2nix.toml b/gomod2nix.toml new file mode 100644 index 0000000..72d8475 --- /dev/null +++ b/gomod2nix.toml @@ -0,0 +1,39 @@ +schema = 3 + +[mod] + [mod."cloud.google.com/go"] + version = "v0.31.0" + hash = "sha256-t9FOG7yofPY19JE9xZxKlGYfNJvShJib+OEuLF7HWV4=" + [mod."github.com/int128/oauth2cli"] + version = "v1.0.0" + hash = "sha256-8+Q1UvxCVdm5TtTbnscWpHVPV+X15M9/PPUjZN01AUc=" + [mod."github.com/jessevdk/go-flags"] + version = "v1.4.0" + hash = "sha256-5tg5rdiLEbI53DAwp3Yps1y/6e9m9AcgzX3No4wE9dY=" + [mod."github.com/lestrrat-go/backoff"] + version = "v0.0.0-20180409035020-828830ec1d9a" + hash = "sha256-aJcubap/uQf/G/sRb0kjRv3fGB60blzOb4VZUxyypUg=" + [mod."github.com/mitchellh/go-homedir"] + version = "v1.0.0" + hash = "sha256-eGmBNNTuDSMwicjTNgB54IEJuK1tgOLDJ3NHTpQCHzg=" + [mod."github.com/pkg/browser"] + version = "v0.0.0-20180916011732-0a3d74bf9ce4" + hash = "sha256-LOwoCHXSkhpTRBFgEa9eiRKnqP7DKBJgTceGUTefZlM=" + [mod."github.com/pkg/errors"] + version = "v0.8.0" + hash = "sha256-5d5y6os/w8geLyptFuf4DL66xQ4YD9qmoeLCF441MQA=" + [mod."golang.org/x/net"] + version = "v0.0.0-20181029044818-c44066c5c816" + hash = "sha256-jrD7nFhA3Vv0q8BCtFhE68vJQsbDEai3BK0Eusjh/FU=" + [mod."golang.org/x/oauth2"] + version = "v0.0.0-20181031022657-8527f56f7107" + hash = "sha256-+IKebEw27GsltX03EXG/xsYj7FlxO3zsMLdSrsiTymw=" + [mod."google.golang.org/api"] + version = "v0.0.0-20181101000641-61ce27ee8154" + hash = "sha256-PTpBiG7bQW447Ihpf2xh30aKXfZkgjK8hLhJQOivo0U=" + [mod."gopkg.in/check.v1"] + version = "v0.0.0-20161208181325-20d25e280405" + hash = "sha256-1w5mgYaZUC52uzDnpXXVqle/9AVkH4WePSrQFOVANUw=" + [mod."gopkg.in/yaml.v2"] + version = "v2.2.1" + hash = "sha256-QY+DRctY7JryX+Hwtx2p1ThfmK9Zr6OZpu2JS4XOkjc=" diff --git a/google-photo-uploader.nix b/google-photo-uploader.nix new file mode 100644 index 0000000..fa05653 --- /dev/null +++ b/google-photo-uploader.nix @@ -0,0 +1,25 @@ +{ gomod2nix }: + +{ config, lib, pkgs, ... }: + +let buildGoApplication = gomod2nix.packages."${pkgs.system}".buildGoApplication; +in buildGoApplication rec { + pname = "google-photo-uploader"; + version = "1.6.1"; + + src = pkgs.fetchFromGitHub { + owner = "int128"; + repo = "gpup"; + rev = version; + sha256 = "sha256-FfJbWpH//Z/NxgpH7JvOf8pWxJOxgYDABUfcyWNps30="; + }; + + modules = ./gomod2nix.toml; + + meta = with pkgs.lib; { + description = "Google photos uploader, written in Go."; + homepage = "https://github.com/int128/gpup"; + license = licenses.asl20; + platforms = platforms.linux ++ platforms.darwin; + }; +}