My personal cheatsheet for Nix OS Installation.
- download latest ISO and verify checksums
- scripts to install, snapper setup
I usually set bigger font with setfont ter-v32n
:
sudo -i
(can usenixos-help
for manual)- TODO!! update for networking
connecting with Ethernet or mobile USB tethering is enabled by default
I install Nix on my ~233G SSD.
- i prefer
gdisk
ef00
for fat32 fstype
nvme0n1 | fstype | size | mount point | Label |
---|---|---|---|---|
nvme0n1p1 | fat32 | 550M | /boot/efi | EFI |
nvme0n1p2 | btrfs | 232G | / /home /var/log /.snapshots /var/cache/pacman/pkg |
BTRFS |
nvme0n1p2
remaining size. ~232Glater set up
zram
install git, neovim
nix-env -f '<nixpkgs>' -iA neovim
nix-env -f '<nixpkgs>' -iA git
git clone https://github.com/alokshandilya/nixos-install-scripts.git
all scripts are executable but still have a glance on the commands and modify accordingly
./1-format_mount.sh
- run ๐
./1-format_mount.sh
- formats the partitions
- makes btrfs subvolumes
- mounts the partitions
- generates fstab based on UUIDs (remove subvolid later from
/etc/fstab
)
-
nixos-generate-config --root /mnt
-
nvim /mnt/etc/nixos/configuration.nix
, manually add mount options -
nixos-install
-
nixos-generate-config --show-hardware-config
doesn't detect mount options automatically, so to enable compression, you must specify it and other mount options in a persistent configuration:
fileSystems = {
"/".options = [ "defaults,noatime,compress=zstd,discard=async,space_cache=v2,autodefrag" ];
"/home".options = [ "defaults,noatime,compress=zstd,discard=async,space_cache=v2,autodefrag" ];
"/nix".options = [ "defaults,noatime,compress=zstd,discard=async,space_cache=v2,autodefrag" ];
"/.snapshots".options = [ "defaults,noatime,compress=zstd,discard=async,space_cache=v2,autodefrag" ];
};
- TODO!!! update it with your nix configuration file
- update the configuration file
- If you want to use GRUB, set boot.loader.grub.device to nodev and boot.loader.grub.efiSupport to true. With systemd-boot, you should not need any special configuration to detect other installed systems. With GRUB, set boot.loader.grub.useOSProber to true, but this will only detect windows partitions, not other Linux distributions. If you dual boot another Linux distribution, use systemd-boot instead.
./2-base-install.sh
- edit
/etc/default/grub
blkid > blkit.txt
:vs :bp :bn in vim/etc/default/grub
- note
nvme0n1p2
(partition with subvolumes) UUID
- note
GRUB_CMDLINE_LINUX=cryptdevice=UUID=xxxxx:cryptroot rootfstype=btrfs
grub-mkconfig -o /boot/grub/grub.cfg
run ๐
3-touchpad.sh
if to use Window Manager (on laptop) to enable trackpad reverse scrolling etc.
- edit
/etc/mkinitcpio.conf
MODULES=(btrfs crc32c-intel intel_agp i915 nvidia)
HOOKS=(.... encrypt filesystems fsck)
mkinitcpio -P
- do
exit
,umount -a
,reboot
- connect to wifi with
nmtui
./4-dwm-install.sh
- reboot
- run ๐
5-packages-AUR.sh
- AURs are commented
- install rest of the packages
cd ~/arch-install-scripts
paru -S stow
paru -S --needed - < pkglist.txt
4-dwm-install
script also installs paru
git clone https://github.com/alokshandilya/dotfiles.git
git clone https://github.com/alokshandilya/nvim.git ~/.config/nvim
cd dotfiles
mkdir -p ~/.local/share/applications
mkdir -p ~/.local/bin/scripts
mkdir -p ~/.local/bin/dwmblocks
stow .
su -
touch /etc/sysctl.d/99-swappiness.conf
echo "vm.swappiness=1" >> /etc/sysctl.d/99-swappiness.conf
- reboot
- fish
- fnm
fnm ls-remote
- install node, npm
npm i -g prettier typescript typescript-language-server live-server
- git
git config --global core.editor nvim
git config --global user.name "your_name"
git config --global user.email "[email protected]"
ssh-keygen -t ed25519 -C "[email protected]"
bash
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
exit
cat ~/.ssh/id_ed25519.pub
# Then select and copy the contents of the id_ed25519.pub file
# displayed in the terminal to your clipboard
Github
$\to$ SSH and GPG keys$\to$ Add new$\to$ Title (Personal Arch Linux)$\to$ Key (paste)
-
setup
nvim
v
alias for nvim
-
setup
sdkman
for fish
curl -s "https://get.sdkman.io" | bash
# path already set in my fish config
# install omf
curl https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install | fish
omf install sdk
sdk ls java
sdk install java #version
- nvim
jdtls
from:LspInstallInfo
pip install pynvim
git clone [email protected]:alokshandilya/nvim.git ~/.config/nvim
mkdir -p ~/.local/share/fonts/nvim-fonts
cp -r ~/.config/nvim/fonts ~/.local/share/fonts/nvim-fonts
paru -S --needed google-java-format
git clone [email protected]:microsoft/java-debug.git ~/.config/nvim/java-debug
cd ~/.config/nvim/java-debug
./mvnw clean install
git clone [email protected]:microsoft/vscode-java-test.git ~/.config/nvim/vscode-java-test
cd ~/.config/nvim/vscode-java-test
npm i
npm run build-plugin