Available combinations are:
- Wayland + sway on XPS 13 9310 (my current active setup)
- Xorg + i3 on XPS 13 9310
- Wayland + sway on XPS 13 9370
- Xorg + i3 on XPS 13 9370
9370 configuration is not supported anymore as I don't own this device.
The branches preserved only for historical purpose.
9310/sway is my daily driver (Xorg is no longer supported and left for potential
fallback in case of urgent need or annoying behavior, that I'm now thinking about
will not likely be the case)
- Boot from NixOS live USB preferably
parted /dev/nvme0n1 -- mklabel gpt
parted /dev/nvme0n1 -- mkpart ESP fat32 1MiB 512MiB
parted /dev/nvme0n1 -- set 1 boot on
parted /dev/nvme0n1 -- mkpart primary 512MiB 100%
cryptsetup luksFormat /dev/nvme0n1p2
cryptsetup luksOpen /dev/nvme0n1p2 luks
pvcreate /dev/mapper/luks
vgcreate xps /dev/mapper/luks
lvcreate -L 16G xps -n swap
lvcreate -l 100%FREE xps -n nixos
sudo mkfs.fat -F 32 -n boot /dev/nvme0n1p1
sudo mkfs.ext4 -L nixos /dev/xps/nixos
sudo mkswap -L swap /dev/xps/swap
mount /dev/disk/by-label/nixos /mnt
mkdir -p /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot
swapon /dev/xps/swap
- Get the configuration
git clone https://github.com/ymatsiuk/nixos-config /mnt/etc/nixos/
- Edit
/mnt/etc/nixos/users.nixto adjust user. Use the following command for password hashnix-shell -p mkpasswd --run "mkpasswd -m sha-512" - Edit file systems config and luks device
nixos-generate-config --root /mnt --show-hardware-config
lsblk -f
- Enable flakes
- Install NixOS
nixos-install --flake path:.#nixps
What's inside:
-
NixOS:
- latest stable kernel from
nixpkgs-small - stable
nix - modules:
podmandocker(buildkit enabled)fonts(Iosevka, Source Sans Pro, Source Serif Pro)greetd(tuigreet)pipewirexdg-portal(screen sharing)zsh
- latest stable kernel from
-
Home-Manager:
alacritty(gruvbox theme)firefoxwith Wayland supportfootmain terminal (gruvbox theme)gammastepgit(rbwcredentials helper)gtk(gruvbox theme)i3status-rust(gruvbox theme)kanshi(switches to external output once connected)mako(gruvbox theme)neovim(gruvbox theme + lsp)starship(as shell prompt)sway(gruvbox theme)rbwfuzzelapplication launcher for Waylandwezterm(gruvbox theme)
Current directory and flake structure doesn't scale. I have to host my work configuration for mbp in a separate private repository - not ideal. The goal of refactoring is to modularize the configuration better to allow different architectures and centralize host management merging both repos. Proposed structure:
nixos/
├── flake.nix
├── flake.lock
├── hosts/
│ ├── nixps/
│ │ └── default.nix
│ ├── nixlab/
│ │ └── default.nix
│ ├── nixpi3/
│ │ └── default.nix
│ ├── nixpi4/
│ │ └── default.nix
│ └── mbp/
│ └── default.nix
├── modules/
│ ├── common/
│ │ ├── boot.nix
│ │ ├── dev-shells.nix
│ │ ├── networking.nix
│ │ ├── users.nix
│ │ └── packages.nix
│ ├── darwin/
│ │ ├── aerospace.nix
│ │ ├── homebrew.nix
│ │ ├── jankyborders.nix
│ │ └── defaults.nix
│ └── linux/
│ ├── apfs.nix
│ ├── greetd.nix
│ ├── home-assistant.nix
│ ├── obs.nix
│ ├── opengl.nix
│ ├── pipewire.nix
│ ├── tailscale.nix
│ ├── telegraf.nix
│ ├── upgrade-diff.nix
│ ├── zigbee2mqtt.nix
│ └── fonts.nix
└── home/
├── darwin/
│ └── i3status-rust.nix
├── linux/
│ ├── foot.nix
│ ├── gammastep.nix
│ ├── gtk.nix
│ ├── i3status-rust.nix
│ ├── kanshi.nix
│ ├── mako.nix
│ └── sway.nix
├── common/
│ ├── alacritty.nix
│ ├── firefox.nix
│ ├── gammastep.nix
│ ├── git.nix
│ ├── gtk.nix
│ ├── mcfly.nix
│ ├── neovim.nix
│ ├── rbw.nix
│ ├── starship.nix
│ ├── wezterm.nix
│ └── zoxide.nix
├── nixps.nix
├── nixlab.nix
├── nixpi3.nix
├── nixpi4.nix
└── mbp.nix
Notes:
default.nixlooks redundant,hosts/nixps.nixinstead ofhosts/nixps/default.nixhome/split intolinuxanddarwin, maybegraphics|guiandterminal|cli(?)- import modules/hm in
flake.nixper host or chain importsflake.nix -> hosts/nixps/default.nix -> modules/common/boot.nix ... - does
modules/commonmake sense even