| 1 | (use-modules (gnu) |
| 2 | (gnu system nss) |
| 3 | (guix gexp) |
| 4 | (rosenthal services networking) |
| 5 | (nongnu packages linux) (nongnu system linux-initrd)) |
| 6 | |
| 7 | (use-service-modules base desktop xorg networking ssh docker dbus shepherd) |
| 8 | |
| 9 | (use-package-modules bootloaders wm window-management text-editors fonts |
| 10 | terminals version-control ncurses admin |
| 11 | compton lxde ssh golang docker containers xdisorg |
| 12 | rsync emacs base shells image-viewers librewolf |
| 13 | tmux python video image node) |
| 14 | |
| 15 | (operating-system |
| 16 | (host-name "benson") |
| 17 | (timezone "America/New_York") |
| 18 | (locale "en_US.utf8") |
| 19 | |
| 20 | ;; Mainline kernel + firmware from nonguix; linux-libre can't load the |
| 21 | ;; amdgpu blobs the Radeon 780M (Phoenix) needs. |
| 22 | (kernel linux) |
| 23 | (initrd microcode-initrd) |
| 24 | (firmware (list amdgpu-firmware amd-microcode)) |
| 25 | |
| 26 | (bootloader (bootloader-configuration |
| 27 | (bootloader grub-efi-bootloader) |
| 28 | (targets '("/boot/efi")))) |
| 29 | |
| 30 | (file-systems (append |
| 31 | (list (file-system |
| 32 | (device "/dev/nvme0n1p3") |
| 33 | (mount-point "/") |
| 34 | (type "ext4")) |
| 35 | (file-system |
| 36 | (device "/dev/nvme0n1p1") |
| 37 | (mount-point "/boot/efi") |
| 38 | (type "vfat"))) |
| 39 | %base-file-systems)) |
| 40 | |
| 41 | (swap-devices (list (swap-space |
| 42 | (target (uuid "10676fa5-e5a0-43b8-8316-e254ea56629e"))))) |
| 43 | |
| 44 | (users (cons (user-account |
| 45 | (name "stevedylandev") |
| 46 | (group "users") |
| 47 | (shell (file-append zsh "/bin/zsh")) |
| 48 | (supplementary-groups '("wheel" "netdev" "audio" "video" ))) |
| 49 | %base-user-accounts)) |
| 50 | |
| 51 | (packages (append (list |
| 52 | ;; window managers |
| 53 | qtile sway rofi |
| 54 | ;; wayland stuff |
| 55 | swaybg swayidle swaylock wl-clipboard |
| 56 | ;; text editor |
| 57 | vis emacs |
| 58 | ;; browser |
| 59 | librewolf |
| 60 | ;; terminal emulator |
| 61 | kitty |
| 62 | ;; utils |
| 63 | git btop ncurses openssh rsync |
| 64 | fastfetch tmux ffmpeg grim slurp |
| 65 | ;; dev |
| 66 | go python docker-cli node |
| 67 | (specification->package "cloudflared")) ; from Rosenthal channel |
| 68 | %base-packages)) |
| 69 | |
| 70 | (services (append (list (service greetd-service-type |
| 71 | (greetd-configuration |
| 72 | (terminals |
| 73 | (list |
| 74 | ;; Text login on tty7 that starts sway |
| 75 | (greetd-terminal-configuration |
| 76 | (terminal-vt "7") |
| 77 | (terminal-switch #t) |
| 78 | (default-session-command |
| 79 | (greetd-agreety-session |
| 80 | (command |
| 81 | (greetd-user-session |
| 82 | (command (file-append sway "/bin/sway")) |
| 83 | (command-args '()) |
| 84 | (xdg-session-type "wayland")))))))))) |
| 85 | (service dhcpcd-service-type) |
| 86 | (service dbus-root-service-type) |
| 87 | (service elogind-service-type) |
| 88 | (service containerd-service-type) |
| 89 | (service docker-service-type) |
| 90 | (extra-special-file "/lib64/ld-linux-x86-64.so.2" |
| 91 | (file-append glibc "/lib/ld-linux-x86-64.so.2")) |
| 92 | (service tailscale-service-type) |
| 93 | (simple-service 'cloudflared shepherd-root-service-type |
| 94 | (list (shepherd-service |
| 95 | (provision '(cloudflared)) |
| 96 | (requirement '(networking)) |
| 97 | (documentation "Run the Cloudflare tunnel.") |
| 98 | ;; 'networking' is up as soon as dhcpcd is spawned, before it has a |
| 99 | ;; lease, so cloudflared can exit at boot. Wait between respawns so |
| 100 | ;; it keeps retrying instead of hitting the respawn limit (5 in 7s) |
| 101 | ;; and getting disabled. |
| 102 | (respawn-delay 5) |
| 103 | (start #~(make-forkexec-constructor |
| 104 | (list #$(file-append (specification->package "cloudflared") |
| 105 | "/bin/cloudflared") |
| 106 | "tunnel" "--no-autoupdate" "run" |
| 107 | "--token-file" "/etc/cloudflared/token") |
| 108 | #:log-file "/var/log/cloudflared.log")) |
| 109 | (stop #~(make-kill-destructor))))) |
| 110 | (service openssh-service-type |
| 111 | (openssh-configuration |
| 112 | (openssh openssh) |
| 113 | (port-number 22) |
| 114 | (permit-root-login #f) |
| 115 | (password-authentication? #f) |
| 116 | (authorized-keys |
| 117 | `(("stevedylandev" |
| 118 | ,(local-file "/home/stevedylandev/.ssh/authorized_keys"))))))) |
| 119 | (modify-services %base-services |
| 120 | (guix-service-type |
| 121 | config => (guix-configuration |
| 122 | (inherit config) |
| 123 | (authorized-keys |
| 124 | (cons (local-file "nonguix-signing-key.pub") |
| 125 | %default-authorized-guix-keys)) |
| 126 | (substitute-urls |
| 127 | (append (list "https://substitutes.nonguix.org") |
| 128 | %default-substitute-urls)))))))) |