summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcoast <coasteen@proton.me>2026-09-17 13:15:12 +0330
committercoast <coasteen@proton.me>2026-09-17 13:15:12 +0330
commitdb401694ae30bbd0208925c538ff8883e742bdb9 (patch)
treeb665f1bb226b20a29e869c9fac89f522ef321c3e
downloadguix-db401694ae30bbd0208925c538ff8883e742bdb9.tar.gz
guix-db401694ae30bbd0208925c538ff8883e742bdb9.tar.bz2
guix-db401694ae30bbd0208925c538ff8883e742bdb9.tar.xz
guix-db401694ae30bbd0208925c538ff8883e742bdb9.tar.zst
init
-rw-r--r--.gitignore3
-rw-r--r--channels.scm18
l---------current1
-rw-r--r--home.scm46
-rw-r--r--system.scm127
-rw-r--r--throne/deps.scm245
6 files changed, 440 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d2b2c59
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+test.sh
+current/
+core
diff --git a/channels.scm b/channels.scm
new file mode 100644
index 0000000..ba8dca7
--- /dev/null
+++ b/channels.scm
@@ -0,0 +1,18 @@
+(list (channel
+ (name 'nonguix)
+ (url "https://gitlab.com/nonguix/nonguix")
+ (branch "master")
+ (introduction
+ (make-channel-introduction
+ "897c1a470da759236cc11798f4e0a5f7d4d59fbc"
+ (openpgp-fingerprint
+ "2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5"))))
+ (channel
+ (name 'guix)
+ (url "https://git.savannah.gnu.org/git/guix.git")
+ (branch "master")
+ (introduction
+ (make-channel-introduction
+ "9edb3f66fd807b096b48283debdcddccfea34bad"
+ (openpgp-fingerprint
+ "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA")))))
diff --git a/current b/current
new file mode 120000
index 0000000..262234f
--- /dev/null
+++ b/current
@@ -0,0 +1 @@
+/var/guix/profiles/per-user/coast/current-guix \ No newline at end of file
diff --git a/home.scm b/home.scm
new file mode 100644
index 0000000..63dd258
--- /dev/null
+++ b/home.scm
@@ -0,0 +1,46 @@
+(define-module (guix-home-config)
+ #:use-module (gnu home)
+ #:use-module (gnu home services)
+ #:use-module (gnu home services shells)
+ #:use-module (gnu services)
+ #:use-module (gnu system shadow)
+ #:use-module (gnu packages)
+ #:use-module (nongnu packages mozilla)
+ #:use-module (guix gexp))
+
+(define home-config
+ (home-environment
+ (packages
+ (specifications->packages
+ (list "btop"
+ "firefox"
+ "gtk+:bin"
+ "hicolor-icon-theme"
+ "git"
+ "python"
+ "binutils"
+ "flatpak"
+ "fastfetch")))
+ (services
+ (append
+ (list
+ (service home-zsh-service-type)
+
+ (simple-service
+ 'flatpak-environment
+ home-environment-variables-service-type
+ `(("XDG_DATA_DIRS"
+ . "$HOME/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:$HOME/.guix-home/profile/share:$XDG_DATA_DIRS")))
+
+ (service home-files-service-type
+ `((".config/plasma-workspace/env/flatpak.sh"
+ ,(plain-file
+ "flatpak.sh"
+ "export XDG_DATA_DIRS=\"$HOME/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:${XDG_DATA_DIRS:-}\"\n"))))
+
+ (service home-xdg-configuration-files-service-type
+ `(("gdb/gdbinit" ,%default-gdbinit)
+ ("nano/nanorc" ,%default-nanorc))))
+ %base-home-services))))
+
+home-config
diff --git a/system.scm b/system.scm
new file mode 100644
index 0000000..e0f7ff5
--- /dev/null
+++ b/system.scm
@@ -0,0 +1,127 @@
+(use-modules (gnu)
+ (gnu system nss)
+ (guix utils)
+ (guix packages)
+ (guix gexp)
+ (nongnu packages linux)
+ (gnu packages)
+ (gnu packages window-management)
+ (gnu packages xorg)
+ (gnu packages vim)
+ (gnu system privilege)
+ ((gnu packages admin) #:select (sudo opendoas))
+ (throne deps))
+
+(use-service-modules desktop
+ sddm
+ ssh
+ xorg)
+
+(operating-system
+ (kernel linux)
+ (firmware (list linux-firmware))
+ (host-name "guixygnu")
+ (timezone "Asia/Tehran")
+ (locale "en_US.utf8")
+
+ (keyboard-layout
+ (keyboard-layout "us" "altgr-intl"))
+
+ (bootloader
+ (bootloader-configuration
+ (bootloader grub-efi-bootloader)
+ (targets '("/boot/efi"))
+ (keyboard-layout keyboard-layout)))
+
+ (file-systems
+ (append
+ (list
+ (file-system
+ (device
+ (uuid "53edb5f0-2a5c-4159-9666-52e486b95a49" 'ext4))
+ (mount-point "/")
+ (type "ext4"))
+ (file-system
+ (device
+ (uuid "4141-8933" 'fat))
+ (mount-point "/boot/efi")
+ (type "vfat")))
+ %base-file-systems))
+
+ (swap-devices
+ (list
+ (swap-space
+ (target
+ (uuid "7ab8ddc5-940e-4180-a825-88becd9b6788")))))
+
+ (users
+ (cons
+ (user-account
+ (name "coast")
+ (password
+ (crypt
+ "coast"
+ "$6$qPWpreldLzlkO54O$l9DciT6EPOv47H3FPDo2f5zoDag9tFHoNWRWi0SKRSeZmMc3PoyW5Ery7INGPiYDvbHQb97jev/H37JV2F.tU1"))
+ (group "users")
+ (supplementary-groups
+ '("wheel" "netdev" "audio" "video")))
+ %base-user-accounts))
+
+ (packages
+ (append
+ (list
+ throne
+ niri
+ xwayland-satellite
+ vim
+ opendoas)
+ (filter
+ (lambda (p)
+ (not (eq? p sudo)))
+ %base-packages)))
+
+ (privileged-programs
+ (cons
+ (privileged-program
+ (program
+ (file-append opendoas "/bin/doas"))
+ (setuid? #t))
+ (cons
+ (privileged-program
+ (program
+ (file-append throne "/libexec/Throne"))
+ (setuid? #f)
+ (setgid? #f)
+ (capabilities
+ "cap_net_bind_service+ep"))
+ (cons
+ (privileged-program
+ (program
+ (file-append throne "/libexec/ThroneCore"))
+ (setuid? #f)
+ (setgid? #f)
+ (capabilities
+ "cap_net_admin,cap_net_raw,cap_net_bind_service,cap_sys_ptrace,cap_dac_read_search+ep"))
+ (filter
+ (lambda (pp)
+ (not
+ (string-contains
+ (with-output-to-string
+ (lambda ()
+ (write
+ (privileged-program-program pp))))
+ "sudo")))
+ %default-privileged-programs)))))
+
+ (services
+ (cons*
+ (service plasma-desktop-service-type)
+ (service
+ sddm-service-type
+ (sddm-configuration
+ (theme "breeze")))
+ (service openssh-service-type)
+ (modify-services %desktop-services
+ (delete gdm-service-type))))
+
+ (name-service-switch %mdns-host-lookup-nss))
diff --git a/throne/deps.scm b/throne/deps.scm
new file mode 100644
index 0000000..c3dae1f
--- /dev/null
+++ b/throne/deps.scm
@@ -0,0 +1,245 @@
+(define-module (throne deps)
+ #:use-module (guix packages)
+ #:use-module (guix git-download)
+ #:use-module (guix download)
+ #:use-module (guix build-system gnu)
+ #:use-module (guix build-system cmake)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix gexp)
+ #:use-module (guix utils)
+ #:use-module (gnu packages base)
+ #:use-module (gnu packages qt)
+ #:use-module (gnu packages cpp)
+ #:use-module (gnu packages protobuf)
+ #:use-module (gnu packages databases)
+ #:use-module (gnu packages commencement)
+ #:use-module (gnu packages sdl)
+ #:use-module (gnu packages pkg-config)
+ #:use-module (gnu packages compression)
+ #:use-module (gnu packages elf)
+ #:export (throne))
+
+(define quirc
+ (package
+ (name "quirc")
+ (version "1.2")
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "https://github.com/dlbeer/quirc.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1pbym7cf34z9za31bdpbi52snklp11jal4axddbk5pppl9hbznnd"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ (list gcc-toolchain pkg-config sdl12-compat))
+ (arguments
+ (list
+ #:tests? #f
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'build
+ (lambda _
+ (invoke "make" "CC=gcc" "libquirc.so")))
+ (replace 'install
+ (lambda _
+ (let ((out (assoc-ref %outputs "out")))
+ (mkdir-p (string-append out "/lib"))
+ (mkdir-p (string-append out "/include"))
+ (install-file
+ "libquirc.so.1.2"
+ (string-append out "/lib"))
+ (symlink
+ (string-append out "/lib/libquirc.so.1.2")
+ (string-append out "/lib/libquirc.so.1"))
+ (symlink
+ (string-append out "/lib/libquirc.so.1.2")
+ (string-append out "/lib/libquirc.so"))
+ (install-file
+ "lib/quirc.h"
+ (string-append out "/include"))))))))
+ (synopsis "QR code recognition library")
+ (description "Quirc is a QR code recognition library.")
+ (home-page "https://github.com/dlbeer/quirc")
+ (license license:isc)))
+
+(define fkyaml
+ (package
+ (name "fkyaml")
+ (version "0.4.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "https://github.com/fktn-k/fkYAML.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1aq658bj2bay31j5300pyxwc2aqpnx4ycgr684b7bb1kcvm4a80i"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list #:tests? #f))
+ (synopsis "Header-only YAML library for C++")
+ (description "fkYAML is a header-only YAML library for C++.")
+ (home-page "https://github.com/fktn-k/fkYAML")
+ (license license:expat)))
+
+(define simple-protobuf
+ (package
+ (name "simple-protobuf")
+ (version "0.0.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "https://github.com/tonda-kriz/simple-protobuf.git")
+ (commit "master")))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1l66dd57b8f6whmaf023b9w1kfqpvqx7nr8gn7y5rq0s0afpsz7k"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list #:tests? #f))
+ (synopsis "Simple protobuf implementation")
+ (description "Simple protobuf implementation.")
+ (home-page "https://github.com/tonda-kriz/simple-protobuf")
+ (license license:expat)))
+
+(define srslist
+ (origin
+ (method url-fetch)
+ (uri
+ "https://raw.githubusercontent.com/throneproj/routeprofiles/rule-set/srslist.h")
+ (sha256
+ (base32
+ "0c3lnd3s524wihiln5pr8iyrj0jwsyjc346mm2kfsp86kapw3dw8"))))
+
+(define throne-core
+ (origin
+ (method url-fetch)
+ (uri
+ "https://github.com/throneproj/Throne/releases/download/1.2.4/Throne-1.2.4-linux-amd64.zip")
+ (sha256
+ (base32
+ "13j47z829frk6qs5d6znsxx8kl4gymbhj3y8fpbjpgk6iprr07cj"))))
+
+(define throne
+ (package
+ (name "throne")
+ (version "1.2.4")
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "https://github.com/throneproj/Throne.git")
+ (commit version)
+ (recursive? #t)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1w137s2hcvdqvk67yhyddbc8klb8z6l0b3y7y2b3g9pb33gr8dkw"))))
+ (build-system cmake-build-system)
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("srslist.h" ,srslist)
+ ("throne-core" ,throne-core)
+ ("unzip" ,unzip)
+ ("patchelf" ,patchelf)
+ ("glibc" ,glibc)))
+ (inputs
+ (list
+ qtbase
+ qtdeclarative
+ qtsvg
+ qttools
+ abseil-cpp
+ protobuf
+ qhotkey
+ quirc
+ fkyaml
+ sqlitecpp
+ simple-protobuf))
+ (arguments
+ (list
+ #:tests? #f
+ #:validate-runpath? #f
+ #:configure-flags
+ #~'("-DNKR_PACKAGE=true")
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch-core-path
+ (lambda _
+ (substitute*
+ '("src/global/Configs.cpp"
+ "src/ui/mainWindow/mainwindow_setup.cpp")
+ (("auto fn = QApplication::applicationDirPath\\(\\) \\+ \"/ThroneCore\";")
+ "auto fn = QFileInfo::exists(\"/run/privileged/bin/ThroneCore\") ? QString(\"/run/privileged/bin/ThroneCore\") : QApplication::applicationDirPath() + \"/ThroneCore\";")
+ (("auto core_path = QApplication::applicationDirPath\\(\\) \\+ \"/\";")
+ "auto core_path = QFileInfo::exists(\"/run/privileged/bin/ThroneCore\") ? QString(\"/run/privileged/bin/ThroneCore\") : QApplication::applicationDirPath() + \"/\";")
+ (("core_path \\+= \"ThroneCore\";")
+ "if (!QFileInfo::exists(\"/run/privileged/bin/ThroneCore\")) core_path += \"ThroneCore\";"))))
+ (add-after 'unpack 'fetch-srslist
+ (lambda _
+ (copy-file
+ (assoc-ref %build-inputs "srslist.h")
+ "srslist.h")))
+ (replace 'install
+ (lambda _
+ (let* ((out (assoc-ref %outputs "out"))
+ (bin (string-append out "/bin"))
+ (libexec (string-append out "/libexec"))
+ (core-archive
+ (assoc-ref %build-inputs "throne-core"))
+ (core-path
+ "throne-core/ThroneCore")
+ (glibc-path
+ (assoc-ref %build-inputs "glibc")))
+ (mkdir-p bin)
+ (mkdir-p libexec)
+ (copy-file
+ "Throne"
+ (string-append libexec "/Throne"))
+ (chmod
+ (string-append libexec "/Throne")
+ #o555)
+ (symlink
+ "/run/privileged/bin/Throne"
+ (string-append bin "/Throne"))
+ (mkdir-p "throne-core")
+ (invoke
+ "unzip"
+ "-q"
+ "-j"
+ core-archive
+ "Throne/ThroneCore"
+ "-d"
+ "throne-core")
+ (invoke
+ "patchelf"
+ "--set-interpreter"
+ (string-append
+ glibc-path
+ "/lib/ld-linux-x86-64.so.2")
+ core-path)
+ (copy-file
+ core-path
+ (string-append libexec "/ThroneCore"))
+ (chmod
+ (string-append libexec "/ThroneCore")
+ #o555)))))))
+ (synopsis "Qt desktop proxy utility")
+ (description "Throne is a Qt-based desktop proxy utility.")
+ (home-page "https://github.com/throneproj/Throne")
+ (license license:gpl3)))
+
+throne