From d698c0c761be4cf2a3b1e265dbd48dc411c2a7ef Mon Sep 17 00:00:00 2001 From: niten Date: Sat, 27 Jan 2024 10:52:05 -0800 Subject: [PATCH] Switch approaches... --- flake.nix | 16 +++++----------- google-photo-uploader.nix | 8 ++++---- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/flake.nix b/flake.nix index 6c9b63c..c6a5bcb 100644 --- a/flake.nix +++ b/flake.nix @@ -10,20 +10,14 @@ outputs = { self, gomod2nix, nixpkgs, utils, ... }: utils.eachDefaultSystem (system: let - pkgs = import nixpkgs { - inherit system; - overlays = [ - (self: super: { - buildGoApplication = - gomod2nix.packages."${system}".buildGoApplication; - }) - ]; - }; + inherit (gomod2nix.legacyPackages."${system}") buildGoApplication; + inherit (nixpkgs) lib; in { packages = rec { default = google-photo-uploader; - google-photo-uploader = - pkgs.callPackage ./google-photo-uploader.nix { }; + google-photo-uploader = import ./google-photo-uploader.nix { + inherit lib buildGoApplication; + }; }; }); } diff --git a/google-photo-uploader.nix b/google-photo-uploader.nix index 40bc038..265b882 100644 --- a/google-photo-uploader.nix +++ b/google-photo-uploader.nix @@ -1,10 +1,10 @@ -{ config, lib, pkgs, ... }: +{ lib, buildGoApplication, ... }: -pkgs.lib.buildGoApplication rec { +buildGoApplication rec { pname = "google-photo-uploader"; version = "1.6.1"; - src = pkgs.fetchFromGitHub { + src = lib.fetchFromGitHub { owner = "int128"; repo = "gpup"; rev = version; @@ -13,7 +13,7 @@ pkgs.lib.buildGoApplication rec { modules = ./gomod2nix.toml; - meta = with pkgs.lib; { + meta = with lib; { description = "Google photos uploader, written in Go."; homepage = "https://github.com/int128/gpup"; license = licenses.asl20;