Skip to content

tkuwill/nixos-config

Repository files navigation

nixos-config

my personal nixos-config on an old ASUS laptop.

dwm

Use i3blocks

Use polybar

i3

bspwm

hyprland
  • Here are some skills of using NixOS, live-server and dotfiles used on my NixOS.
  • Wallpaper are from 李擎洲:九尾·妖狐 and 彭雄渾 and Free 4k Wallpaper Photos.
  • bspwm's config is from ghomasHudson/bspwm-dwm. And add some customized change like keybindings to open dmenu's scripts.
  • TVbsp.sh is a script for turning off laptop's screen and setting up workspaces on the external screen.
  • lay.sh is a script for showing windows layout on polybar in bspwm.
  • If you want to learn bspwm, check this: Bspwm Basics.
  • I use tofi as a replacement of dmenu in Hyprland.
  • In NixOS, you should use an overlay to fix the waybar's workspace module if you want to use Hyprland. (In my config, it can show workspaces but it can not be clicked.)

Files

Steps for updating NixOS:

  1. Check and set the latest channel
sudo nix-channel --list

If the channel is not the newest, run:

sudo nix-channel --remove nixos
sudo nix-channel --add https://nixos.org/channels/nixos-XX.XX nixos

See Chapter 4. Upgrading NixOS to check the latest channel.

2. Update the channel

sudo nix-channel --update
  1. Update the packages To update all packages declared in NixOS’ configuration.nix, use:
sudo nixos-rebuild switch
  1. Show environment.systemPackages in /etc/nixos/configuration.nix
nix-store --query --requisites /run/current-system | cut -d- -f2- | sort | uniq | bat

or

nix-store --query --requisites /run/current-system | cut -c 45-200 | sort | uniq | bat

How to show all boot entries in NixOS ?

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

For system-wide, run:

  1. You can change 30d to the days you want.
sudo nix-collect-garbage --delete-older-than 30d

or you can run sudo nix-collect-garbage -d to delete all old generations. (Of course, this would make rollback impossible.)

  1. Then run the rebuild command to clean the boot entries of old generations of nixos.
sudo nixos-rebuild switch

For per-user, run those commands without sudo. Check the Nix Reference Manual for more detailed information.

How to use live-server in NixOS ?

  1. Check Installing NPM Packages Globally in NixOS first.
    • After installing NPM and doing the config for npm in shell's rc, run npm install -g live-server.
  2. Then check live-server's config.
    • Remember that the file .live-server.json should put in your home directory. Set the root for live-server, then use the command live-server in that root directory. It should work smoothly.

Memo

Next time when installing NixOS, make /efi (/boot) big enough (like 1~2GB), or you will have to delete boot menu constantly.(Of course, maybe it is because I care about the space of /boot too much).

About

my personal nixos-config on an old ASUS laptop.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published