diff --git a/hosts/common/configs/user/console/git/default.nix b/hosts/common/configs/user/console/git/default.nix index 55f11ad..610edf1 100644 --- a/hosts/common/configs/user/console/git/default.nix +++ b/hosts/common/configs/user/console/git/default.nix @@ -31,6 +31,7 @@ in feature.manyFiles = true; fetch.writeCommitGraph = true; http.cookiefile = "${home}/.config/git/cookies"; + advice.detachedHead = false; }; hooks = { diff --git a/hosts/elara/users/nikara/configs/console/klog/package.nix b/hosts/elara/users/nikara/configs/console/klog/package.nix index 9171ac6..a14a1cf 100644 --- a/hosts/elara/users/nikara/configs/console/klog/package.nix +++ b/hosts/elara/users/nikara/configs/console/klog/package.nix @@ -9,5 +9,12 @@ pkgs.buildGoModule rec { rev = "17629fe278dd23e12bd6f17ee9db0d2fde37bc6c"; }; - vendorHash = ""; + patches = [ ./remove-version-flag.patch ]; + + preBuild = '' + export GOPROXY="goproxy.unx.sas.com" + export GONOSUMDB="*.sas.com,sassoftware.io" + ''; + + vendorHash = "sha256-nYlJhGe1Jd3/ct0XpTdMqbgnnoYM0dqVVVfr9nVsu4o="; } diff --git a/hosts/elara/users/nikara/configs/console/klog/remove-version-flag.patch b/hosts/elara/users/nikara/configs/console/klog/remove-version-flag.patch new file mode 100644 index 0000000..158785f --- /dev/null +++ b/hosts/elara/users/nikara/configs/console/klog/remove-version-flag.patch @@ -0,0 +1,33 @@ +diff --git a/main.go b/main.go +index 6fee5d3..a8d45dd 100644 +--- a/main.go ++++ b/main.go +@@ -5,7 +5,6 @@ import ( + "flag" + "fmt" + "os" +- "runtime" + "strings" + "time" + +@@ -27,20 +26,8 @@ func main() { + flag.StringVar(&f, "format", "term", "Log output format (one of json|pretty|yaml|line|file|term|logfmt|plain|message|template)") + flag.StringVar(&ml, "l", "trace", "Minimum log level to output (in order, one of trace|debug|info|warn|error|fatal|panic|none|disabled)") + flag.StringVar(&tz, "t", defaultTimeZone, "Timezone to use for formatting log timestamps - One of UTC, Local, or from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones") +- var ver bool +- flag.BoolVar(&ver, "version", false, "Show version information") + flag.Parse() + +- if ver { +- fmt.Printf("Copyright © 2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n"+ +- "Command - %s\n"+ +- "Version - %s+%s\n"+ +- "Build Date - %s\n"+ +- "Compiler - %s %s/%s\n", +- "klog", BuildVersion, BuildCommit, BuildDate, runtime.Version(), runtime.GOOS, runtime.GOARCH) +- os.Exit(0) +- } +- + lf, ok := log.Formatters[f] + if !ok { + fmt.Fprintf(os.Stderr, "invalid value for format: [%s] - must be one of json|pretty|yaml|line|file|term|logfmt|plain|message|template", f) diff --git a/hosts/elara/users/nikara/configs/console/kubernetes/default.nix b/hosts/elara/users/nikara/configs/console/kubernetes/default.nix index 11f0fed..5de760b 100644 --- a/hosts/elara/users/nikara/configs/console/kubernetes/default.nix +++ b/hosts/elara/users/nikara/configs/console/kubernetes/default.nix @@ -2,9 +2,26 @@ user ? throw "user argument is required", home ? throw "home argument is required", }: -{ ... }: +{ pkgs, ... }: { + nixpkgs.overlays = [ + (final: prev: { + telepresence = prev.telepresence.overrideAttrs (oldAttrs: { + patches = oldAttrs.patches or [ ] ++ [ + ./fix-versioneer.patch + ./extend-timeout.patch + ]; + }); + }) + ]; + home-manager.users.${user} = { + home.packages = with pkgs; [ + telepresence + kubeval + kustomize + ]; + sops.secrets = { "kubeconfig/d90270" = { sopsFile = ../../../../../../../secrets/sas/secrets.yaml; diff --git a/hosts/elara/users/nikara/configs/console/kubernetes/extend-timeout.patch b/hosts/elara/users/nikara/configs/console/kubernetes/extend-timeout.patch new file mode 100644 index 0000000..68eacdc --- /dev/null +++ b/hosts/elara/users/nikara/configs/console/kubernetes/extend-timeout.patch @@ -0,0 +1,13 @@ +diff --git a/telepresence/proxy/remote.py b/telepresence/proxy/remote.py +index 835d42054..d910bd03f 100644 +--- a/telepresence/proxy/remote.py ++++ b/telepresence/proxy/remote.py +@@ -112,7 +112,7 @@ def wait_for_pod(runner: Runner, remote_info: RemoteInfo) -> None: + runner.kubectl( + "wait", + "--for=condition=ready", +- "--timeout=60s", ++ "--timeout=240s", + "pod/" + remote_info.pod_name, + ) + ) diff --git a/hosts/elara/users/nikara/configs/console/kubernetes/fix-versioneer.patch b/hosts/elara/users/nikara/configs/console/kubernetes/fix-versioneer.patch new file mode 100644 index 0000000..5d3e521 --- /dev/null +++ b/hosts/elara/users/nikara/configs/console/kubernetes/fix-versioneer.patch @@ -0,0 +1,16 @@ +diff --git a/versioneer.py b/versioneer.py +index 7e5bb402e..60d65ef76 100644 +--- a/versioneer.py ++++ b/versioneer.py +@@ -339,9 +339,9 @@ def get_config_from_root(root): + # configparser.NoOptionError (if it lacks "VCS="). See the docstring at + # the top of versioneer.py for instructions on writing your setup.cfg . + setup_cfg = os.path.join(root, "setup.cfg") +- parser = configparser.SafeConfigParser() ++ parser = configparser.ConfigParser() + with open(setup_cfg, "r") as f: +- parser.readfp(f) ++ parser.read_file(f) + VCS = parser.get("versioneer", "VCS") # mandatory + + def get(parser, name): diff --git a/hosts/elara/users/nikara/configs/console/snyk/default.nix b/hosts/elara/users/nikara/configs/console/snyk/default.nix new file mode 100644 index 0000000..d543fd4 --- /dev/null +++ b/hosts/elara/users/nikara/configs/console/snyk/default.nix @@ -0,0 +1,8 @@ +{ + user ? throw "user argument is required", + home ? throw "home argument is required", +}: +{ lib, pkgs, ... }: +{ + home-manager.users.${user}.home.packages = with pkgs; [ snyk ]; +} diff --git a/hosts/elara/users/nikara/default.nix b/hosts/elara/users/nikara/default.nix index 8be4244..2ae3760 100644 --- a/hosts/elara/users/nikara/default.nix +++ b/hosts/elara/users/nikara/default.nix @@ -71,13 +71,15 @@ in (import ./configs/console/go { inherit user home; }) (import ./configs/console/java { inherit user home; }) (import ./configs/console/kubernetes { inherit user home; }) + (import ./configs/console/snyk { inherit user home; }) (import ./configs/gui/obsidian { inherit user home; }) # Warning: the following imports use private SAS repositories. - # You must build the system once with these imports commented out, - # then uncomment them and rebuild the system once keys are provisioned. + # You must build the system once with these imports commented out. + # Then, connect to the SAS VPN, uncomment them, and rebuild the system. (import ./configs/console/jsonify { inherit user home; }) + (import ./configs/console/klog { inherit user home; }) ]; # echo "password" | mkpasswd -s