Merge branch 'main' of github.com:asosnovsky/nixos-setup

This commit is contained in:
ari committed 2024-05-29 15:19:19 -04:00
commit 51f15e0652
41 files changed
+425 -130

No files matched your search

+5 -1
View File
@@ -3,6 +3,10 @@
# Devenv
.devenv*
devenv.local.nix
.devbox
# tmp
tmp
# direnv
.direnv
@@ -11,4 +15,4 @@ devenv.local.nix
.pre-commit-config.yaml
# nix build
result
result
+3 -2
View File
@@ -1,5 +1,6 @@
{
"recommendations": [
"pinage404.nix-extension-pack"
"pinage404.nix-extension-pack",
"brettm12345.nixfmt-vscode"
]
}
}
+5
View File
@@ -0,0 +1,5 @@
{
"nix.enableLanguageServer": true,
"nix.serverPath": "nil",
}
+55
View File
@@ -0,0 +1,55 @@
export DEV_DEPLOYMENTS=(stag long)
export PROD_DEPLOYMENTS=(dub fra mon mum prod syd tky us2 fed)
echo "Loading functions"
function airflow-v2-exec-web() {
dep=${1}
airflow-v2-exec $dep bash
}
function airflow-v2-exec() {
dep=${1}
airflow-v2 $dep exec -it svc/$dep-analytics-airflow-v2-webserver -c webserver -- ${@:2}
}
function tsh.login() {
tsh login -d --proxy teleport.kumoroku.com eks-${1}
tsh kube login eks-${1}
}
function tsh.hop() {
tsh ssh -d --cluster=eks-${1} hop-${2:-1}
}
function tsh.shared() {
tsh ssh -d --cluster=main shared_box-${2:-1}
}
function tsh.login.all() {
for dep in ${DEV_DEPLOYMENTS[@]}; do
echo "---------"
echo " $dep "
echo "---------"
tsh.login $dep
done
for dep in ${PROD_DEPLOYMENTS[@]}; do
echo "---------"
echo " $dep "
echo "---------"
tsh.login $dep
done
}
function airflow-v2-all-tasks() {
for dep in ${DEV_DEPLOYMENTS[@]}; do
echo "[ $dep ]"
airflow-v2-list-tasks $dep
done
for dep in ${PROD_DEPLOYMENTS[@]}; do
echo "[ $dep ]"
airflow-v2-list-tasks $dep
done
}
function airflow-v2-delete-pod-tasks() {
dep=${1}
for pod in $(airflow-v2-list-tasks $dep | awk -F ' ' '{print $1}'); do airflow-v2 $dep delete pod/$pod &; done
}
function open-paas() {
dep=${1:-infrastructure}
eval $(dev hcvault cli_env -a $dep)
export GITHUB_TOKEN=$(dev secrets get -s github_token | jq -r .github_token_password)
paas-iac-shell
}
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
dep=${1}
eks $dep analytics-airflow ${@:2}
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
dep=${1}
eks $dep analytics-airflow-v2 ${@:2}
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
current_dep=$(kubectl config current-context | cut -d '-' -f2)
airflow-v2 ${1:-$current_dep} get pod --sort-by=.status.startTime -l task_id
@@ -0,0 +1,7 @@
#!/bin/bash
current_dep=$(kubectl config current-context | cut -d '-' -f2)
dep=${1:-$current_dep}
airflow-v2 $dep rollout restart deploy/$dep-analytics-airflow-v2-web &
airflow-v2 $dep rollout restart deploy/$dep-analytics-airflow-v2-scheduler &
wait
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
dep=${1}
eks $dep analytics ${@:2}
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
dep=${1}
eks $dep csi ${@:2}
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
dev hcvault login
eval $(dev hcvault cli_env -a infrastructure)
region="us-west-2"
aws_account_id=`aws sts get-caller-identity --query "Account" --output text`
aws ecr get-login-password --region ${region} | docker login --username AWS --password-stdin ${aws_account_id}.dkr.ecr.${region}.amazonaws.com
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
dep=${1}
assembly=${2}
echo "${dep}/${assembly}"
kubectl --cluster eks-$dep -n $dep-${assembly} --context eks-$dep-eks-$dep ${@:3}
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
current_dep=$(kubectl config current-context | cut -d "-" -f2)
dep=${2:-$current_dep}
echo "$dep $current_dep"
kubectl config set-context --current --namespace=$dep-${1}
+25
View File
@@ -0,0 +1,25 @@
# pod=analytics-84d4bff6c-2fzj9
namespace=us2-analytics
echo "getting pods..."
pods=`kubectl get pods -n $namespace`
totalpods=$(echo $pods | wc -l)
totalpods="$((totalpods-1))"
echo $pods | awk "NR==1" | awk '$0=" "$0'
echo $pods | awk "NR>1" | awk '$0=NR") "$0'
echo "> Please select one of the pods, enter a number between 1 and $totalpods"
read pod_num
case ${pod_num#[-+]} in
*[!0-9]* | '') echo "Must be an integer." ;;
esac
pod=$(kubectl get pods -n $namespace | awk {'print $1}' | awk -v pod_num=$pod_num 'NR==pod_num+1')
echo "Getting memory dump for $pod - Continue? [ANY KEY]..."
read
kubectl exec -n $namespace $pod -c analytics-assembly -- jcmd Bootstrap GC.heap_dump /tmp/$pod.hprof
kubectl exec -n $namespace $pod -c analytics-assembly -- gzip /tmp/$pod.hprof
kubectl -n $namespace cp -c analytics-assembly $pod:/tmp/$pod.hprof.gz $pod.hprof.gz
kubectl exec -n $namespace $pod -c analytics-assembly -it -- /bin/bash
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
set -e
name=${1:-new}
dep=${2:-stag}
cmd="helm template --values test_values.yaml --values values.yaml --values values-$dep.yaml"
if [ ! -z "values-$dep.auto.yaml"]; then
cmd="$cmd --values values-$dep.auto.yaml"
fi
cmd="$cmd --debug . > tmp/$name.yml"
echo $cmd
$cmd
if [ $name == "new" ];
if [ ! -z "tmp/old.yml" ]; then
diff tmp/original.yml tmp/new.yml > tmp/diff
fi
fi
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
TF_LOG=trace terraform apply --auto-approve &> apply.log
TF_LOG=trace terraform destroy --auto-approve &> destroy.log
cat destroy.log | grep "DEBUG: Request" | sed -nr 's/^.*Request (.*) Details:/\1/p' | sort | uniq > all.perms
cat apply.log | grep "DEBUG: Request" | sed -nr 's/^.*Request (.*) Details:/\1/p' | sort | uniq >> all.perms
cat all.perms | sort | uniq -u > required.perms
rm all.perms
+6
View File
@@ -0,0 +1,6 @@
#/bin/zsh
set -e
dev encrypted_disk mount
dev provision ssh_keys
ssh-add /Volumes/Encrypted/keys/prod_rsa
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
set -e
dev hcvault login
dev hcvault console -o
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
gawk 'match($0,/'$1'/, ary) {print ary['${2:-'1'}']}'
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
eks us2 analytics-sagemaker ${@:1}
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
set -e
cred_file=${1}
aws_cred_file=$HOME/.aws/credentials
source $HOME/$cred_file.sh
if [ -z "${AWS_ACCESS_KEY_ID}" ]; then
echo "Missing access key";
exit 1
fi
if [ -z "${AWS_SECRET_ACCESS_KEY}" ]; then
echo "Missing AWS_SECRET_ACCESS_KEY";
exit 1
fi
if [ -z "${AWS_SESSION_TOKEN}" ]; then
echo "Missing AWS_SESSION_TOKEN";
exit 1
fi
echo "Updating $aws_cred_file ..."
echo "[default]" > $aws_cred_file
echo "aws_access_key_id = $AWS_ACCESS_KEY_ID" >> $aws_cred_file
echo "aws_secret_access_key = $AWS_SECRET_ACCESS_KEY" >> $aws_cred_file
echo "aws_session_token=$AWS_SESSION_TOKEN" >> $aws_cred_file
unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
unset AWS_SESSION_TOKEN
echo `aws sts get-caller-identity`
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
echo "<<< ◉ Updating dsh ⦿ >>>"
cd ~/git/sumo && git fetch origin master:master && git merge master && git status
echo "<<< ◉ Updatig knobs ⦿ >>>"
cd ~/git/knobs && git fetch origin master:master && git merge master && git status
+12 -46
View File
@@ -3,11 +3,11 @@
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1713632052,
"lastModified": 1716370999,
"owner": "cachix",
"repo": "devenv",
"rev": "9c134f73b11b298674317b84292fa126744a65fb",
"treeHash": "b23850beedbddb3c23ecd5320f95d8c4525aeb18",
"rev": "38bf3509369446cc04410dc7b8f3e6c0e800e282",
"treeHash": "95e7e2cf5c39211e1687c8700841ed3180c4327b",
"type": "github"
},
"original": {
@@ -33,24 +33,6 @@
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"treeHash": "bd263f021e345cb4a39d80c126ab650bebc3c10c",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
@@ -74,11 +56,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1713596654,
"lastModified": 1716312448,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fd16bb6d3bcca96039b11aa52038fafeb6e4f4be",
"treeHash": "fadc8eefb11cd63b3a7f59eaf6fac47ece269476",
"rev": "e381a1288138aceda0ac63db32c7be545b446921",
"treeHash": "94e1ec859be23f2ea92ba136657f35237682df6d",
"type": "github"
},
"original": {
@@ -90,11 +72,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1713564160,
"lastModified": 1716218643,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "bc194f70731cc5d2b046a6c1b3b15f170f05999c",
"treeHash": "f0682fcd74b6547997b0a93d9d7d1047ef695b3f",
"rev": "a8695cbd09a7ecf3376bd62c798b9864d20f86ee",
"treeHash": "7c62ffb1bbf9fc2417d1720663e38db0c3f0b907",
"type": "github"
},
"original": {
@@ -107,7 +89,6 @@
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
@@ -115,11 +96,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1712897695,
"lastModified": 1716213921,
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "40e6053ecb65fcbf12863338a6dcefb3f55f1bf8",
"treeHash": "9ba338feee8e6b2193c305f46b65b0fef49816b7",
"rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0",
"treeHash": "17b9f9f9983467bcff247b09761dca9831d3d3be",
"type": "github"
},
"original": {
@@ -134,21 +115,6 @@
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"treeHash": "cce81f2a0f0743b2eb61bc2eb6c7adbe2f2c6beb",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
+1
View File
@@ -4,6 +4,7 @@
languages.nix.enable = true;
packages = [
pkgs.nixpkgs-fmt
pkgs.nixd
];
pre-commit = {
hooks.nixpkgs-fmt.enable = true;
-14
View File
@@ -1,14 +0,0 @@
{ ... }:
{
imports =
[
(import ./main.nix {
hostName = "fw1";
user = {
name = "ari";
fullName = "Ari Sosnovsky";
email = "ariel@sosnovsky.ca";
};
})
];
}
Generated
+17 -1
View File
@@ -77,7 +77,23 @@
"home-manager": "home-manager",
"nix-darwin": "nix-darwin",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"systems": "systems"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
+42 -7
View File
@@ -1,11 +1,8 @@
{
inputs = {
nixos-hardware = {
url = "github:NixOS/nixos-hardware/master";
};
nixpkgs = {
url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
@@ -22,6 +19,7 @@
, nixpkgs
, home-manager
, nix-darwin
, systems
}:
let
user = {
@@ -29,15 +27,31 @@
fullName = "Ari Sosnovsky";
email = "ariel@sosnovsky.ca";
};
sumoUser = rec {
name = "asosnovsky";
fullName = user.fullName;
email = "${name}@sumologic.com";
homepath = "/Users/${name}";
extraGitConfigs = [
{ path = "${homepath}/.config/mysumo/gitconfig"; }
];
};
homeMangerVersion = "24.05";
lib = (import modules/lib.nix {
nixpkgs = nixpkgs;
home-manager = home-manager;
nix-darwin = nix-darwin;
});
eachSystem = nixpkgs.lib.genAttrs (import systems);
in
{
lib = lib;
formatter = eachSystem (system:
nixpkgs.legacyPackages.${system}.nixpkgs-fmt
);
# NIXOS Setups
# -------------
nixosConfigurations."fwbook" = lib.makeNixOsModule {
system = "x86_64-linux";
user = user;
@@ -45,7 +59,6 @@
hostName = "fwbook";
home-manager = {
enable = true;
mode = "nixos";
version = homeMangerVersion;
};
desktop = {
@@ -73,5 +86,27 @@
];
};
};
# MacBooks Setups
# -------------
darwinConfigurations."asosnovsky-mac" = lib.makeDarwinModule {
user = sumoUser;
systemStateVersion = 4;
system = "x86_64-darwin";
hostName = "asosnovsky-mac";
home-manager = {
enable = true;
version = homeMangerVersion;
};
desktop = {
enable = false;
};
os = {
enable = false;
};
configuration = (import ./hosts/asosnovsky-mac.nix {
user = sumoUser;
});
};
};
}
BIN
View File
Binary file not shown.
+55
View File
@@ -0,0 +1,55 @@
{ user }:
{ pkgs, ... }:
let
zshSumo = builtins.filterSource (p: t: true) ../configs/sumo;
zshScripts = zshSumo + "/scripts";
zshFunctions = zshSumo + "/functions.sh";
in
{
home-manager.users.${user.name} = {
home = {
packages = with pkgs; [
coreutils-prefixed
awscli2
kubernetes-helm
nixfmt-classic
nil
jq
pre-commit
devenv
terragrunt
oterm
];
shellAliases = {
k = "kubectl";
gradlew = "dev gradlew";
psh = "source $HOME/git/github/psh/psh.sh";
hcvault = "dev hcvault";
};
sessionVariables = {
"DOCKER_DEFAULT_PLATFORM" = "linux/amd64";
"SUMO_HOME" = "$HOME/git/sumo";
"_JAVA_OPTIONS" = "-Djava.awt.headless=true";
"LC_ALL" = "en_US.UTF-8";
"JAVA_HOME" = "/Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home";
};
sessionPath = [
"$HOME/.devcli/bin"
"$HOME/.krew/bin"
"$HOME/git/github/paas-infrastructure/bin"
"$HOME/.krew/bin"
zshScripts
];
};
programs.zsh.initExtra = ''
source ${zshFunctions}
source /dev/stdin <<< "$($HOME/.devcli/dev --init)"
complete -o default -F __start_kubectl k
source <(helm completion zsh)
complete -C '/opt/homebrew/bin/aws_completer' aws
source <(kubectl completion zsh)
test -f ~/.prada/artifactory.env && source ~/.prada/artifactory.env
ulimit -n $(sysctl -n kern.maxfilesperproc)
'';
};
}
File renamed without changes.
@@ -40,6 +40,7 @@ in
neofetch
ipfetch
nixd
devbox
];
};
programs = {
@@ -69,7 +70,11 @@ in
init = { defaultBranch = "main"; };
};
includes =
(builtins.map (f: { path = gitconfigs + "/" + f; }) gitconfigFiles);
(builtins.map (f: { path = gitconfigs + "/" + f; }) gitconfigFiles)
++ (if builtins.hasAttr "extraGitConfigs" user then
user.extraGitConfigs
else
[ ]);
};
zsh = {
enable = true;
@@ -88,12 +93,7 @@ in
enable = true;
clock24 = true;
mouse = true;
plugins = with pkgs.tmuxPlugins; [
nord
cpu
battery
sidebar
];
plugins = with pkgs.tmuxPlugins; [ nord cpu battery sidebar ];
};
};
};
File renamed without changes.
File renamed without changes.
+1 -1
View File
@@ -38,7 +38,7 @@ in
attrs = attrs;
home-manager-modules = [
home-manager.darwinModules.home-manager
(import ./macos-home-manager.nix { user = user; })
(import ./home-manager/macos.nix { user = user; })
];
}) ++ [
(import ./macos.nix {
+1
View File
@@ -3,5 +3,6 @@
services.nix-daemon.enable = true;
security.pam.enableSudoTouchIdAuth = true;
users.users.${user.name}.home = user.homepath;
users.users.root.home = "/var/root";
nixpkgs.hostPlatform = system;
}
+5 -5
View File
@@ -19,12 +19,12 @@
{ ... }:
{
imports = [
(import ./nix/main.nix {
(import ./nix {
user = user;
systemStateVersion = "23.11";
systemStateVersion = systemStateVersion;
})
] ++ (if desktop.enable then [
(import ./desktop/main.nix {
(import ./desktop {
user = user;
enableKDE = desktop.enableKDE;
enableHypr = desktop.enableHypr;
@@ -32,7 +32,7 @@
enableWine = desktop.enableWine;
})
] else [ ]) ++ (if os.enable then [
(import ./os/main.nix {
(import ./os {
user = user;
hostName = hostName;
firewall = os.firewall;
@@ -42,7 +42,7 @@
hardware = os.hardware;
})
] else [ ]) ++ (if home-manager.enable then [
(import ./home-manager-config.nix {
(import ./home-manager/common.nix {
user = user;
homeMangerVersion = home-manager.version;
hostName = hostName;
@@ -4,9 +4,13 @@
# Nix core
system.stateVersion = systemStateVersion;
nixpkgs.config.allowUnfree = true;
services.hydra.useSubstitutes = true;
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
substituters = [
"https://cache.nixos.org"
"https://cache.flox.dev"
"https://devenv.cachix.org"
];
trusted-substituters = [
"https://cache.flox.dev"
"https://devenv.cachix.org"
@@ -17,37 +21,22 @@
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
];
};
# Set your time zone.
time.timeZone = "America/Toronto";
# Select internationalisation properties.
i18n.defaultLocale = "en_CA.UTF-8";
# System Packages
programs.zsh.enable = true;
programs.nix-ld.enable = true;
environment.systemPackages = with pkgs; [
# nix utils
nix-index
nil
cachix
nixpkgs-fmt
nix-serve
# shell tools
wget
# misc
glib
glibc
];
# Storage Optim
nix.optimise.automatic = true;
nix.optimise.dates = [ "01:00" ];
services.cron = {
enable = true;
systemCronJobs = [
"* 23 * * * root nix-collect-garbage --delete-older-than 1d"
"* 23 * * * ${user.name} nix-collect-garbage --delete-older-than 1d"
];
};
}
-12
View File
@@ -1,12 +0,0 @@
{ user
, systemStateVersion
}:
{ ... }:
{
imports = [
(import ./core.nix {
user = user;
systemStateVersion = systemStateVersion;
})
];
}
+23
View File
@@ -1,8 +1,15 @@
{ user }:
{ pkgs, ... }:
{
# System Packages
services.hydra.useSubstitutes = true;
services.flatpak.enable = true;
services.nix-serve = {
enable = true;
port = 5000;
};
programs.dconf.enable = true;
programs.nix-ld.enable = true;
environment.systemPackages = with pkgs; [
# nix utils
appimage-run
@@ -17,6 +24,8 @@
# misc
glib-networking
glib
glibc
# printer
system-config-printer
@@ -24,4 +33,18 @@
services.xserver.excludePackages = with pkgs; [
xterm
];
# Set your time zone.
time.timeZone = "America/Toronto";
# Select internationalisation properties.
i18n.defaultLocale = "en_CA.UTF-8";
# Storage Clean up
services.cron = {
enable = true;
systemCronJobs = [
"* 23 * * * root nix-collect-garbage --delete-older-than 1d"
"* 23 * * * ${user.name} nix-collect-garbage --delete-older-than 1d"
];
};
}
@@ -11,7 +11,9 @@
{ pkgs, ... }:
{
imports = [
./core.nix
(import ./core.nix {
user = user;
})
./rootUser.nix
(import ./user.nix {
user = user;
+18 -15
View File
@@ -1,18 +1,21 @@
{ enableSSHServer, user }:
{ ... }:
{
services.openssh = if enableSSHServer then {
enable = true;
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
settings.PermitRootLogin = "yes";
} else {
enable = false;
};
users.users.${user.name}.openssh.authorizedKeys.keys = if enableSSHServer then [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuatskL9qXvgvS3E8zRwosFnpcN0f8PkKl8syAvpn297V2iPk6mi8yK3EE7xPpxaKKlwUuBHDj3BNUCoLgdRFKUgroRDzr3BMm+gZTHy6CuEZBY9zBRTmH+aOV6FZ96QPW4zba0BW5YPkPNy/FhYibjpXyZ3nX4/LWSbPKQJ7wTnUJZgq4VFmevBOttvhzUJUgTziMFsGXn6I38fAi6LI8qwI+zOOdsNjtKgr/TIlO/7VqcH7GYnQEwlthl577sDd1V6+XWz649qoiBYyq0Ahm09dwYx2iGQwLo8IYFbSy4aJRK/PI0+ytnPBoF5QCl+ILb5E8uV3e6Wb9WpXl9Hv2iLx91/9iq5hykHPnfVtkq3MK0C2vqkvX1qFOIkKM7vmxvXGbaDZDGK3G+/zkQ7GUw8ydbl9wGwE9cKbm9miqs4w2Ry/+3IZasE6G2TI97bSzSYInQd2RwoglqBOaJojbUqgI9wvNdKxGhADNFbZah2+s6SSe1ByQRN3b9wtmqu0= ari@shared"
] else [];
users.users.root.openssh.authorizedKeys.keys = if enableSSHServer then [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuatskL9qXvgvS3E8zRwosFnpcN0f8PkKl8syAvpn297V2iPk6mi8yK3EE7xPpxaKKlwUuBHDj3BNUCoLgdRFKUgroRDzr3BMm+gZTHy6CuEZBY9zBRTmH+aOV6FZ96QPW4zba0BW5YPkPNy/FhYibjpXyZ3nX4/LWSbPKQJ7wTnUJZgq4VFmevBOttvhzUJUgTziMFsGXn6I38fAi6LI8qwI+zOOdsNjtKgr/TIlO/7VqcH7GYnQEwlthl577sDd1V6+XWz649qoiBYyq0Ahm09dwYx2iGQwLo8IYFbSy4aJRK/PI0+ytnPBoF5QCl+ILb5E8uV3e6Wb9WpXl9Hv2iLx91/9iq5hykHPnfVtkq3MK0C2vqkvX1qFOIkKM7vmxvXGbaDZDGK3G+/zkQ7GUw8ydbl9wGwE9cKbm9miqs4w2Ry/+3IZasE6G2TI97bSzSYInQd2RwoglqBOaJojbUqgI9wvNdKxGhADNFbZah2+s6SSe1ByQRN3b9wtmqu0= ari@shared"
] else [];
}
services.openssh =
if enableSSHServer then {
enable = true;
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
settings.PermitRootLogin = "yes";
} else {
enable = false;
};
users.users.${user.name}.openssh.authorizedKeys.keys =
if enableSSHServer then [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuatskL9qXvgvS3E8zRwosFnpcN0f8PkKl8syAvpn297V2iPk6mi8yK3EE7xPpxaKKlwUuBHDj3BNUCoLgdRFKUgroRDzr3BMm+gZTHy6CuEZBY9zBRTmH+aOV6FZ96QPW4zba0BW5YPkPNy/FhYibjpXyZ3nX4/LWSbPKQJ7wTnUJZgq4VFmevBOttvhzUJUgTziMFsGXn6I38fAi6LI8qwI+zOOdsNjtKgr/TIlO/7VqcH7GYnQEwlthl577sDd1V6+XWz649qoiBYyq0Ahm09dwYx2iGQwLo8IYFbSy4aJRK/PI0+ytnPBoF5QCl+ILb5E8uV3e6Wb9WpXl9Hv2iLx91/9iq5hykHPnfVtkq3MK0C2vqkvX1qFOIkKM7vmxvXGbaDZDGK3G+/zkQ7GUw8ydbl9wGwE9cKbm9miqs4w2Ry/+3IZasE6G2TI97bSzSYInQd2RwoglqBOaJojbUqgI9wvNdKxGhADNFbZah2+s6SSe1ByQRN3b9wtmqu0= ari@shared"
] else [ ];
users.users.root.openssh.authorizedKeys.keys =
if enableSSHServer then [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuatskL9qXvgvS3E8zRwosFnpcN0f8PkKl8syAvpn297V2iPk6mi8yK3EE7xPpxaKKlwUuBHDj3BNUCoLgdRFKUgroRDzr3BMm+gZTHy6CuEZBY9zBRTmH+aOV6FZ96QPW4zba0BW5YPkPNy/FhYibjpXyZ3nX4/LWSbPKQJ7wTnUJZgq4VFmevBOttvhzUJUgTziMFsGXn6I38fAi6LI8qwI+zOOdsNjtKgr/TIlO/7VqcH7GYnQEwlthl577sDd1V6+XWz649qoiBYyq0Ahm09dwYx2iGQwLo8IYFbSy4aJRK/PI0+ytnPBoF5QCl+ILb5E8uV3e6Wb9WpXl9Hv2iLx91/9iq5hykHPnfVtkq3MK0C2vqkvX1qFOIkKM7vmxvXGbaDZDGK3G+/zkQ7GUw8ydbl9wGwE9cKbm9miqs4w2Ry/+3IZasE6G2TI97bSzSYInQd2RwoglqBOaJojbUqgI9wvNdKxGhADNFbZah2+s6SSe1ByQRN3b9wtmqu0= ari@shared"
] else [ ];
}