1
0
Fork 0
NixOS config
Find a file
Jan Grosser a5d6c2ef21 Disabled powersafe for networkmanager
Disabled power safe for network manager in configuration.nix

Background is that the wifi adapter has bad performance when on battery
but no issues when running on AC power.

Unfortunately, this had no effect.

See: https://discourse.nixos.org/t/bad-wifi-performance-on-battery/49398
2024-07-23 20:27:37 +02:00
hosts Disabled powersafe for networkmanager 2024-07-23 20:27:37 +02:00
modules Removed config option sound 2024-07-15 21:06:02 +02:00
flake.lock Update 2024-07-21 11:37:19 +02:00
flake.nix Fixed some errors in flake.nix related to nixos-hardware 2024-07-21 09:14:38 +02:00
README.md Fixed README. No channel upgrade => set to unstable 2024-06-03 00:10:07 +02:00

NixOS Configuration Files wit Flakes, Home-Manager

Description

My NixOS configuration repository

Install a New Host

  1. Install NixOS with graphical ISO image (e.g. GNOME). During the installation the desktop environment can be choosen.
  2. Reboot into NixOS
  3. Edit /etc/nixos/configuration.nix with sudoedit
    • Change hostname
    • Enable flakes by adding the line nix.settings.experimental-features = [ "nix-command" "flakes" ];
    • Install tmux, neovim, git by adding them to environment.systemPackages = with pkgs; [
  4. Apply changes: sudo nixos-rebuild switch and reboot
  5. Clone NixOS config repository to /home/$USER/nixos:
cd $HOME
git clone https://git.plueschbit.de/jan/nixos-conf ~/nixos
  1. Add the new host to repository
    • Create ~/nixos/hosts/$HOSTNAME
    • cp /etc/nixos/*.nix $HOSTNAME/.
    • Edit ~/nixos/flake.nix and add section for new host
    • Stage new config files: git add flake.nix hosts/$HOSTNAME/*. Otherwise, nixos-rebuild will refuse to work with the files.
  2. Apply config: sudo nixos-rebuild switch --flake ~/nixos/#<host>

Update Packages on a Host

Update of the file flake.nix:

cd ~/nixos
sudo nix flake update

Then, perform nixos rebuild:

sudo nixos-rebuild switch --flake ~/nixos/#<host>

Upgrading to a new NixOS channel

In flake.nix the channel is set to unstable. Therefore, there is no need to upgrade the channel.

Garbage Collection

List all generations:

sudo nix-env --list-generations --profile /nix/var/nix/profiles/system

Keep e.g. the last five generations and perform garbage collection:

sudo nix-env --delete-generations +5 --profile /nix/var/nix/profiles/system
sudo nix-collect-garbage