❗ This Repository is for my Learning Purposes ❗
This repository will probably never be finished. This repository was created soley for my learning purposes. Please don't use this for your main config setup unless you know what you're doing. Use this Repo at your own risk
-
- System / Userspace Configuration:
- Partition Configuration::
-
-
- VFIO
- Setup Working
virt-manager
withlibvirt
/qemu
backend - Setup Backend Passthrough (e.g. Grub configs, enable
vfio-pci
, passthrough & blacklist hardware) - Setup a VFIO Branch or seperate optional
.nix
config file <-~~
- Setup Working
- Setup Nix Home Manager
- Setup
Flatpak
- Make
Flatpak
Declarative.
- Make
- Setup
Docker
- Setup
Podman
- Setup
Distrobox
- VFIO
- Implement system & user configuration file creation in
configuration.nix
- Test operating system reinstallation with said configuration files, and make sure they work.
- Make sure all configs are replicatable on Physical and Virtual Hardware
- Remove
changed-files/
crutch after system is replicatable elsewhere. - Setup
coolercontrol
as system is overheating with current lack of AIO control.
-
-
Information in this section is based on the following NixOS Wiki Page on Manually installing on BTRFS: https://nixos.wiki/wiki/Btrfs
-
- I suggest you use Gparted. This will be automated in the future.
-
Replace "device" with your device name. You can find your device name via running:
lsblk -f
sudo mount /dev/<device> /mnt
cd /mnt
-
This is a Multi-line Command:
sudo btrfs subvol create @; \ sudo btrfs subvol create @home; \ sudo btrfs subvol create @root; \ sudo btrfs subvol create @var; \ sudo btrfs subvol create @nix
-
cd ~
sudo umount -Rv /mnt
-
Replace "
<device>
" with your device name (e.g: nvme0n1p1). You can find your device name via running:lsblk -f
.sudo mount -o subvol=@,compress=zstd:3,noatime /dev/<device> /mnt
- Then create recursive partitions:
dumb linux quirks...
sudo mkdir -pv /mnt/{home,root,var,nix,boot/efi}
- Continue to mount the rest of the partitions:
Replace "
<device>
" with your device name (e.g: nvme0n1p1). You can find your device name via running:lsblk -f
. This is a multi-line command which will mount all your partitions when you replace the first line with the correct device.DEVICE=<device>; \ sudo mount -o subvol=@home,compress=zstd:3 /dev/$DEVICE /mnt/home; \ sudo mount -o subvol=@root,compress=zstd:3 /dev/$DEVICE /mnt/root; \ sudo mount -o subvol=@var,compress=zstd:3,noatime /dev/$DEVICE /mnt/var; \ sudo mount -o subvol=@nix,compress=zstd:3,noatime /dev/$DEVICE /mnt/nix
- Mount EFI System Partition (EFI + GPT Only)
sudo mount /dev/<device> /mnt/boot/efi
-
-
-
sudo nixos-generate-config --root /mnt
This command generates the following 2 files:
configuration.nix
- Global NixOS Configuration File
hardware-configuration.nix
- Hardware Specific Configuration File -
The previous command re-generated an automatic
configuration.nix
- The Nix LiveCD (as of writing this) doesn't include
wget
. Install it.
sudo nix-env -iA nixos.wget
then grab the file:
cd /mnt/etc/nixos/
wget https://github.com/spongeyperson/nixos-dotfiles/blob/desktop/etc/nixos/configuration.nix
- The Nix LiveCD (as of writing this) doesn't include
-
- The previous command generated a
hardware-configuration.nix
, which is similar to your Operating Systems'fstab
file.
Here's my recommended mount options:
Warning:
/home
&/root
should not have the"noatime"
mount option.fileSystems."/" = { device = "/dev/disk/by-uuid/<device-uuid>"; fsType = "btrfs"; options = [ "subvol=@" "noatime" "ssd" "space_cache=v2" "compress=zstd:3" ]; }; fileSystems."/home" = { device = "/dev/disk/by-uuid/<device-uuid>"; fsType = "btrfs"; options = [ "subvol=@home" "ssd" "space_cache=v2" "compress=zstd:3" ]; }; fileSystems."/root" = { device = "/dev/disk/by-uuid/<device-uuid>"; fsType = "btrfs"; options = [ "subvol=@root" "ssd" "space_cache=v2" "compress=zstd:3" ]; }; fileSystems."/var" = { device = "/dev/disk/by-uuid/<device-uuid>"; fsType = "btrfs"; options = [ "subvol=@var" "noatime" "ssd" "space_cache=v2" "compress=zstd:3" ]; }; fileSystems."/nix" = { device = "/dev/disk/by-uuid/<device-uuid>"; fsType = "btrfs"; options = [ "subvol=@nix" "noatime" "ssd" "space_cache=v2" "compress=zstd:3" ]; };
- The previous command generated a
- Optional Tunables:
- In
hardware-configuration.nix
, You may have to configure this file to your needs, as obviously your extra drives will not be avaliable here. - You may also want to change the following line(s) in
global-vars.nix
near the beginning of the file.systemVariables = { ... vfioIDs = "10de:2204,10de:1aef"; vfioBlacklist = "nvidia,nvidiafb,nouveau"; # System Hostname hostname = "Spongey-PC"; # Fully Qualified (Local) Domain Name fqdn = "Spongey-PC.lan"; }; userVariables = { ... # User username = "tyler"; usershell = pkgs.fish; userid = 1000; # Locale / Localisation timeZone = "America/Los_Angeles"; # Set time zone. locale = "en_US.UTF-8"; # Select internationalisation properties. keymap = "us"; };
- In
-
-
sudo nixos-install --root /mnt
-
-
Note: I do not pretend to own any content on this git repository. All contents are copyright of their respective owners. This repository is intented for recreating Linux installs only. Content on this repository is installed at your own risk. If you have any legal issue with the content on this repository, please make a github issue and i will create a submodule linking to your project instead.