I have been using Arch Linux since 2020, while still using Nix for side projects. I still think Nix is the only sensible way to manage software today. I will come back to NixOS soon..
First, you need to install a fresh NixOS following the manual.
Then, you need to have git
on the system.
If installing is required do nix-env -iA pkgs.git
.
You will need to import your github private key (or create a new one ssh-keygen -t rsa -b 4096 -C "[email protected]"
)
and it to openSSH daemon ssh-add /home/arnau/.ssh/github
.
# ! Backup your /etc/nixos/hardware-configuration.nix
$ sudo rm -r /etc/nixos
$ sudo git clone [email protected]:monadplus/nixconfig.git /etc/nixos
Before realising your configuration you must add (test if you really need it) home-manager channels:
$ nix-channel --add https://github.com/rycee/home-manager/archive/release-XX.XX.tar.gz home-manager
$ nix-channel --update
To install everything:
# This will take a long time (about 10-20')
$ sudo nixos-rebuild switch
$ reboot
- Konsole: my personal choice.
- Alacritty: I couldn't manage to configure very basic shortcuts like clear history.
Just plug your screen and run autorandr -c
arandr
is the graphical version of xrandr
(use this one.)
xrandr
(cli):
xrandr # List monitors and options
xrandr --auto # Detect monitors and connect them
xrandr --output HDMI-1 --off # Disable hdmi monitor
xrandr --output HDMI-1 --right-of eDP-1 # Place HDMI-1 at the right
# ^^^^^^ To change mirror monitoring
We installed autoxrandr
to change config when hardware changes.
It requires a bit of configuration to automatically work ! (read https://github.com/phillipberndt/autorandr#how-to-use)
On home.nix
we set up a declarative autorandx.
https://wiki.archlinux.org/index.php/Backlight#External_monitors
Known networks are set on configuration.nix
wpa_gui: GUI, simple to use.
wpa_cli:
$ wpa_cli
> scan
OK
<3>CTRL-EVENT-SCAN-RESULTS
> scan_results
bssid / frequency / signal level / flags / ssid
00:00:00:00:00:00 2462 -49 [WPA2-PSK-CCMP][ESS] MYSSID
11:11:11:11:11:11 2437 -64 [WPA2-PSK-CCMP][ESS] ANOTHERSSID
# If the SSID does not have password authentication, you must explicitly configure the network as keyless by replacing the command
> save_config
OK
> quit
alsamixer
We set up keybinding to automatically increase/decrease the volume.
The volume for the bluetooth headsets doesn't work.
blueman-manager
(gui) / blueman-applet (daemon)
Command line:
$ bluetoothctl
[bluetooth] # power on
[bluetooth] # agent on
[bluetooth] # default-agent
[bluetooth] # scan on
...put device in pairing mode and wait [hex-address] to appear here...
[bluetooth] # pair [hex-address]
[bluetooth] # connect [hex-address]
pavucontrol
to manage bluetooth devices configuration.
typora
firefox
and chromium
zathura
Partitions: $ parted
To display partitions: $ sudo parted -l
Disk space usage analyzer: $ ncdu
$ openvpn
Touchpad configuration is managed by libinput.
The configuration is managed in a declarative way.
How to change the sensivity:
$ xinput list # Search for TouchPad id
$ xinput --list-props ID # From the previous list
$ xinput --set-prop ID "libinput Accel Speed" 0.3 # 0.3 is just an example
Managed by scrot
.
Hotkeys:
PtrSc
Ctrl + PtrSc
Requires a systemd daemon runnning: clipmenud
And then you can access the tray: https://github.com/cdown/clipmenu
I remapped clipmenu to Ctrl+Shift+V
via xmonad.
$ nomacs <<image.jpg>>
We use translate-shell
for that:
trans -s es -t en word | multiple words | "this is a sentence."
translate-shell
is configured via the dotfile ~/.translate-shell/init.trans.
Open transmission at http://localhost:9091/transmission/web/
Open it via transgui.
Transmission daemon can be controlled via the RPC interface using transmission-remote or the WebUI (http://localhost:9091/ by default).
Xmonad configuration can be found at ./dotfiles/xmonad/xmonad.hs
and it's configured via nixos (i.e. there is no need to symlink it to ~/.xmonad/).
xmonad top bar is a plug-in called xmobar
and it is configured with it own config file: ~/.xmobarrc
(can be found on ./dotfiles/xmonad/.xmobarrc)
Files protected with GPG have the extension .gpg
. In order to encrypt/decrypt them:
# Encrypt
gpg -c filename
# Decrypt
gpg filename.gpg