Distro | NixOS |
WM | Hyprland |
Bar | Waybar |
Editor | Helix + Tmux |
FileManager | yazi |
WP-Manager | swww |
Keyboard | tbk_mini-QMK |
.
├── doc
│ ├── assets: Static files like images for documentation.
│ └── notes: Markdown notes.
├── hosts
│ ├── laptop: Laptop configuration (system and hardware settings).
│ └── vm: Virtual machine configuration (system and hardware settings).
├── pkgs
│ ├── derivations: Nix derivations for srcs.
│ └── src: Source code for derivations.
├── secrets: Tokens and certificates.
├── overlay.nix: Custom Nix package overlays.
└── users
└── emre: User-specific configurations.
- Boot a nixos ISO.
sudo cp ./nixos-minimal-24.11.714287.a45fa362d887-x86_64-linux.iso /dev/sdb
- Become a root user:
sudo su
- Go to home:
cd
- Find out the disk you want to install nixos to:
lsblk
- Create a disko layout, or borrow someone elses layout:
- Get all layouts in this repo.
git clone https://github.com/hakan-demirli/dotfiles
- Get all layouts in this repo.
- Format the disk using disko:
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko ./dotfiles/hosts/vm/hardware/disko.nix --arg device '"/dev/vda"'
- Obtain a new hardware-configuration.nix for your device
- Generate nixos config:
sudo nixos-generate-config --no-filesystems --root .
- Generate nixos config:
- Create a new host dir for your device and copy hardware-configurations.nix there:
cp ./etc/nixos/hardware-configuration.nix ./dotfiles/hosts/vm/hardware
- Install nixos:
nixos-install --root /mnt --flake ./dotfiles/.#vm
- Reboot
reboot
sudo nixos-rebuild switch --flake ./.#laptop
sudo nixos-rebuild build --flake ~/Desktop/dotfiles/#laptop
nix-shell -p openssl
read -sp "Enter passphrase: " password && echo && (head -c8 ~/Desktop/dotfiles/secrets/git-crypt-key | grep -q '^Salted__' || { echo "File does not appear encrypted."; exit 1; }) && (openssl enc -d -aes-256-cbc -pbkdf2 -in ~/Desktop/dotfiles/secrets/git-crypt-key -out /tmp/git-crypt-key -pass pass:"$password" && echo "Decryption complete.") && unset password
cd ~/Desktop/dotfiles/ && git-crypt unlock /tmp/git-crypt-key && ln -s ~/Desktop/dotfiles/secrets/{git_tokens,git_users,git_keys} ~/.config/git/ && ln -s ~/Desktop/dotfiles/secrets/.ssh ~/.ssh