diff options
Diffstat (limited to 'nix')
| -rw-r--r-- | nix/users/fcuny/work.nix | 49 |
1 files changed, 41 insertions, 8 deletions
diff --git a/nix/users/fcuny/work.nix b/nix/users/fcuny/work.nix index 7db6748..b1f5e75 100644 --- a/nix/users/fcuny/work.nix +++ b/nix/users/fcuny/work.nix @@ -17,14 +17,47 @@ ]; programs.fish = { - shellAbbrs = { - "ssh-sign-chi" = - "${pkgs.hashi}/bin/hashi -e chi1 sign --output-path=/Users/fcuny/.ssh/cert-chi1 --key=(op read 'op://employee/default rbx ssh key/public key'|psub) key"; - "hashi-chi" = "${pkgs.hashi}/bin/hashi -e chi1 show v"; - "hashi-ash" = "${pkgs.hashi}/bin/hashi -e ash1 show v"; - "pssh" = "ssh -J chi1-jumpcontainer-es -o 'CertificateFile=~/.ssh/cert-chi1'"; - "sjump" = "${pkgs.sapi}/bin/sapi jump"; - }; + shellAbbrs = + let + environments = [ + { + name = "chi1"; + alias = "chi1"; + } + { + name = "ash1"; + alias = "ash1"; + } + { + name = "sitetest3"; + alias = "st3"; + } + ]; + + # Generate all environment-specific aliases + envAliases = builtins.listToAttrs ( + builtins.concatMap (env: [ + { + name = "ssh-sign-${env.alias}"; + value = "${pkgs.hashi}/bin/hashi -e ${env.name} sign --output-path=/Users/fcuny/.ssh/cert-${env.alias} --key=(op read 'op://employee/default rbx ssh key/public key'|psub) key"; + } + { + name = "hashi-${env.alias}"; + value = "${pkgs.hashi}/bin/hashi -e ${env.name} show v"; + } + { + name = "ssh-${env.alias}"; + value = "ssh -J chi1-jumpcontainer-es -o 'CertificateFile=~/.ssh/cert-${env.alias}'"; + } + ]) environments + ); + + # Add any additional non-environment specific aliases + additionalAliases = { + "sjump" = "${pkgs.sapi}/bin/sapi jump"; + }; + in + envAliases // additionalAliases; }; # the configuration for sapi is generated when we run `sapi jump`, there's no need to manage it with nix. |
