(use-modules
  (gnu)
  (gnu system nss)
  (guixrus packages wayland-xyz))
(use-package-modules
  certs
  linux
  wm)
(use-service-modules
  desktop
  networking
  xorg
  cups
  ssh
  dbus
  authentication)
(operating-system
  (kernel linux-libre)
  (keyboard-layout (keyboard-layout "us" "altgr-intl"))
  (bootloader
    (bootloader-configuration
      (bootloader (bootloader
                    (inherit grub-bootloader)
                    (installer #~(const #t))))
      (keyboard-layout keyboard-layout)))
  (host-name "Neon")
  (mapped-devices (list
                    (mapped-device
                      (source (uuid "72cd3842-a6e5-4fb5-b994-1ce11d2d0a16"))
                      (target "fde")
                      (type luks-device-mapping))
                    (mapped-device
                      (source "matrix")
                      (targets (list "matrix-rootvol"))
                      (type lvm-device-mapping))))
  (file-systems (append (list
                          (file-system
                            (type "btrfs")
                            (mount-point "/")
                            (device (file-system-label "root"))
                            (flags '(no-atime))
                            (options "space_cache=v2")
                            (needed-for-boot? #t)
                            (dependencies mapped-devices)))
                        %base-file-systems))
  (users (append (list
                   (user-account
                     (name "cobra")
                     (comment "Skylar \"The Cobra\" Widulski")
                     (group "users")
                     (supplementary-groups '("audio" "cdrom" "kvm" "lp" "netdev" "tape" "video" "wheel" "input"))))
                 %base-user-accounts))
    (packages (append
                (map specification->package
                     (list "nss-certs"
                           "tor"
                           "vim"
                           "screen"
                           "lynx"
                           "curl"
                           "wget"
                           "net-tools"
                           "sway-latest"
                           "waybar"
                           "swaylock"
                           "swayidle"
                           "openssh"
                           "dbus"
                           "cryptsetup"
                           "librsvg"
                           "json-c"
                           "libnotify"
                           "mako"
                           "mesa"
                           "intel-vaapi-driver"
                           "xf86-video-intel"
                           "fprintd"
                           "lvm2"
                           "git"
                           "libqalculate"
                           "bc"
                           "icecat"
                           "cryptsetup"
                           "gnupg"
                           "profanity"
                           "go"
                           "mpv"
                           "imagemagick"
                           "rsync"
                           "neofetch"
                           "lm-sensors"
                           "acpi"
                           "password-store"
                           "xclip"
                           "font-fira-mono"
                           "font-fira-code"
                           "yt-dlp"
                           "icedove"
                           "irssi"
                           "monero-gui"
                           "pamixer"
                           "slurp"
                           "grim"
                           "foot"
                           "wofi"
                           "swayhide"
                           "wl-clipboard"
                           "xorg-server-xwayland"
                           "wob"
                           "htop"
                           "pinentry"
                           "ungoogled-chromium-wayland"
                           "make"
                           "python"
                           "openssl"
                           "font-google-noto"
                           "font-google-noto-serif-cjk"
                           "font-google-noto-sans-cjk"
                           "font-awesome"
                           "socat"
                           "emacs"
                           "mpv-mpris"
                           "playerctl"
                           "reptyr"
                           "unzip"
                           "ffmpeg"
                           "perl"
                           "bind"
                           "netcat"
                           "tmate"
                           "torsocks"
                           "alsa-utils"
                           "proxychains-ng"
                           "whois"))
              %base-packages))
  (timezone "America/New_York")
  (locale "en_US.utf8")
  (name-service-switch %mdns-host-lookup-nss)
  (services
    (cons*
      (service openssh-service-type
               (openssh-configuration
                 (permit-root-login 'prohibit-password)
                 (password-authentication? #f)))
      (service network-manager-service-type)
      (service wpa-supplicant-service-type)
      (service gpm-service-type)
      (service ntp-service-type)
      (service cups-service-type)
      (service elogind-service-type)
      (service dbus-root-service-type)
      (service fprintd-service-type)
      (screen-locker-service swaylock)
      (service tor-service-type
               (tor-configuration
                 (config-file (plain-file "tor-config"
                                          "HTTPTunnelPort 127.0.0.1:9250"))))
      (modify-services %base-services
        (guix-service-type
          config => (guix-configuration
                      (inherit config)
                      (http-proxy "http://localhost:9250"))))))

  (sudoers-file (plain-file "sudoers" "\
root ALL=(ALL) ALL
%wheel ALL=(ALL) ALL
Cmnd_Alias WITHOUTPW = /home/cobra/.local/bin/__suspend, /home/cobra/.local/bin/beep, /run/current-system/profile/sbin/halt, /run/current-system/profile/sbin/reboot
Defaults!WITHOUTPW !authenticate
")))
