Configurations for NixOS and Nix Package Manager
Setup by cloning the repository into /etc/nixos.
sudo git clone https://github.com/PrestonHager/nixos-configs.git /etc/nixosGenerate the hardware configuration file. Copy the hardware configuration file to the correct location.
cd /etc/nixos
sudo nixos-generate-config
sudo cp hardware-configuration.nix nixos/hardware-configuration.nixYou can remove the configuration.nix file that was generated by the previous
command. It will not be used. Then rebuild the nixos system using flakes.
sudo nixos-rebuild switch --flake /etc/nixos#gnomeThere are three different flakes you can generate configs from. headless,
gnome, and i3 each corresponding to different desktop environments. To
change the configuration, place the desired flake configuration after the #
in the --flake option of the nixos-rebuild command. For example, to build a
headless system run the following:
sudo nixos-rebuild switch --flake /etc/nixos#headlessYou may want to customize the username, config files, etc. To do this, edit the
username in configuration.nix. Then either copy the files from
users/prestonh to users/yourusername or create an empty directory and copy
users/prestonh/home.nix (and dependancies) into it.
The current implementation of users/prestonh/home.nix contains the following
programs and configurations:
- Many CLI tools to aid in speedy development including:
- Neovim with the lazy plugin manager
- Brave browser, if a desktop environment is setup. You can change this to any chromium-based browser.
- Git configuration in the
home-porgrams.nixfile with email, name, etc. - Supplimental programs, which can be commented/uncommented as necessary in
the
user-packages.nixfile:- gcc toolchain
- Python 3.13 and Poetry
- NodeJS and nodenv
- GitHub's GLI
- GNU PG
You may want to change the remote to use SSH instead of HTTPS. This will of course require SSH keys to be setup with your GitHub account as well.
sudo git remote set-url origin git@github.com:PrestonHager/nixos-configs.gitReplace PrestonHager with your GitHub username after you have forked the
repository.