dotfiles/README.md

101 lines
2.3 KiB
Markdown
Raw Normal View History

2019-11-10 10:01:49 +00:00
My dotfiles - including my vim, terminal and font configs.
2021-04-03 09:54:58 +01:00
Mostly focusing on setting things up on NixOS, but supporting other OSes where possible.
2013-10-09 18:53:50 +01:00
2021-04-03 12:52:05 +01:00
## bootstrap new machine with NixOS:
2019-11-10 10:11:15 +00:00
2021-04-03 09:54:58 +01:00
1. boot the target machine from the livecd
2. change password for the default user `nixos`
3. ssh from another, already bootstrapped, machine
2021-04-11 08:54:23 +01:00
2021-04-11 10:25:32 +01:00
remote:
2021-04-11 08:54:23 +01:00
```bash
sudo su -
# `efibootmgr -b 000x -B` if you want to remove entry number x
yes | parted /dev/sda -- mklabel gpt
parted /dev/sda -- rm 1
parted /dev/sda -- rm 2
parted /dev/sda -- rm 3
parted /dev/sda -- rm 4
parted /dev/sda -- mkpart ESP fat32 1MiB 1GiB
parted /dev/sda -- set 1 esp on
parted /dev/sda -- mkpart primary 1GiB 100%
cryptsetup luksFormat /dev/sda2
```
2021-04-11 10:25:32 +01:00
remote:
2021-04-11 08:54:23 +01:00
```bash
cryptsetup luksOpen /dev/sda2 crypt
```
2021-04-11 10:25:32 +01:00
remote:
2021-04-11 08:54:23 +01:00
```bash
mkfs.fat -F 32 -n boot /dev/sda1
mkfs.btrfs -L nixos /dev/mapper/crypt
sleep 1
mount /dev/disk/by-label/nixos /mnt
mkdir -p /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot
nixos-generate-config --root /mnt
2021-04-11 10:25:32 +01:00
nixos-install
2021-04-11 09:28:06 +01:00
```
2021-04-11 10:25:32 +01:00
local:
2021-04-11 09:28:06 +01:00
```bash
2021-04-11 10:25:32 +01:00
tar -cvz . > ../dotfiles.tar.gz
scp ../dotfiles.tar.gz nixos@remote:/tmp
```
remote:
```bash
mkdir -p /mnt/home/cyryl/dev/dotfiles/
tar -xvf /tmp/dotfiles.tar.gz -C /mnt/home/cyryl/dev/dotfiles
cp /mnt/etc/nixos/hardware-configuration.nix /mnt/home/cyryl/dev/dotfiles/nixos/boxes/bootstrap/
ln -vfs /mnt/home/cyryl/dev/dotfiles/nixos/boxes/bootstrap/1.nix /mnt/etc/nixos/configuration.nix
2021-04-11 08:54:23 +01:00
nixos-install
2021-04-11 10:25:32 +01:00
reboot
```
ctrl-alt-f1 root login:
2021-04-11 10:25:32 +01:00
```bash
ln -vfs /home/cyryl/dev/dotfiles/nixos/boxes/bootstrap/2.nix /etc/nixos/configuration.nix
vim /home/cyryl/dev/dotfiles/nixos/boxes/bootstrap/2.nix
nixos-rebuild switch
passwd cyryl
chown cyryl -R /home/cyryl
reboot
2021-04-11 08:54:23 +01:00
```
2021-04-03 12:52:05 +01:00
gui-login as cyryl:
```bash
cd ~/dev/dotfiles/
mkdir -p nixos/boxes/HOSTNAME
cp nixos/boxes/bootstrap/2.nix nixos/boxes/HOSTNAME/default.nix
cp nixos/boxes/bootstrap/hardware-configuration.nix nixos/boxes/HOSTNAME/
2021-04-11 11:47:26 +01:00
sudo ln -vfs /home/cyryl/dev/dotfiles/nixos/boxes/HOSTNAME/default.nix /etc/nixos/configuration.nix
sudo nixos-rebuild switch --upgrade
reboot
```
2021-04-11 11:47:26 +01:00
```bash
ssh-keygen -t ed25519
2021-04-11 12:18:00 +01:00
# syncthing
# vault
2021-04-11 11:47:26 +01:00
# firefox sync
# bitwarden
# add key to sr.ht
cd ~/dev/dotfiles
git remote add git@git.sr.ht:~cyplo/dotfiles
git checkout nixos/boxes/bootstrap
```
2021-04-03 12:52:05 +01:00
## guix
I'm just starting to play with guix, these are just loose notes: