diff --git a/flake.nix b/flake.nix index a0f6e28..6c9b63c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,13 +1,29 @@ { 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; }; - }; + inputs = { + nixpkgs.url = "nixpkgs/nixos-23.11"; + gomod2nix.url = "github:nix-community/gomod2nix"; + utils.url = "github:numtide/flake-utils"; }; + + outputs = { self, gomod2nix, nixpkgs, utils, ... }: + utils.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ + (self: super: { + buildGoApplication = + gomod2nix.packages."${system}".buildGoApplication; + }) + ]; + }; + in { + packages = rec { + default = google-photo-uploader; + google-photo-uploader = + pkgs.callPackage ./google-photo-uploader.nix { }; + }; + }); } diff --git a/google-photo-uploader.nix b/google-photo-uploader.nix index fa05653..40bc038 100644 --- a/google-photo-uploader.nix +++ b/google-photo-uploader.nix @@ -1,9 +1,6 @@ -{ gomod2nix }: - { config, lib, pkgs, ... }: -let buildGoApplication = gomod2nix.packages."${pkgs.system}".buildGoApplication; -in buildGoApplication rec { +pkgs.lib.buildGoApplication rec { pname = "google-photo-uploader"; version = "1.6.1";