[nixos] Add small bootstrapper for new hosts

This commit is contained in:
Sebastian Schulze 2022-12-20 10:48:24 +01:00
parent c7182baef7
commit bed887baa4
No known key found for this signature in database
GPG Key ID: F6BA63C6A7D3044E
2 changed files with 23 additions and 0 deletions

18
bootstrap/bootstrap.sh Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
if [[ $UID != 0 ]]; then
echo "Please run me as root"
exit 1
fi;
CHEZMOI_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )/../" &> /dev/null && pwd )
mkdir -p /root/.config/fish
ln -sfn "${CHEZMOI_DIR}/dot_config/nixos" /etc/nixos
cp "${CHEZMOI_DIR}/bootstrap/root.config.fish" /root/.config/fish/config.fish
git config --global credential.helper store
pushd /etc/nixos
nix flake update
nixos-rebuild switch --upgrade

View File

@ -0,0 +1,5 @@
set fish_greeting
if status is-interactive
set -x LC_ALL en_US.UTF-8
set -x LC_CTYPE en_US.UTF-8
end