Hello all, my last post here was NixOS vs Guix, and how I preferred NixOS but wanted to eventually switch to Guix. Thanks to the efforts of David and the wider Guix community, the time is at hand… for my home server to switch from NixOS to Guix.
Why am I switching? I started to understand Guix more after playing with it extensively in virtual machines and I’m fine with how Guix does things. I just find NixOS to be constantly pulling the rug under me regarding things, and I do use Flakes in NixOS. Sure NixOS has more services you can just deploy right away, but most of those services I have no need for.
In this post I will cover and post my configs for my home server, and also make available on my website and on Codeberg.
Now in my home server I will be using Docker to run Jellyfin, The Lounge and FreshRSS. Also I will run a NFS and Samba service to make it easier to copy files to that computer, mostly for Jellyfin!
Here is the config I use, edited for public consumption-----
CODE BEGINS HERE:
;; This is an operating system configuration generated
;; by the graphical installer.
;;
;; Once installation is complete, you can learn and modify
;; this file to tweak the system configuration, and pass it
;; to the ‘guix system reconfigure’ command to effect your
;; changes.
;; Indicate which modules to import to access the variables
;; used in this configuration.
(use-modules (gnu)(nongnu packages linux))
(use-service-modules cups desktop networking ssh xorg docker nfs samba)
(operating-system
(kernel linux)
(firmware(list linux-firmware))
(locale “en_US.utf8”)
(timezone “$YOURTIMEZONE”)
(keyboard-layout (keyboard-layout “us”))
(host-name “$YOURHOSTNAME”)
;; The list of user accounts (‘root’ is implicit).
(users (cons* (user-account
(name “$YOURNAME”)
(comment “$YOURNAME”)
(group “users”)
(home-directory “/home/$YOURNAME”)
(supplementary-groups '(“wheel” “netdev” “audio” “video” “kvm” “docker”)))
%base-user-accounts))
(packages (append (map specification->package
'(“sshfs” “htop” “openssh” “ntfs-3g” “git” ))
%base-packages))
;; Below is the list of system services. To search for available
;; services, run ‘guix system search KEYWORD’ in a terminal.
(services
(append (list (service gnome-desktop-service-type)
(service xfce-desktop-service-type)
(service containerd-service-type)
(service docker-service-type)
(service oci-container-service-type
(list
(oci-container-configuration
(image “Package thelounge · GitHub”)
(provision “thelounge”)
(ports '(“9000:9000”))
(respawn? #t)
(volumes
'(“/home/$YOURNAME/.thelounge:/var/opt/thelounge”)))
(oci-container-configuration
(image “lscr.io/linuxserver/freshrss:latest”)
(environment
(list
“PUID=1000”
“PGID=1000”
“TZ=$YOURTIMEZONE”))
(provision “freshrss”)
(ports '(“80:80”))
(respawn? #t)
(volumes
'(“/home/$YOURNAME/freshrss_config:/config”)))
(oci-container-configuration
(image “lscr.io/linuxserver/jellyfin:latest”)
(environment
(list
“PUID=1000”
“PGID=1000”
“TZ=$YOURTIMEZONE”))
(provision “jellyfin”)
(ports '(“8096:8096”))
(respawn? #t)
(volumes
'(“/home/$YOURNAME/jellyfin_config:/config” “/home/$YOURNAME/jellyfin_tv:/data/tvshows” “/home/$YOURNAME/jellyfin_movies:/data/movies”)))))
(service nfs-service-type
(nfs-configuration
(exports
'((“/exports/nfs” “*(rw,sync)”)))))
(service samba-service-type (samba-configuration
(enable-smbd? #t)
(config-file (plain-file “smb.conf” "
[global]
map to guest = Bad User
logging = syslog@1
[public]
browsable = yes
path = /exports/smb
read only = no
guest ok = yes
guest only = yes\n"))))
;; To configure OpenSSH, pass an ‘openssh-configuration’
;; record as a second argument to ‘service’ below.
(service openssh-service-type)
(set-xorg-configuration
(xorg-configuration (keyboard-layout keyboard-layout))))
;; This is the default list of services we
;; are appending to.
%desktop-services))
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(targets (list “/dev/vda”))
(keyboard-layout keyboard-layout)))
(swap-devices (list (swap-space
(target (uuid
“94499fc9-1e3d-40cc-b8dc-ae9d581a44d2”)))))
;; The list of file systems that get “mounted”. The unique
;; file system identifiers there (“UUIDs”) can be obtained
;; by running ‘blkid’ in a terminal.
(file-systems (cons* (file-system
(mount-point “/”)
(device (uuid
“60421ad7-2323-41ea-b857-7636c09eb3c2”
'btrfs))
(type “btrfs”)) %base-file-systems)))
CODE ENDS HERE
Right now this only exists in a virtual machine, but soon the relevant portions will be copied to a real system. I will also feature a guide to get Tailscale running in this system as well.
Do take note, the following directories need to be created for this system to work: “.thelounge”, “freshrss_config”, “jellyfin_config”,“jellyfin_tv”,“jellyfin_movies”, “/exports/smb” and finally “/exports/nfs”.
Now I also run Nextcloud, but I don’t use it a ton. Still trying to figure out how to get it to run under Guix and as a Shepherd service as well.
If you have any questions about my config, where I could improve it etc, hit me up!