NixOS and home-manager config files are merged.
-
Follow the manual and install NixOS with any desktop environment and reboot.
-
Update the generated nixos configuration in
/etc/nixos/configuration.nix.The new configuration must have: user configuration,
flakesenabled,cachix(optional),git,git-crypt, internet setup,firewalldisabledCheck the configuration.nix example
Reboot into NixOS, login with the user you created
-
Connect to internet
# The following commands will work if you enabled `networking.networkmanager.enable = true;` $ nmtui $ ping google.comIf
ping google.comdoesn't work, try updating your DNS$ vim /etc/resolv.conf # add `nameserver 8.8.8.8` to `/etc/resolv.conf` -
Use local cachix, if you have 2 machines using the same nix config/channels (optional)
# Run on another machine, with nixos installed $ nix-serve -p 8080 # On current/new machine, test $ curl http://192.168.x.x:8080/nix-cache-infoOn the current/new machine, update
nix.settings.substitutersconfig, addhttp://192.168.x.x:8080, then restart -
Clone this repository into
/home/<username>/.config/nix-config$ git clone https://github.com/wochap/nix-config.git ~/.config/nix-config -
Add the following to
/root/.gitconfig[safe] directory = /home/gean/nix-config -
Rebuild nixos with the host's specific config, for example, heres's a rebuild for my
gdesktopWARNING: First
nixos-rebuildwith device config can take several hours, maybe you want to disable some modules# Go to nix-config folder $ cd /home/<username>/.config/nix-config $ nixos-rebuild boot --flake .#gdesktop # or if you want to switch to a specialisation # $ nixos-rebuild switch --flake .#gdesktop --specialisation hyprland-specialisation # or if you want to generate a new profile # $ nixos-rebuild switch --flake .#gdesktop --profile-name hyprland-specialisation # or with nh # $ nh os switch .#nixosConfigurations.gdesktopReboot so changes take effect
NOTE: If you encounter an error related to
home-manager, it is likely due to a file collision, and you will need to remove a file. You can identify which files are in conflict with the following command:systemctl status home-manager-<username>.service. After resolving all the collisions, you can restart thehome-manager-<username>.service. -
Set password for new user
<username>if you haven't# for example $ passwd gean
-
Install ssh keys
Copy
.sshbackup folder to/home/<username>/.ssh$ chmod 600 ~/.ssh/* $ ssh-add <PATH_TO_PRIVATE_KEY>https://www.freecodecamp.org/news/how-to-manage-multiple-ssh-keys/
-
Unlock secrets folder
Copy
git-crypt-keybackup$ cd /home/<username>/.config/nix-config $ git-crypt unlock /path/to/git-crypt-key -
Install gpg keys
$ gpg --import private.key -
Enable autologin (optional)
$ sudo touch /etc/security/autologin.conf
-
Setup Syncthing (http://localhost:8384)
-
Setup desktop wallpaper (optional)
$ swww img ~/Pictures/backgrounds/<IMAGE_NAME> -
Setup Neovim configuration
-
Setup qt look and feel
Read instructions to change theme in
modules/nixos/desktop/wm-addons/qt/README.mdOpen
qt5ct and qt6ctand update style and fonts- style: Darkly
- change font size to 10
-
Setup betterdiscord (optional)
$ betterdiscordctl installEnable theme from discord > betterdiscordctl settings
-
Enable WebRTC PipeWire support in chrome (wayland only)
Go to chrome://flags/ and enable
WebRTC PipeWire support -
Sync
vscode,firefox,chrome(optional)NOTE: Default theme for firefox and chrome have better dark/light theme support
-
Setup mail
Read instruction in
modules/nixos/desktop/wm-addons/email/README.md -
Setup calendar
Read instruction in
modules/nixos/desktop/wm-addons/calendar/README.md -
Waydroid (optional)
-
Flatpak (optional)
-
Setup steam (optional)
Run steam, login, setup proton.
-
Switch between themes
$ theme-switch dark $ theme-switch light
IMPORTANT: For some CLI/TUI tools, I use rod, which can break automation scripts. To prevent this, set the NO_ROD environment variable to true before running any automation script.
Update inputs on flake.nix, then:
$ cd /home/<username>/.config/nix-config
$ nix flake update --recreate-lock-file
# update 1 single input
# $ sudo nix flake lock --update-input hyprland
$ sudo nixos-rebuild boot --flake .#gdesktop-
Setup a project with nix-direnv
$ nix flake new -t github:nix-community/nix-direnv ./ $ direnv allow # update flake.nix
- Eval value of a nixos option
$ nix eval .#nixosConfigurations.laptop.config.services.gnome.gcr-ssh-agent.enable- Nvidia doesn't enter deep sleep
# close any program listed in
$ sudo lsof /dev/nvidia*
# check if nvidia is deep sleep
$ watch -n 3 cat /sys/class/drm/card*/device/power_state- Keyboard doesn't enter autosuspend
$ grep -l "c104" /sys/bus/usb/devices/*/idProduct | sed 's|idProduct|power|'
$ watch -n 0.5 "cat /sys/bus/usb/devices/3-1/power/runtime_status"
-
Identify shutdown service timeout
$ journalctl -b -1 | grep -i "timed out"
-
Kdenlive doesn't render project Help > Reset Configuration...
-
Some keybindings doesn't work
$ uwsm finalize XDG_CURRENT_DESKTOP XDG_SESSION_TYPE XDG_SESSION_DESKTOP
-
Ruby
warning: It seems your ruby installation is missing ...$ rm -rf ~/.gem/ruby/<YOUR_PREVIOUS_RUBY_VERSION> -
Galaxy Buds
- Connecting
- Disconnect the Galaxy Buds case from the power source
- Close the Galaxy Buds case
- Open GalaxyBudsClient (after pairing)
- Open the Galaxy Buds case
- Pair the Galaxy Buds (only required for the first time)
- In GalaxyBudsClient click on 'connect'
- Repeat the process until the Galaxy Buds connect via Bluetooth
- Once connected via Bluetooth
- Best audio profiles
- Best audio output: High Fidelity Playback (A2DP Sink, codec AAC)
- Worst output but allows input: Headset Head Unit (HSP/HFP, codec mSBC)
- Connecting
-
Chrome like apps with blank screen or vanishing text on scroll
Clear
GPUCache, in~/.config/google-chrome/ShaderCachesource: electron/electron#40366 source: https://discussion.fedoraproject.org/t/chromium-based-browsers-display-garbled-web-pages-after-mesa-is-updated/83438
-
Slow zsh startup
# print all zsh scripts that are being loaded $ exec -l zsh --sourcetrace -
Fix Virtual Machine Manager
network default is not activeerror$ sudo virsh net-start default $ sudo virsh net-autostart default -
Fix bootloader
-
Read and write NTFS partitions
disable fast startup in windows
-
Generate Nix fetcher calls from repository URLs
$ nurl https://github.com/nix-community/patsh v0.2.0 2>/dev/null -
Inspect systemctl services
$ systemctl cat --user swayidle.service
-
Reload .desktop files
$ nix shell nixpkgs#desktop-file-utils -c update-desktop-database -v ~/.local/share/applications -
No wifi device at startup
$ nmcli r wifi on -
Sync Bluetooth for dualboot Linux and Windows
# on windows, turn off `fast startup`` # mount your disk with windows, then: $ sudo bt-dualboot --sync-all --backup -
No bluetooth device at startup
$ sudo rfkill unblock bluetooth -
Clear /nix/store
$ nix-collect-garbage -d $ sudo nix-collect-garbage -d -
# delete everything on $ /nix/var/nix/profiles/system-profiles/* # Clear store and rebuild -
$ nix path-info -rSh /run/current-system | sort -nk2 -
Firefox doesnt load some websites
Enable DNS over HTTPS
-
Wifi keeps connecting and disconnecting
Disable ipv6 connection.
# run the following to disable ipv6 $ sudo sysctl net.ipv6.conf.all.disable_ipv6=1 -
Copy installed icons unicode
E8E4is the unicode.$ echo -ne "\uE8E4" | xclip -selection clipboard $ echo -ne "\ue92a" | wl-copy -
Transform svg icons to png
$ for file in *.svg; do inkscape $file -o ${file%svg}png -h 128; done#!/usr/bin/env bash symlinks=$(find ./ -lname "*.svg"); for file in $symlinks; do linkpath=$(readlink $file); newlinkcontent=${linkpath/svg/png}; newlinkpath=${file/svg/png}; ln -sf $newlinkcontent $newlinkpath; done -
Get key terminal code
$ kitten show_key -m kitty $ kitty +kitten show_key $ showkey -a
-
Get key actual name
$ xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }' -
Cannot add google account in gnome > online accounts
In gmail settings, enable IMAP
-
Create udev rule
# monitor uevent $ udevadm monitor --property # print devices ids (vendor, product, etc) $ lsusb # get env values $ udevadm info -q all -n /dev/input/eventX # get attr values $ udevadm info -n /dev/input/eventX --attribute-walk
- https://github.com/phenax/nixos-dotfiles
- https://gitlab.com/dwt1/dotfiles
- https://github.com/JorelAli/nixos
- https://github.com/nrdxp/nixflk/tree/template
- https://github.com/kampka/nix-packages
- https://github.com/sgraf812/.nixpkgs
- https://www.reddit.com/r/NixOS/comments/k7e9sg/newbie_desktop_nixos_setup_for_developer/
- https://www.secjuice.com/wayland-vs-xorg/
- https://discourse.nixos.org/t/how-to-set-the-xdg-mime-default/3560
- https://awesomeopensource.com/projects/nixos
- https://fonts.google.com/icons?icon.category=Android&icon.query=low&icon.size=24&icon.color=%23e3e3e3&icon.style=Rounded
- https://bennymeg.github.io/ngx-fluent-ui/
- https://fontawesome.com/cheatsheet
- https://fontdrop.info/
- https://coderwall.com/p/dedqca/argb-colors-in-android
- https://github.com/zodd18/Horizon
- https://www.iconfinder.com/search/?q=F028
- https://www.online-toolz.com/tools/text-unicode-entities-convertor.php
- https://www.reddit.com/r/firefox/comments/786dr7/how_do_i_identify_firefox_ui_elements/