Files
samfelag/README.org
2022-11-24 01:30:43 +01:00

83 lines
2.7 KiB
Org Mode

* Installing
** Fresh system (nixos USB drive)
1. Open a nix-shell with git (if not installed):
#+BEGIN_SRC bash
nix-shell -p git
#+END_SRC
2. Clone the flake
#+BEGIN_SRC bash
git clone https://git.lajuntament.space/marc/samfelag.git
#+END_SRC
3. Partition the disk
1. Locate the disk
#+BEGIN_SRC bash
lsblk
#+END_SRC
2. Create a GPT partition table
#+BEGIN_SRC bash
sudo parted /dev/nvme0n1 -- mklabel gpt
#+END_SRC
3. Create the root partition
#+BEGIN_SRC bash
sudo parted /dev/nvme0n1 -- mkpart primary 512MB -8GB
#+END_SRC
4. Create the swap partition
#+BEGIN_SRC bash
sudo parted /dev/nvme0n1 -- mkpart primary linux-swap -8GB 100%
#+END_SRC
5. Create the boot partition
#+BEGIN_SRC bash
sudo parted /dev/nvme0n1 -- mkpart ESP fat32 1MB 512MB
sudo parted /dev/nvme0n1 -- set 3 esp on
#+END_SRC
4. Format the partitions
1. Root partition
#+BEGIN_SRC bash
sudo mkfs.ext4 -L nixos /dev/nvme0n1p1
#+END_SRC
2. Swap partition
#+BEGIN_SRC bash
sudo mkswap -L swap /dev/nvme0n1p2
#+END_SRC
3. Boot partition
#+BEGIN_SRC bash
sudo mkfs.fat -F 32 -n BOOT /dev/nvme0n1p3
#+END_SRC
5. Mount the filesystems
1. Root partition
#+BEGIN_SRC bash
sudo mount /dev/disk/by-label/nixos /mnt
#+END_SRC
2. Boot partition
#+BEGIN_SRC bash
sudo mkdir -p /mnt/boot
sudo mount /dev/disk/by-label/BOOT /mnt/boot
#+END_SRC
3. Swap partition (if needed)
#+BEGIN_SRC bash
sudo swapon /dev/disk/by-label/swap
#+END_SRC
6. Create the host nix configuration
If the host is not present under system/hosts, create a new folder for the host.
Generate the hardware configuration file, you can use nixos-generate-config as a base:
#+BEGIN_SRC bash
nixos-generate-config --dir <<host directory>> --no-filesystems
#+END_SRC
7. Install nixos!
#+BEGIN_SRC bash
sudo nixos-install --impure --root /mnt --flake '.#reykjavik'
#+END_SRC
8. Set up the user
You'll set the root password during the installation. You can then reboot and use the installed OS. First thing you'll have to do is log in as root and set the password for your user:
#+BEGIN_SRC bash
passwd marc
#+END_SRC
* Rebuilding
#+BEGIN_SRC bash
sudo nixos-rebuild switch --impure --flake '.#reykjavik'
#+END_SRC
* Modules
** Desktop environment
*** Themeing
We use [[https://github.com/Misterio77/nix-colors][nix-colors]] to (try to) keep a consistent theme across all applications. This uses [[https://github.com/chriskempson/base16][base-16 themes]] (here is a [[https://github.com/chriskempson/base16/blob/main/styling.md][styiling guide]] for it).