Go to file
Cyryl Płotnicki 28c7af45d3 Minimal flake for darwin 2022-03-10 12:21:37 +00:00
.Slic3r slic3r version upgrade 2015-01-24 09:52:01 +01:00
.config re-pair the trackball 2021-05-28 19:09:38 +01:00
.github Update FUNDING.yml 2019-09-28 09:41:30 +01:00
guix add start of config 2022-03-04 14:57:06 +00:00
nixos Minimal flake for darwin 2022-03-10 12:21:37 +00:00
tools basic vault scripts added 2021-07-18 08:27:19 +01:00
.build.yml do not do flake check as it explodes on sourcehut 2022-03-05 11:17:06 +00:00
.gdbinit better gdb dashboard setup 2021-01-30 15:56:36 +00:00
.ghci ghci config added 2015-02-28 22:39:29 +01:00
.gitattributes Add windows debug tools (#93) 2017-01-19 10:03:34 +00:00
.gitconfig.cygwin Add windows debug tools (#93) 2017-01-19 10:03:34 +00:00
.gitconfig.linux Add basic Windows-specific git configs (#72) 2017-01-24 19:53:30 +00:00
.gitconfig.linux.form3 Change key signature for work 2020-10-16 17:06:41 +01:00
.gitconfig.linux.private use delta for git diff 2020-10-17 13:37:33 +01:00
.gitconfig.mac Add basic Windows-specific git configs (#72) 2017-01-24 19:53:30 +00:00
.gitconfig.windows Add basic Windows-specific git configs (#72) 2017-01-24 19:53:30 +00:00
.gitconfig_includes.common more more git config to nix 2020-08-01 08:33:33 +01:00
.gitconfig_includes.cygwin Add basic Windows-specific git configs (#72) 2017-01-24 19:53:30 +00:00
.gitconfig_includes.mac Add Mac support (#89) 2017-01-26 05:44:03 +00:00
.gitconfig_includes.windows Add basic Windows-specific git configs (#72) 2017-01-24 19:53:30 +00:00
.gitignore remove printer 2020-12-22 16:24:12 +00:00
.gitmodules remove submodule 2020-08-01 10:44:53 +01:00
.vimrc cleanup vim config around formatting 2022-03-08 09:56:54 +00:00
.vimrc.filetypes cleanup vim config around formatting 2022-03-08 09:56:54 +00:00
.vimrc.keymap Refresh vim settings 2022-03-08 11:53:17 +00:00
.vimrc.plugins-settings Refresh vim settings 2022-03-08 11:53:17 +00:00
.vimrc.settings update neovim 2021-09-22 13:41:05 +01:00
INSTALL_MACOS.md Minimal flake for darwin 2022-03-10 12:21:37 +00:00
LICENSE Update LICENSE 2017-10-07 11:47:40 +01:00
README.md Fix home-manager config on ubuntu 2021-11-24 10:34:23 +00:00
flake.lock Minimal flake for darwin 2022-03-10 12:21:37 +00:00
flake.nix Minimal flake for darwin 2022-03-10 12:21:37 +00:00
shell.nix move duplicated setting to common.nix 2022-03-04 10:12:08 +01:00

README.md

My dotfiles - including my vim, terminal and font configs. Mostly focusing on setting things up on NixOS, but supporting other OSes where possible.

bootstrap new machine with NixOS:

  1. boot the target machine from the livecd
  2. change password for the default user nixos
  3. ssh from another, already bootstrapped, machine

remote (sata + MBR):

sudo su -
parted /dev/sda -- mklabel msdos
parted /dev/sda -- rm 1
parted /dev/sda -- rm 2
parted /dev/sda -- rm 3
parted /dev/sda -- rm 4
parted /dev/sda -- mkpart primary 1MiB 1GiB
parted /dev/sda -- mkpart primary 1GiB 100%
cryptsetup luksFormat /dev/sda2

remote (sata):

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

remote (nvme):

sudo su -
# `efibootmgr -b 000x -B` if you want to remove entry number x
yes | parted /dev/nvme0n1 -- mklabel gpt
parted /dev/nvme0n1 -- rm 1
parted /dev/nvme0n1 -- rm 2
parted /dev/nvme0n1 -- rm 3
parted /dev/nvme0n1 -- rm 4
parted /dev/nvme0n1 -- rm 5
parted /dev/nvme0n1 -- mkpart ESP fat32 1MiB 1GiB
parted /dev/nvme0n1 -- set 1 esp on
parted /dev/nvme0n1 -- mkpart primary 1GiB 100%
cryptsetup luksFormat /dev/nvme0n1p2

remote (sata):

cryptsetup luksOpen /dev/sda2 crypt

remote (nvme):

cryptsetup luksOpen /dev/nvme0n1p2 crypt

remote (sata+MBR):

mkfs.ext2 /dev/sda1 -L boot

remote (sata + GPT):

mkfs.fat -F 32 -n boot /dev/sda1

remote (nvme + GPT):

mkfs.fat -F 32 -n boot /dev/nvme0n1p1

remote (sata):

mkfs.btrfs -L nixos /dev/mapper/crypt
cryptsetup luksClose crypt
cryptsetup luksOpen /dev/sda2 crypt
mount /dev/disk/by-label/nixos /mnt
mkdir -p /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot
nixos-generate-config --root /mnt

remote (nvme):

mkfs.fat -F 32 -n boot /dev/nvme0n1p1
mkfs.btrfs -L nixos /dev/mapper/crypt
cryptsetup luksClose crypt
cryptsetup luksOpen /dev/nvme0n1p2 crypt
mount /dev/disk/by-label/nixos /mnt
mkdir -p /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot
nixos-generate-config --root /mnt

local:

tar -cvz . > ../dotfiles.tar.gz
scp ../dotfiles.tar.gz nixos@remote:/tmp

remote:

mkdir -p /mnt/home/cyryl/dev/dotfiles/
tar -xvf /tmp/dotfiles.tar.gz -C /mnt/home/cyryl/dev/dotfiles
# merge /mnt/etc/nixos/hardware-configuration.nix into /mnt/home/cyryl/dev/dotfiles/nixos/boxes/bootstrap/hardware-configuration.nix
nix-shell -p nixUnstable git
cd /mnt/home/cyryl/dev/dotfiles/
systemd-inhibit nixos-install --flake '.#bootstrap'
passwd cyryl
chown cyryl -R /home/cyryl
reboot

ctrl-alt-f1 cyryl login:

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/
sudo ln -vfs /home/cyryl/dev/dotfiles/nixos/boxes/HOSTNAME/default.nix /etc/nixos/configuration.nix
sudo nixos-rebuild switch --flake '.#HOSTNAME'
reboot
cd ~/dev/dotfiles/
nixos-install --flake '.#'
ssh-keygen -t ed25519
# syncthing
# vault
# firefox sync
# bitwarden
# add key to sr.ht
cd ~/dev/dotfiles
git checkout nixos/boxes/bootstrap

inspiration

things to check out

flakes

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};

outputs = { self, nixpkgs, ... }@inputs: {
nixosConfigurations = {
hyacinth = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
(import ./machines/hyacinth)
];
specialArgs = { inherit inputs; };
};

Ubuntu

sudo apt install git vim curl
curl -L https://nixos.org/nix/install | sh

make sure

if [ -e /home/cyryl/.nix-profile/etc/profile.d/nix.sh ]; then . /home/cyryl/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer
export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH
``` is in `~/.profile`


reboot


nix-shell '' -A install


mkdir dev cd dev git clone https://git.sr.ht/~cyplo/dotfiles cd dotfiles



ln -vfs /home/cyryl/dev/dotfiles/nixos/home-other-os.nix /home/cyryl/.config/nixpkgs/home.nix home-manager switch



## guix

I'm just starting to play with guix, these are just loose notes: