From 887d4b73228faa3354322fa374712ed1c48fd4ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 17 Nov 2024 18:36:35 +0100 Subject: [PATCH] enable gofumpt --- formatter.nix | 2 ++ pkgs/sops-install-secrets/linux.go | 4 ++-- pkgs/sops-install-secrets/main.go | 26 +++++++++++++------------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/formatter.nix b/formatter.nix index e67bc39..4e6f13a 100644 --- a/formatter.nix +++ b/formatter.nix @@ -3,6 +3,8 @@ inputs.treefmt-nix.lib.evalModule pkgs { projectRootFile = ".git/config"; programs = { + gofumpt.enable = true; + nixfmt.enable = true; deadnix.enable = true; diff --git a/pkgs/sops-install-secrets/linux.go b/pkgs/sops-install-secrets/linux.go index b551e4b..02412d1 100644 --- a/pkgs/sops-install-secrets/linux.go +++ b/pkgs/sops-install-secrets/linux.go @@ -60,8 +60,8 @@ func MountSecretFs(mountpoint string, keysGID int, useTmpfs bool, userMode bool) return nil } - var fstype = "ramfs" - var fsmagic = RamfsMagic + fstype := "ramfs" + fsmagic := RamfsMagic if useTmpfs { fstype = "tmpfs" fsmagic = TmpfsMagic diff --git a/pkgs/sops-install-secrets/main.go b/pkgs/sops-install-secrets/main.go index 280df4c..01a7abc 100644 --- a/pkgs/sops-install-secrets/main.go +++ b/pkgs/sops-install-secrets/main.go @@ -70,19 +70,19 @@ type template struct { } type manifest struct { - Secrets []secret `json:"secrets"` - Templates []template `json:"templates"` - PlaceholderBySecretName map[string]string `json:"placeholderBySecretName"` - SecretsMountPoint string `json:"secretsMountPoint"` - SymlinkPath string `json:"symlinkPath"` - KeepGenerations int `json:"keepGenerations"` - SSHKeyPaths []string `json:"sshKeyPaths"` - GnupgHome string `json:"gnupgHome"` - AgeKeyFile string `json:"ageKeyFile"` - AgeSSHKeyPaths []string `json:"ageSshKeyPaths"` - UseTmpfs bool `json:"useTmpfs"` - UserMode bool `json:"userMode"` - Logging loggingConfig `json:"logging"` + Secrets []secret `json:"secrets"` + Templates []template `json:"templates"` + PlaceholderBySecretName map[string]string `json:"placeholderBySecretName"` + SecretsMountPoint string `json:"secretsMountPoint"` + SymlinkPath string `json:"symlinkPath"` + KeepGenerations int `json:"keepGenerations"` + SSHKeyPaths []string `json:"sshKeyPaths"` + GnupgHome string `json:"gnupgHome"` + AgeKeyFile string `json:"ageKeyFile"` + AgeSSHKeyPaths []string `json:"ageSshKeyPaths"` + UseTmpfs bool `json:"useTmpfs"` + UserMode bool `json:"userMode"` + Logging loggingConfig `json:"logging"` } type secretFile struct {