1.1 KiB
1.1 KiB
NixOS Configuration Files wit Flakes, Home-Manager
Description
My NixOS configuration repository
Install a new host
- Install NixOS with graphical ISO image (e.g. GNOME). During the installation the desktop environment can be choosen.
- Reboot into NixOS
- Edit
/etc/nixos/configuration.nixwith sudoedit a) Change hostname b) Enable flakes. Add the following lines:
# Enable flakes
nix.settings.experimental-features = [ "nix-command" "flakes" ];
c) Install tmux, neovim, git by adding them to `environment.systemPackages = with pkgs; [`
- Apply changes:
sudo nixos-rebuild switchand reboot - Clone NixOS config repository to /home/$USER/nixos:
cd
git clone https://git.plueschbit.de/jan/nixos-conf ~/nixos
- Add the new host to repository
a) Create ~/nixos/hosts/$HOSTNAME
b)
cp /etc/nixos/*.nix $HOSTNAME/.c) Edit~/nixos/flake.nixand add section for new host d) Stage new config files:git add flake.nix hosts/$HOSTNAME/*. Otherwise, nixos-rebuild will refuse to work with the files. - Apply config:
sudo nixos-rebuild ~/nixos/$HOSTNAME