These configurations can be used differently to manage:
- the current user configuration;
- the system configuration;
- both system and user configurations at the same time.
This repository is hosted in my Gitea server and mirrored to GitHub.
- NixOS should be easy to reinstall and be ready to use — so that I no longer feel attached to my machines.
- Each host should have its own configuration file inside
./hosts
. - All frequently used boilerplate should be modularized in
./modules
so that a computer configuration is always clear and easy to be made intuitively. - A user should not be forced to use
home-manager
. Each user is responsible for using the system as wished (imperatively or declaratively). - Each user should be able to configure their own WM/GE without having to contact the system admin.
hosts
adam
configuration.nix
system.nix
hardware-config.nix
home.nix
: extra home-manager base config for this machine
users
marcosrdac
home.nix
: main home-manager user configurationhosts
: extra home-manager machine-specific user configurations (for machines that are not mine or are not running NixOS)
guest
vim
: just an easy to use neovim setup
overlays
: i.e.: my neovim configs and plugins as an overlaymodules
common
nixos
home-manager
You will need Nix
with Flakes
enabled to use my configurations, as well as git
.
nix-channel --update
nix-env -f '<nixpkgs>' -iA nixUnstable
nix-shell -p wget vim git
# or use below facilities
nix-shell -p wget vim git screen lf
git clone https://git.marcosrdac.com/marcosrdac/nixcfg.git $HOME/.config/home-manager
home-manager switch --flake "$HOME/.config/home-manager#$(hostname)-$(whoami)"
# i.e.: if my hostname is `adam` and my username is `marcosrdac`:
#home-manager switch --flake "$HOME/.config/home-manager#adam-marcosrdac"
Observation: host is defined in hosts
and my user configurations are defined in users/$USER
TODO add a placeholder for non-NixOS machines I might use
As super user:
git clone https://git.marcosrdac.com/marcosrdac/nixcfg.git /etc/nixos
Set your hostname: Flakes
will use it to setup the correct machine. Example for my adam
desktop:
hostname adam
Then to build the machine for the first time:
nixos-rebuild switch --flake "/etc/nixos#$(hostname)"
Start by configuring the system, then symlink /etc/nixos
to /home/$USER/home-manager
. Make the user part of nixcfg
group in the specific machine configuration, so that it can modify the configuration files without super powers.
ln -s /etc/nixos /home/$USER/.config/home-manager
Now, as a normal user, you can now run similar commands to user install section section's to configure your home space, except that $HOME/.config/home-manager
will become its original configuration directory (/etc/nixos
):
home-manager switch --flake "/etc/nixos#$(hostname)-$(whoami)"
# i.e.: if my hostname is `adam` and my username is `marcosrdac`:
home-manager switch --flake "/etc/nixos#adam-marcosrdac"
ssh-keygen -t rsa -b 4096
cat ~/.ssh/id_rsa.pub
Copy cat
output and paste it into a new SSH key with
Create new SSH access keys using cat output and entitle it username@hostname
, where username and hostname are your current ones.
To see current remotes:
git remote -v
To change to SSH:
git remote set-url origin [email protected]:marcosrdac/nixcfg.git
git config --global user.email "[email protected]"
git config --global user.name "Marcos Conceição"
# remove old home-manager generations
home-manager expire-generations 1d
# tip #1
nix-collect-garbage -d
# tip #2
sudo nix-store --optimise
You probably don't have enough RAM. Do the following to swap on file before system build:
SWAP_SIZE_MB=2048
sudo dd if=/dev/zero of=/swapfile bs=1M count=$SWAP_SIZE_MB status=progress
sudo chmod 0600 /swapfile
sudo mkswap -U clear /swapfile
# if above does not work, give partition UUID as argument to -U
#lsblk -f
# copy UUID and run command, i.e.:
#sudo mkswap -U 892b1061-772e-4b48-a2dc-e67cb5b7ebc7 clear /swapfile
sudo swapon /swapfile
nix-shell -p cloud-utils
lsblk
PARTITION_NUMBER=1
sudo growpart /dev/nvme0n1 $PARTITION_NUMBER
- Pinpox' configurations
- Jordan Isaacs' configurations
- Krutonium's configurations
- Misterio77's configurations
- Do not install fonts unless needed
- Make options in my
home-manager
modules (xorg vs wayland, etc). - Default python env should be easily accessable for data analysis stuff.
- I want to be able to install and use my WM configuration from any computer (use xinit and stuff, instead of xinit-hm).