Skip to content

mantas6/dots

Repository files navigation

dots

dotfiles

Setup

Clone the repo and link

git clone https://github.com/mantas6/dots.git "$HOME/.dots"
cd "$HOME/.dots"
./bin/dot/stw

If stow fails, remove conflicting files (preferably to trash) and run again. Pay close attention to the output to make sure that the links that it creates make sense.

Create NixOS ISO

nix run nixpkgs#nixos-generators -- --format iso --flake '#iso'

Install NixOS

Normal setup:

nix run nixpkgs#nixos-anywhere -- \
    --flake ".#__host__" \
    --generate-hardware-config nixos-generate-config nix/hosts/__host__/hardware.nix \
    --target-host "root@__host__"

Encrypted setup:

nix run nixpkgs#nixos-anywhere -- \
    --flake ".#__host__" \
    --disk-encryption-keys /tmp/secret.key <(pass "hosts/__host__") \
    --generate-hardware-config nixos-generate-config nix/hosts/"__host__"/hardware.nix \
    --target-host "root@__host__"

Deploy NixOS on the network

nixos-rebuild --flake .#__host__ --target-host root@__host__ switch

Rescue

Upgrade out-dated dotfiles

Run when need to migrate old version of dotfiles structure

cd "$HOME/.dots"
./bin/dot/stw -D
git pull
./bin/dot/stw

Reinstall bootloader for NixOS

sudo nixos-rebuild --install-bootloader switch --flake .

Reset Neovim state

trash "$HOME/.local/share/nvim" "$HOME/.local/state/nvim" "$HOME/.cache/nvim"

MacOS

Setup

To initialize new environment run:

git clone https://github.com/mantas6/dots.git "$HOME/.dots"
cd "$HOME/.dots"
./bin/mac/rebuild-macos-env brew

Restart the shell and run stow:

cd "$HOME/.dots"
./bin/dot/stw

Run the script again to continue setup:

rebuild-macos-env init

Brew

Update all packages:

brew bundle upgrade --global

Clean up removed packages:

brew bundle cleanup --global

Misc

Stress testing

Run stress test on the CPU:

nix run nixpkgs#stress-ng -- -c0

Monitor temperatures:

nix run nixpkgs#s-tui

Secrets management

Edit/create a secret:

agenix -e lib/secrets/__name__.age

After saving update the secrets.nix

Rekey secrets

agenix --rekey

Get host key

ssh-keyscan __host__

Troubleshooting auto-upgrade

Check that automatic system upgrades run successfully.

Force an automatic system upgrade:

systemctl start nixos-upgrade

Check the upgrade log:

systemctl status nixos-upgrade.service

Or, to see the full log:

journalctl -u nixos-upgrade.service

To see the status of the upgrade timer:

systemctl status nixos-upgrade.timer

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Contributors