From be861797b47689b91522522f9a3be499ef2b59c8 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Thu, 7 Apr 2022 16:05:04 -0400 Subject: [PATCH] cmd/mkpkg: add name argument (#4372) * shell.nix: rename goimports to gotools Signed-off-by: Xe * cmd/mkpkg: allow specifying description and name in flag args Signed-off-by: Xe --- cmd/mkpkg/main.go | 6 ++++-- shell.nix | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cmd/mkpkg/main.go b/cmd/mkpkg/main.go index 07d3dc2ea..92d934094 100644 --- a/cmd/mkpkg/main.go +++ b/cmd/mkpkg/main.go @@ -45,6 +45,8 @@ func parseEmptyDirs(s string) []string { func main() { out := getopt.StringLong("out", 'o', "", "output file to write") + name := getopt.StringLong("name", 'n', "tailscale", "package name") + description := getopt.StringLong("description", 'd', "The easiest, most secure, cross platform way to use WireGuard + oauth2 + 2FA/SSO", "package description") goarch := getopt.StringLong("arch", 'a', "amd64", "GOARCH this package is for") pkgType := getopt.StringLong("type", 't', "deb", "type of package to build (deb or rpm)") files := getopt.StringLong("files", 'F', "", "comma-separated list of files in src:dst form") @@ -68,12 +70,12 @@ func main() { } emptyDirList := parseEmptyDirs(*emptyDirs) info := nfpm.WithDefaults(&nfpm.Info{ - Name: "tailscale", + Name: *name, Arch: *goarch, Platform: "linux", Version: *version, Maintainer: "Tailscale Inc ", - Description: "The easiest, most secure, cross platform way to use WireGuard + oauth2 + 2FA/SSO", + Description: *description, Homepage: "https://www.tailscale.com", License: "MIT", Overridables: nfpm.Overridables{ diff --git a/shell.nix b/shell.nix index 273ecf9b6..a415d7907 100644 --- a/shell.nix +++ b/shell.nix @@ -15,10 +15,10 @@ pkgs.mkShell { # This specifies the tools that are needed for people to get started with # development. These tools include: # - The Go compiler toolchain (and all additional tooling with it) - # - goimports, a robust formatting tool for Go source code + # - gotools for goimports, a robust formatting tool for Go source code # - gopls, the language server for Go to increase editor integration # - git, the version control program (used in some scripts) buildInputs = with pkgs; [ - go goimports gopls git + go gotools gopls git ]; }