This is a public version of my Nix-OS setup. It is similar to my private setup with a few alterations.
This will install barebones i3wm with light-dm/slick-greeter. You can comment in and out whichever included desktop environment or window manager that you'd like. I will also be adding Sway and KDE nix files soon.
IMPORTANT: If you already have a full setup, then make sure that you have all of your nix files backed up. This can replace users and other important settings.
I am going to convert my docker-compose files to nix files. Also, converting bash files to nix as well.
nix-shell -p git
cd ~
git clone https://github.com/TheTechRun/public-nixos
mv ~/public-nixos ~/nixos-config
find ~/nixos-config/ -type f -name "*.sh" -exec chmod +x {} +
sudo sed -i '$ i\ # Enable flakes.\n nix.settings.experimental-features = [ "nix-command" "flakes" ];\n' /etc/nixos/configuration.nix
cd /etc/nixos/
sudo nixos-rebuild switch
sudo cp /etc/nixos/hardware-configuration.nix ~/nixos-config/modules/system/hardware-configuration.nix
sudo ln -sf ~/nixos-config/flake.nix /etc/nixos/flake.nix
sudo nixos-rebuild switch --flake $HOME/nixos-config
nix-shell -p git
cd ~
git clone https://github.com/TheTechRun/public-nixos
mv ~/public-nixos/ ~/nixos-config
sudo sed -i '$ i\ # Enable flakes.\n nix.settings.experimental-features = [ "nix-command" "flakes" ];\n' /etc/nixos/configuration.nix
cd /etc/nixos/
sudo nixos-rebuild switch
sudo cp /etc/nixos/hardware-configuration.nix ~/nixos-config/modules/system/hardware-configuration.nix
sudo ln -sf ~/nixos-config/flake.nix /etc/nixos/flake.nix
find ~/nixos-config/ -type f -name "*.sh" -exec chmod +x {} +
sudo nixos-rebuild switch --flake $HOME/nixos-config
You need to go to ~/nixos-config/modules/system/configuration.nix and comment out the systemD
bootloader lines and uncomment the grub
bootloader lines.
sudo nixos-rebuild switch --flake $HOME/nixos-config
username:nixuser
password: abcde12345