guix/config/framework13-system.scm

296 lines
9.4 KiB
Scheme
Raw Normal View History

2024-01-04 17:56:41 +00:00
;; -*- mode: scheme; coding: utf-8; -*-
;;
2024-02-10 15:59:21 +00:00
;; tangled from framework13-system.org on 2024-02-10 16:57:56+01:00)
2024-01-04 17:56:41 +00:00
(use-modules (gnu)
(gnu packages)
(guix modules)
(gnu system nss)
(gnu system setuid)
(gnu packages shells)
(gnu packages linux)
(gnu packages xdisorg)
2024-01-17 14:36:03 +00:00
(gnu packages emacs-xyz))
2024-01-04 17:56:41 +00:00
2024-01-17 14:36:03 +00:00
(use-modules (nongnu packages linux)
2024-01-04 17:56:41 +00:00
(nongnu system linux-initrd))
2024-01-22 14:56:59 +00:00
(use-service-modules cups
2024-02-10 16:02:20 +00:00
sddm
2024-01-04 17:56:41 +00:00
desktop
networking
ssh
xorg
samba
sound
2024-01-23 16:18:56 +00:00
mail
vpn)
2024-01-04 17:56:41 +00:00
(use-package-modules admin
certs
package-management
ssh
2024-01-22 14:29:47 +00:00
tls
vpn)
2024-01-04 17:56:41 +00:00
2024-02-08 13:07:46 +00:00
(define-public linux-FWL13
2024-01-21 11:27:48 +00:00
(corrupt-linux linux-libre-6.7
2024-02-08 13:07:46 +00:00
#:name "linux-fwl13"
2024-01-04 17:56:41 +00:00
#:configs '("CONFIG_MT7921E=m")))
(operating-system
(host-name "zxxcxxz")
(locale "en_GB.utf8")
(timezone "Europe/Amsterdam")
2024-02-01 08:08:20 +00:00
(hosts-file (local-file "hosts.conf"))
2024-01-04 17:56:41 +00:00
(keyboard-layout (keyboard-layout
"us" "altgr-intl"
#:options '("ctrl:nocaps"
"altwin:swap_lalt_lwin")))
2024-02-08 13:07:46 +00:00
(kernel linux-6.7) ;; previously (kernel linux-FWL13)
2024-01-04 17:56:41 +00:00
(firmware (list linux-firmware))
(users (cons* (user-account
(name "zzk")
(comment "zzk")
(group "users")
(home-directory "/home/zzk")
(shell (file-append zsh "/bin/zsh"))
(supplementary-groups '("wheel"
"netdev"
"audio"
"video"
"www-data"
2024-02-08 10:13:13 +00:00
"realtime"
2024-01-04 17:56:41 +00:00
"lp")))
(user-account
(name "www-data")
(group "www-data")
(home-directory "/home/www"))
%base-user-accounts))
(groups (cons* (user-group
(name "www-data"))
2024-01-17 14:36:03 +00:00
(user-group
(system? #t)
(name "realtime"))
2024-01-04 17:56:41 +00:00
%base-groups))
(sudoers-file
(plain-file "sudoers"
"root ALL=(ALL) ALL
%wheel ALL=NOPASSWD: ALL"))
(packages
(append (map specification->package
'("emacs"
"emacs-guix"
"emacs-exwm"
"openssh-sans-x"
"nss-certs"
;; xfce
"xfce4-power-manager"
"xfce4-settings"
"xfce4-session"
"xfce4-panel"
;; gnome extras
"gnome-tweaks"
"gvfs"
2024-01-22 14:29:47 +00:00
;; vpn
"wireguard-tools"
2024-01-04 17:56:41 +00:00
))
%base-packages))
(services
(append (list
(service openssh-service-type
(openssh-configuration
(openssh openssh-sans-x)
(password-authentication? #true)
(authorized-keys
`(("zzk" ,(local-file "zzk_rsa.pub"))
("root" ,(local-file "zzk_rsa.pub"))))))
(service dovecot-service-type
(dovecot-configuration
(mail-location "maildir:%h/Maildir:LAYOUT=fs")))
2024-01-17 14:36:03 +00:00
(service iptables-service-type
(iptables-configuration
2024-01-24 15:44:22 +00:00
(ipv4-rules (plain-file "iptables.rules"
2024-01-31 10:16:06 +00:00
2024-01-24 15:44:22 +00:00
"*nat
:PREROUTING ACCEPT
:INPUT ACCEPT
:OUTPUT ACCEPT
:POSTROUTING ACCEPT
-A POSTROUTING -o en0 -j MASQUERADE
2024-01-24 17:56:08 +00:00
COMMIT
2024-01-24 15:44:22 +00:00
*filter
2024-01-17 14:36:03 +00:00
:INPUT ACCEPT
:FORWARD ACCEPT
:OUTPUT ACCEPT
2024-01-17 15:18:45 +00:00
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 993 -j ACCEPT
2024-01-19 10:54:35 +00:00
-A INPUT -p udp -m udp --dport 5353 -j ACCEPT
2024-01-24 14:26:34 +00:00
2024-01-17 15:18:45 +00:00
-A INPUT -p udp -m udp -s 192.168.0.0/16 --dport 137 -j ACCEPT
-A INPUT -p udp -m udp -s 192.168.0.0/16 --dport 138 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp -s 192.168.0.0/16 --dport 139 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp -s 192.168.0.0/16 --dport 445 -j ACCEPT
2024-01-24 14:26:34 +00:00
-A INPUT -p udp -m udp --dport 51820 -j ACCEPT
-A INPUT -i wg0 -m state --state ESTABLISHED,RELATED -j ACCEPT
2024-01-24 14:52:06 +00:00
-A FORWARD -i wg0 -j ACCEPT
2024-01-24 14:26:34 +00:00
2024-01-17 14:36:03 +00:00
-A INPUT -j REJECT --reject-with icmp-port-unreachable
2024-01-17 15:18:45 +00:00
-A INPUT -m conntrack --ctstate INVALID -j DROP
2024-01-17 14:36:03 +00:00
COMMIT
"))
2024-01-31 10:16:06 +00:00
2024-01-24 15:44:22 +00:00
(ipv6-rules (plain-file "ip6tables.rules"
"*nat
:PREROUTING ACCEPT
:INPUT ACCEPT
:OUTPUT ACCEPT
:POSTROUTING ACCEPT
-A POSTROUTING -o en0 -j MASQUERADE
2024-01-24 17:56:08 +00:00
COMMIT
2024-01-24 15:44:22 +00:00
*filter
2024-01-17 14:36:03 +00:00
:INPUT ACCEPT
:FORWARD ACCEPT
:OUTPUT ACCEPT
-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp --dport 993 -j ACCEPT
2024-01-19 10:54:35 +00:00
-A INPUT -p udp -m udp --dport 5353 -j ACCEPT
2024-01-24 14:26:34 +00:00
2024-01-26 09:53:38 +00:00
-A INPUT -p udp -m udp -s fded:c2f7:43ef::/64 --dport 137 -j ACCEPT
-A INPUT -p udp -m udp -s fded:c2f7:43ef::/64 --dport 138 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp -s fded:c2f7:43ef::/64 --dport 139 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp -s fded:c2f7:43ef::/64 --dport 445 -j ACCEPT
2024-01-24 14:26:34 +00:00
-A INPUT -p udp -m udp --dport 51820 -j ACCEPT
-A INPUT -i wg0 -m state --state ESTABLISHED,RELATED -j ACCEPT
2024-01-24 14:52:06 +00:00
-A FORWARD -i wg0 -j ACCEPT
2024-01-24 14:26:34 +00:00
2024-01-17 14:36:03 +00:00
-A INPUT -j REJECT --reject-with icmp6-port-unreachable
2024-01-17 15:18:45 +00:00
-A INPUT -m conntrack --ctstate INVALID -j DROP
2024-01-17 14:36:03 +00:00
COMMIT
"))))
2024-01-23 16:38:27 +00:00
(service wireguard-service-type
2024-01-23 16:18:56 +00:00
(wireguard-configuration
2024-01-26 09:53:38 +00:00
(addresses '("10.0.0.23/32" "fded:dada::23/128"))
2024-01-24 14:26:34 +00:00
(private-key "/etc/wireguard/private.key")
2024-01-23 16:38:27 +00:00
(port 51820)
2024-01-22 21:16:07 +00:00
(peers
(list
(wireguard-peer
(name "lmn")
2024-01-23 16:18:56 +00:00
(endpoint "example.org:51820")
2024-01-22 21:16:07 +00:00
(public-key "WHmVhvgxkBxk8fqZU6pWEaH4iVzOcud9JQivwRsaIE8=")
2024-01-26 09:53:38 +00:00
(allowed-ips '("10.0.0.1/24" "fded:dada::1/64"))
2024-01-23 16:18:56 +00:00
(keep-alive 25))
(wireguard-peer
(name "beryllium")
(endpoint "example.org:51820")
(public-key "taeID3fNgci9OpE+1UYkS4DYZE6DIlhpLQL1BVN9sg8=")
2024-01-26 09:53:38 +00:00
(allowed-ips '("10.0.0.13/32" "fded:dada::13/128"))
2024-01-31 10:19:56 +00:00
(keep-alive 25))))))
2024-01-22 21:16:07 +00:00
2024-02-10 15:59:21 +00:00
(service sddm-service-type
(sddm-configuration
(display-server "x11")
(remember-last-user? #t)
(theme "maya")
(xorg-configuration
2024-01-04 17:56:41 +00:00
(xorg-configuration
(keyboard-layout keyboard-layout)
(extra-config '("Section \"InputClass\"
Identifier \"touchpad\"
Driver \"libinput\"
MatchIsTouchpad \"on\"
Option \"Tapping\" \"on\"
Option \"TappingButtonMap\" \"lrm\"
Option \"ClickMethod\" \"clickfinger\"
Option \"AccelProfile\" \"adaptive\"
EndSection"))))))
2024-02-09 13:01:22 +00:00
(service plasma-desktop-service-type)
2024-01-04 17:56:41 +00:00
(service xfce-desktop-service-type)
(service samba-service-type
(samba-configuration
(enable-smbd? #t)
(config-file
(plain-file "smb.conf" "\
[global]
protocol = SMB3
logging = syslog@1
workgroup = FOAM
netbios name = zxXCXxz
security = user
case sensitive = yes
preserve case = yes
short preserve case = yes
[homes]
valid users = %S
browsable = no
writable = yes
"))))
(service bluetooth-service-type)
(service cups-service-type)
) ;; end services list
(modify-services %desktop-services
(delete gdm-service-type))))
(name-service-switch %mdns-host-lookup-nss)
(setuid-programs
(cons*
(setuid-program
(program (file-append xsecurelock "/libexec/xsecurelock/authproto_pam")))
%setuid-programs))
(initrd (lambda (file-systems . rest)
(apply microcode-initrd file-systems
#:initrd base-initrd
#:microcode-packages (list amd-microcode)
rest)))
(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(targets (list "/boot/efi"))
(keyboard-layout keyboard-layout)))
(swap-devices (list (swap-space
(target (uuid
2024-02-09 13:01:22 +00:00
"e7cc2ca5-169a-4511-865f-d2d7ed72c05c")))))
2024-01-04 17:56:41 +00:00
(file-systems (cons* (file-system
(mount-point "/boot/efi")
(device (uuid "8B3C-3BC0" 'fat32))
(type "vfat"))
(file-system
(mount-point "/")
(device (uuid
"e0ece027-0396-4546-8aba-2ce91285d061"
'ext4))
(type "ext4"))
%base-file-systems))
) ;; end operating-system declaration