Compare commits

..

No commits in common. "a1d30ad8f36c54115c25ccb730748bfc6046d727" and "fdd6c7cce0cff70bb08d2036799f5ec5a844e259" have entirely different histories.

9 changed files with 268 additions and 472 deletions

View file

@ -89,7 +89,7 @@ while true; do
"h")
echo "Launching Hyprland..."
export XDG_CURRENT_DESKTOP=Hyprland
exec dbus-run-session Hyprland &> $HOME/.log/Hyprland
exec Hyprland &> $HOME/.log/Hyprland
;;
"t")
exec cage -s kitty -- -o font_size=14 &> $HOME/.log/kitty

View file

@ -124,7 +124,6 @@
easyeffects
firefox-wayland-new
librewolf-new
gamescope
; gtk
lavanda-gtk-theme

View file

@ -1,30 +1,12 @@
(define-module (freya packages wm)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages)
#:use-module (gnu packages gl)
#:use-module (gnu packages wm)
#:use-module (gnu packages stb)
#:use-module (gnu packages gcc)
#:use-module (gnu packages sdl)
#:use-module (gnu packages xorg)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages maths)
#:use-module (gnu packages image)
#:use-module (gnu packages cmake)
#:use-module (gnu packages linux)
#:use-module (gnu packages vulkan)
#:use-module (gnu packages python)
#:use-module (gnu packages pciutils)
#:use-module (gnu packages benchmark)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages freedesktop)
#:use-module (gnu packages version-control)
#:use-module (guix download)
#:use-module (guix packages)
#:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module (guix build utils)
#:use-module (guix build-system meson)
#:use-module (guix utils))
@ -62,163 +44,23 @@
#:configure-flags #~(list "--wrap-mode=nodownload" "-Dexperimental=true")))))
(define-public vkroots
(let ((commit "d5ef31abc7cb5c69aee4bcb67b10dd543c1ff7ac"))
(package
(name "vkroots")
(version (git-version "" "0" commit))
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/misyltoad/vkroots")
(commit commit)))
(sha256
(base32
"0g2mh8l0xzxzr4yjyafzv76n7jk9043dcbf5mpqwpwmjx88m5nc0"))
(file-name (git-file-name name version))))
(arguments (list
#:phases #~(modify-phases %standard-phases
(add-after 'unpack 'patch-vulkan
(lambda _
(substitute* "gen/make_vkroots"
(("\\.\\.") (getcwd)))))
(add-before 'install 'gen-vkroots
(lambda _
(invoke "python3"
"../source/gen/make_vkroots"
"-x"
(string-append
#$(this-package-native-input "vulkan-headers")
"/share/vulkan/registry/vk.xml")))))))
(build-system meson-build-system)
(native-inputs (list python vulkan-headers))
(home-page "https://github.com/misyltoad/vkroots")
(description "A stupid simple method of making Vulkan layers, at home! ")
(synopsis "A stupid simple method of making Vulkan layers, at home! ")
(license license:expat))))
(define-public libliftoff-0.4
(package
(inherit libliftoff)
(name "libliftoff")
(version "0.4.1")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://gitlab.freedesktop.org/emersion/libliftoff")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
"1ikjp638d655ycaqkdnzhb12d29kkbb3a46lqhbhsfc8vsqj3z1l"))))))
(define reshade-for-gamescope
(let ((commit "4245743a8c41abbe3dc73980c1810fe449359bf1"))
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/Joshua-Ashton/reshade")
(commit commit)))
(file-name (git-file-name "reshade" commit))
(sha256
(base32 "1bb5392dfiri8nrxvck1w2jxva8m9xzrgi16rvnvg96l493a538y")))))
(define-public gamescope
(package
(name "gamescope")
(version "3.14.2")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/ValveSoftware/gamescope")
(commit version)))
(file-name (git-file-name name version))
(sha256
(base32 "0x7gh1rr2ismqfkaa4wm7025acjpgmims41iwzdcps5pg8nxmmhh"))))
(build-system meson-build-system)
(arguments
(list #:configure-flags #~(list "-Dpipewire=enabled"
"-Denable_openvr_support=false"
"-Dforce_fallback_for=[]"
(string-append "-Dc_args=-DHWDATA_PNP_IDS=\""
#$(this-package-native-input "hwdata")
"/share/hwdata/pnp.ids\""))
#:tests? #f
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'patch-deps
(lambda _
; copy reshade
(delete-file-recursively "src/reshade")
(copy-recursively #$reshade-for-gamescope "src/reshade")
; path /usr
(substitute* "src/reshade_effect_manager.cpp"
(("/usr") #$output))
; path meson.build
(substitute* "src/meson.build"
;; patch stb
(("dependency\\('stb'\\)")
(format #f "declare_dependency(include_directories: ['~a'])"
(string-join
'#$(map (lambda (label) (this-package-native-input label))
(list "stb-image"
"stb-image-resize"
"stb-image-write"))
"','")))
;; patch libdisplay-info
(("< 0.2.0")
(string-append "<= " #$(package-version (this-package-input "libdisplay-info"))))
;(("reshade/") (string-append #$reshade-for-gamescope "/"))
(("../thirdparty/SPIRV-Headers") #$(this-package-native-input "spirv-headers")))
;; include <limits> and <cstdint>
(substitute* (find-files "src" "\\.hpp$")
(("#pragma once" pragma)
(string-append pragma
"\n#include <limits>"
"\n#include <cstdint>")))
)))))
(native-inputs (list gcc-13
benchmark
glslang
hwdata
pkg-config
stb-image
stb-image-resize
stb-image-write
spirv-headers
vkroots
vulkan-headers
wayland-protocols))
(inputs (list gcc-13
glm
libavif
libcap
libdisplay-info
libdrm
libinput
libliftoff-0.4
libx11
libxcomposite
libxcursor
libxdamage
libxext
libxkbcommon
libxmu
libxrender
libxres
libxt
libxtst
pipewire
sdl2
vulkan-loader
wayland
wlroots))
(home-page "https://github.com/ValveSoftware/gamescope")
(description "SteamOS session compositing window manager")
(synopsis "SteamOS session compositing window manager")
(license license:bsd-2)))
;(define-public libliftoff
; (package
; (name "libliftoff")
; (version "0.1.0")
; (source (origin
; (method url-fetch)
; (uri (string-append "https://github.com/emersion/libliftoff"
; "/archive/refs/tags/v" version ".tar.gz"))
; (sha256
; (base32
; "17ssbjbv8njgvfha8zsx4nixpi5xxl1rwvk0lcacgqk0nmjyb23s"))))
; (build-system meson-build-system)
; (native-inputs (list gcc-13
; pkg-config
; cmake-minimal-3.30.0
; libdrm))
; (home-page "https://github.com/emersion/libliftoff")
; (synopsis "Lightweight KMS plane library")
; (description "")
; (license license:expat)))

View file

@ -1,62 +0,0 @@
(define-module (freya services cow)
#:use-module (gnu services shepherd)
#:use-module (guix modules)
#:use-module (gnu))
; guix doesnt export the cow store
; bruch >:(
(define %backing-directory
;; Sub-directory used as the backing store for copy-on-write.
"/tmp/guix-inst")
(define cow-store-service-type
(shepherd-service-type
'cow-store
(lambda _
(define (import-module? module)
;; Since we don't use deduplication support in 'populate-store', don't
;; import (guix store deduplication) and its dependencies, which
;; includes Guile-Gcrypt.
(and (guix-module-name? module)
(not (equal? module '(guix store deduplication)))))
(shepherd-service
(requirement '(root-file-system user-processes))
(provision '(cow-store))
(documentation
"Make the store copy-on-write, with writes going to \
the given target.")
;; This is meant to be explicitly started by the user.
(auto-start? #f)
(modules `((gnu build install)
,@%default-modules))
(start
(with-imported-modules (source-module-closure
'((gnu build install))
#:select? import-module?)
#~(case-lambda
((target)
(mount-cow-store target #$%backing-directory)
target)
(else
;; Do nothing, and mark the service as stopped.
#f))))
(stop #~(lambda (target)
;; Delete the temporary directory, but leave everything
;; mounted as there may still be processes using it since
;; 'user-processes' doesn't depend on us. The 'user-file-systems'
;; service will unmount TARGET eventually.
(delete-file-recursively
(string-append target #$%backing-directory))))))
(description "Make the store copy-on-write, with writes going to \
the given target.")))
(define-public (cow-store-service)
"Return a service that makes the store copy-on-write, such that writes go to
the user's target storage device rather than on the RAM disk."
;; See <http://bugs.gnu.org/18061> for the initial report.
(service cow-store-service-type 'mooooh!))

View file

@ -1,109 +1,82 @@
(define-module (freya system)
#:use-module (srfi srfi-1)
#:use-module (gnu)
#:use-module (gnu system setuid)
#:use-module (gnu packages)
#:use-module (gnu packages linux)
#:use-module (gnu packages libusb)
#:use-module (gnu packages admin)
#:use-module (gnu packages avahi)
#:use-module (gnu packages shells)
#:use-module (gnu packages tls)
#:use-module (gnu packages gtk)
#:use-module (gnu packages gl)
#:use-module (gnu packages vpn)
#:use-module (gnu packages security-token)
#:use-module (gnu packages virtualization)
#:use-module (gnu services)
#:use-module (gnu services ssh)
#:use-module (gnu services nix)
#:use-module (gnu services cups)
#:use-module (gnu services dbus)
#:use-module (gnu services avahi)
#:use-module (gnu services linux)
#:use-module (gnu services spice)
#:use-module (gnu services docker)
#:use-module (gnu services authentication)
#:use-module (gnu services security-token)
#:use-module (gnu services cups)
#:use-module (gnu services desktop)
#:use-module (gnu services networking)
#:use-module (gnu services security-token)
#:use-module (gnu services xorg)
#:use-module (gnu services ssh)
#:use-module (gnu services nix)
#:use-module (gnu services sound)
#:use-module (gnu services docker)
#:use-module (gnu services avahi)
#:use-module (gnu services spice)
#:use-module (gnu services virtualization)
#:use-module (gnu system locale)
#:use-module (gnu system setuid)
#:use-module (guix packages)
#:use-module (nongnu packages linux)
#:use-module (freya packages qt)
#:use-module (srfi srfi-1)
#:use-module (freya bootloader uki)
#:use-module (freya packages certs)
#:use-module (freya packages linux)
#:use-module (freya packages qt)
#:use-module (freya packages wm)
#:use-module (freya packages pulseaudio)
#:use-module (freya packages virtualization)
#:use-module (freya bootloader uki))
;; locale
(define-public %base-freya-locale
(list (locale-definition
(name "en_US.utf8")
(source "en_US")
(charset "UTF-8"))
(locale-definition
(name "ja_JP.utf8")
(source "ja_JP")
(charset "UTF-8"))))
;; user groups
(define %base-freya-user-groups (list "wheel"
"audio"
"video"
"netdev"
"tty"))
#:use-module (freya packages networking)
#:use-module (freya packages virtualization))
(define %desktop-freya-user-groups
(append
;; append desktop freya groups
(list "lp"
"docker"
"plugdev"
"libvirt"
"kvm")
;; append base freya groups
%base-freya-user-groups))
;; user accounts
(define freya-user-accounts
(lambda (groups)
(define-public %freya-user-accounts
(cons* (user-account
(name "freya")
(comment "Freya Murphy")
(uid 1000)
(group "users")
(shell (file-append zsh "/bin/zsh"))
(home-directory "/home/freya")
(create-home-directory? #t)
(supplementary-groups groups))
%base-user-accounts)))
(shell (file-append zsh "/bin/zsh"))
(supplementary-groups '("wheel"
"audio"
"lp"
"docker"
"plugdev"
"libvirt"
"kvm"
"netdev"
"video"
"tty")))
%base-user-accounts))
(define-public %base-freya-user-accounts
(freya-user-accounts %base-freya-user-groups))
(define-public %desktop-freya-user-accounts
(freya-user-accounts %desktop-freya-user-groups))
;; packages
(define-public %virt-freya-packages
(define-public %freya-base-packages
(append
;; append needed virt packages
;; append guix and nonguix base packages
(specifications->packages (list ; video audio
"mesa"
"mesa-utils"
; firmware
"sof-firmware"
"amd-microcode"
"v4l2loopback-linux-module"
; terrminal
"alsa-utils"
"vim"
"neovim"
; file sys
"parted"
"gptfdisk"
"ddrescue"
"cryptsetup"
"dosfstools"
"btrfs-progs"
"e2fsprogs"
"f2fs-tools"
; basic utils
"curl"
"htop"
@ -122,26 +95,18 @@
"ncurses"
"jq"
"openssl"))
;; append freyanet certs
;; append certs
(list freya-ca-certs)
;; append guix base packages
%base-packages))
(define-public %base-freya-packages
(define-public %freya-packages
(append
;; append needed base packages
(specifications->packages (list ; firmware
"sof-firmware"
"amd-microcode"
"v4l2loopback-linux-module"))
;; apend virt freya packages
%virt-freya-packages))
(define-public %desktop-freya-packages
(append
;; append needed desktop packages
;; append guix and nonguix packages
(specifications->packages (list ; gtk
"wxwidgets"
"gtk+"
@ -149,11 +114,13 @@
"gnome-themes-extra"
"adwaita-icon-theme"
"hicolor-icon-theme"
; wayland x11
"wl-clipboard"
"libx11"
"xorg-server-xwayland"
"xf86-video-qxl"
; video audio
"glu"
"libglvnd"
@ -166,9 +133,11 @@
"sdl2"
"openal"
"freealut"
; xdg
"xdg-utils"
"xdg-desktop-portal"
; system daemons
"docker"
"containerd"
@ -178,63 +147,74 @@
"brightnessctl"
"wireguard-tools"
"libpcap"
; fonts
"font-fira-mono"
"font-google-noto-sans-cjk"
"font-jetbrains-mono"
"font-dejavu"
; misc
"qemu"))
;; append custom packages
(list ; qt
qt5-styleplugins
qt6gtk2
; bluetooth
bluez-new
; pactl
pulseaudio-new
; system
virt-manager-ovmf)
;; append base freya backages
%base-freya-packages))
;; services
;; append freya base backages
%freya-base-packages))
(define-public %base-freya-services
(define-public %freya-base-services
(append
;; append needed base services
(list ; mtp
(simple-service 'mtp udev-service-type (list libmtp))
; polkit
polkit-wheel-service
; font config
fontconfig-file-system-service
; networking
(service ntp-service-type)
(service network-manager-service-type)
(service wpa-supplicant-service-type)
(service modem-manager-service-type)
(service usb-modeswitch-service-type)
; dbus
(service upower-service-type)
(service polkit-service-type)
(list ; pam
(service pam-limits-service-type)
(service elogind-service-type)
(service dbus-root-service-type)
; openssh
(service openssh-service-type))
;; append guix base services
%base-services))
(define-public %desktop-freya-services
; base guix desktop services
(modify-services %desktop-services
(guix-service-type config =>
(guix-configuration
(inherit config)
(substitute-urls
(append (list "https://substitutes.nonguix.org")
%default-substitute-urls))
(authorized-keys
(append (list (local-file "../../certs/non-guix.pub"))
%default-authorized-guix-keys))))
(udev-service-type config =>
(udev-configuration
(inherit config)))
(delete pulseaudio-service-type)
(delete gdm-service-type)
(delete avahi-service-type)
(delete alsa-service-type)
(delete screen-locker-service-type))))
(define-public %freya-services
(append
;; append needed desktop services
%freya-base-services
(list ; nix
(service nix-service-type)
; wirerguard
(simple-service 'wireguard-module
kernel-module-loader-service-type
'("wireguard"))
; printing
(service cups-service-type
(cups-configuration
@ -243,9 +223,11 @@
(avahi-configuration
(publish? #f)
(publish-workstation? #f)))
; docker
(service docker-service-type)
(service containerd-service-type)
; libvirt
(service libvirt-service-type
(libvirt-configuration
@ -254,89 +236,57 @@
(tls-port "16555")))
(service virtlog-service-type)
(service spice-vdagent-service-type)
; bluetooth
; audio
(service bluetooth-service-type
(bluetooth-configuration
(bluez bluez-new)
(experimental #t)
(fast-connectable? #t)))
; yubikey
(service pcscd-service-type)
(udev-rules-service 'fido2 libfido2 #:groups '("plugdev")))
;; append freya base services
%base-freya-services))
(udev-rules-service 'fido2 libfido2 #:groups '("plugdev")))))
;; setuid programs
(define-public %base-freya-setuid-programs
(append
;; append needed setuid programs
(list ; doas
(define-public %freya-setuid-programs
(append (list ; doas
(file-like->setuid-program
(file-append
(specification->package "opendoas")
"/bin/doas")))
;; append guix setuid programs
; base setuid programs
%setuid-programs))
;; file systems
(define-public %base-freya-file-systems
(define-public %freya-file-systems
(cons*
;; /tmp
; /tmp
(file-system
(mount-point "/tmp")
(device "none")
(type "tmpfs")
(check? #f))
;; append guix base file systems
%base-file-systems))
;; firmware
(define-public %base-freya-firmware
(append
;; append needed base firmware
(list linux-firmware
sof-firmware
amd-microcode)
;; append guix base firmware
%base-firmware))
;; operating system
(define-public %base-freya-operating-system
(define-public base-operating-system
(operating-system
(kernel linux-6.11)
(firmware %base-freya-firmware)
(locale "en_US.UTF-8")
(locale-definitions %base-freya-locale)
(firmware (list linux-firmware
amd-microcode
sof-firmware))
(locale "en_US.utf8")
(timezone "America/New_York")
(keyboard-layout (keyboard-layout "us"))
(host-name "guix")
(users %base-freya-user-accounts)
(packages %base-freya-packages)
(services %base-freya-services)
(host-name "ThisWillChange")
(users %freya-user-accounts)
(packages %freya-packages)
(services %freya-services)
(name-service-switch %mdns-host-lookup-nss)
(setuid-programs %base-freya-setuid-programs)
(file-systems %base-freya-file-systems)
(setuid-programs %freya-setuid-programs)
(file-systems %freya-file-systems)
(bootloader (bootloader-configuration
(bootloader uefi-uki-bootloader)
(targets (list "/boot/efi"))
(keyboard-layout keyboard-layout)))))
(define-public %virt-freya-operating-system
(operating-system
(inherit %base-freya-operating-system)
(kernel linux-libre-lts)
(firmware %base-firmware)
(packages %virt-freya-packages)))
(define-public %desktop-freya-operating-system
(operating-system
(inherit %base-freya-operating-system)
(users %desktop-freya-user-accounts)
(packages %desktop-freya-packages)
(services %desktop-freya-services)))

View file

@ -1,24 +0,0 @@
(use-modules (freya system)
(gnu))
(operating-system
(inherit %virt-freya-operating-system)
(host-name "curiass")
(initrd-modules (cons* "virtio_scsi"
"mptspi"
(operating-system-initrd-modules
%virt-freya-operating-system)))
(file-systems (cons* (file-system
(mount-point "/")
(device (uuid "be5f9a76-8295-4710-95b1-370ae3eb0d95"))
(type "btrfs"))
(file-system
(mount-point "/boot")
(device (uuid "ACB1-EE58"
'fat32))
(type "vfat"))
(operating-system-file-systems
%virt-freya-operating-system)))
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(target "/dev/sda"))))

View file

@ -1,22 +1,110 @@
; base system for creating installer images
(use-modules (freya system)
(freya services cow)
(gnu packages disk)
(gnu packages linux)
(gnu packages cryptsetup)
(gnu packages file-systems)
(gnu services shepherd)
(guix modules)
(gnu))
; copy over installer disk utilites
(define %installer-disk-utilities
(list parted gptfdisk ddrescue
lvm2-static
cryptsetup mdadm
dosfstools
btrfs-progs
e2fsprogs
f2fs-tools
jfsutils
xfsprogs))
; copy over cow store
(define %backing-directory
;; Sub-directory used as the backing store for copy-on-write.
"/tmp/guix-inst")
(define cow-store-service-type
(shepherd-service-type
'cow-store
(lambda _
(define (import-module? module)
;; Since we don't use deduplication support in 'populate-store', don't
;; import (guix store deduplication) and its dependencies, which
;; includes Guile-Gcrypt.
(and (guix-module-name? module)
(not (equal? module '(guix store deduplication)))))
(shepherd-service
(requirement '(root-file-system user-processes))
(provision '(cow-store))
(documentation
"Make the store copy-on-write, with writes going to \
the given target.")
;; This is meant to be explicitly started by the user.
(auto-start? #f)
(modules `((gnu build install)
,@%default-modules))
(start
(with-imported-modules (source-module-closure
'((gnu build install))
#:select? import-module?)
#~(case-lambda
((target)
(mount-cow-store target #$%backing-directory)
target)
(else
;; Do nothing, and mark the service as stopped.
#f))))
(stop #~(lambda (target)
;; Delete the temporary directory, but leave everything
;; mounted as there may still be processes using it since
;; 'user-processes' doesn't depend on us. The 'user-file-systems'
;; service will unmount TARGET eventually.
(delete-file-recursively
(string-append target #$%backing-directory))))))
(description "Make the store copy-on-write, with writes going to \
the given target.")))
(define (cow-store-service)
"Return a service that makes the store copy-on-write, such that writes go to
the user's target storage device rather than on the RAM disk."
;; See <http://bugs.gnu.org/18061> for the initial report.
(service cow-store-service-type 'mooooh!))
; installer system
(operating-system
(inherit %base-freya-operating-system)
(inherit base-operating-system)
(host-name "installer")
(file-systems (append %base-live-file-systems
(file-systems
(append %base-live-file-systems
%base-file-systems))
(users (list (user-account
(name "root")
(group "root")
(supplementary-groups '("wheel")) ; allow use of sudo
(password "")
(comment "root"))))
(pam-services
;; Explicitly allow for empty passwords.
(base-pam-services #:allow-empty-passwords? #t))
(services (cons* (cow-store-service)
(operating-system-services
%base-freya-operating-system)))
(packages (append %installer-disk-utilities
%freya-base-packages))
(services (append %freya-base-services
(list (cow-store-service))))
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(targets '("/dev/sda")))))

View file

@ -2,13 +2,15 @@
(gnu))
(operating-system
(inherit %desktop-freya-operating-system)
(inherit base-operating-system)
(host-name "kaworu")
(mapped-devices (list (mapped-device
(source (uuid
"89257280-202b-4565-b832-89f160d5e4e2"))
(target "cryptroot")
(type luks-device-mapping))))
(file-systems (cons* (file-system
(mount-point "/")
(device "/dev/mapper/cryptroot")
@ -19,5 +21,4 @@
(device (uuid "099A-D668"
'fat32))
(type "vfat"))
(operating-system-file-systems
%desktop-freya-operating-system))))
%freya-file-systems)))

View file

@ -2,16 +2,19 @@
(gnu))
(operating-system
(inherit %desktop-freya-operating-system)
(inherit base-operating-system)
(host-name "shinji")
(mapped-devices (list (mapped-device
(source (uuid
"ad489bfa-4280-44ea-8ad2-60347b516d60"))
(target "root")
(type luks-device-mapping))))
(swap-devices (list (swap-space
(target (uuid
"57caa02d-8569-43e3-8bf9-09dd6f02b191")))))
(file-systems (cons* (file-system
(mount-point "/")
(device "/dev/mapper/root")
@ -22,5 +25,4 @@
(device (uuid "6F93-6A0B"
'fat32))
(type "vfat"))
(operating-system-file-systems
%desktop-freya-operating-system))))
%freya-file-systems)))