diff options
Diffstat (limited to 'px')
90 files changed, 13892 insertions, 0 deletions
diff --git a/px/bootloader/u-boot.scm b/px/bootloader/u-boot.scm new file mode 100644 index 0000000..f1f8709 --- /dev/null +++ b/px/bootloader/u-boot.scm @@ -0,0 +1,18 @@ +(define-module (px bootloader u-boot) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader u-boot) + #:use-module (guix gexp) + #:use-module (px packages bootloaders) + #:export (u-boot-rpi-arm64-bootloader)) + + +(define install-rpi-arm64-u-boot + #~(lambda (bootloader root-index image) + #t)) + + +(define u-boot-rpi-arm64-bootloader + (bootloader + (inherit u-boot-bootloader) + (package u-boot-rpi-arm64) + (disk-image-installer install-rpi-arm64-u-boot))) diff --git a/px/hardware/lenovo.scm b/px/hardware/lenovo.scm new file mode 100644 index 0000000..89a670a --- /dev/null +++ b/px/hardware/lenovo.scm @@ -0,0 +1,32 @@ +(define-module (px hardware lenovo) + #:use-module (gnu services sddm) + #:use-module (gnu services xorg) + #:use-module (nongnu packages linux) + #:use-module (px system os) + #:use-module (px packages throttled) + #:use-module (px system config) + #:export (%lenovo-thinkpad-t450-template)) + +(define %lenovo-thinkpad-t450-template + (os-template + (title "Lenovo ThinkPad T450 hardware") + (firmwares (list iwlwifi-firmware)) + (packages (list throttled)) + (services (list + (os-template-service + (type 'edit) + (kind sddm-service-type) + (action (lambda (config) + (sddm-configuration + (inherit config) + (xorg-configuration + (xorg-configuration + (extra-config + `( "Section \"InputClass\"\n" + " Identifier \"touchpad\"\n" + " Driver \"libinput\"\n" + " MatchIsTouchpad \"on\"\n" + " Option \"Tapping\" \"on\"\n" + "EndSection\n" + "\n"))))) + ))))))) diff --git a/px/hardware/raspberrypi.scm b/px/hardware/raspberrypi.scm new file mode 100644 index 0000000..2dbde25 --- /dev/null +++ b/px/hardware/raspberrypi.scm @@ -0,0 +1,28 @@ +(define-module (px hardware raspberrypi) + #:use-module (gnu packages admin) + #:use-module (gnu packages linux) + #:use-module (gnu system) + #:use-module (nongnu packages linux) + #:use-module (px system os) + #:use-module (px packages linux) + #:use-module (px services device) + #:export (%raspberry-pi-4-template + %seeed-reterminal-template)) + +(define %raspberry-pi-4-template + (os-template + (title "RaspberryPi 4 hardware") + (packages (list cloud-utils + evtest)) + (services (list (os-template-service + (type 'add) + (kind btuart-service-type)))) + (firmwares (list raspberrypi-firmware + brcm80211-firmware + bluez-firmware)))) + + +(define %seeed-reterminal-template + (os-template + (title "SEEED reTerminal hardware") + (packages (list seeed-reterminal-dtoverlays)))) diff --git a/px/packages/accounts.scm b/px/packages/accounts.scm new file mode 100644 index 0000000..66dc10f --- /dev/null +++ b/px/packages/accounts.scm @@ -0,0 +1,1035 @@ +;;; Online Accounts Packages Module for PantherX +;;; Author: Reza Alizadeh Majd (r.majd@pantherx.org) +;;; Author: Hossein Ghaffari (h.ghaffari@pantherx.org) + +(define-module (px packages accounts) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (guix build-system python) + #:use-module (guix utils) + #:use-module (guix gexp) + #:use-module (gnu packages check) + #:use-module (gnu packages cpp) + #:use-module (gnu packages web) + #:use-module (gnu packages bash) + #:use-module (gnu packages linux) + #:use-module (gnu packages networking) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-crypto) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages python-web) + #:use-module (gnu packages serialization) + #:use-module (gnu packages curl) + #:use-module (gnu packages qt) + #:use-module (gnu packages gcc) + #:use-module (gnu packages base) + #:use-module (gnu packages xml) + #:use-module (px packages common) + #:use-module (px packages contacts-calendar) + #:use-module (px packages networking) + #:use-module (px packages etesync) + #:use-module (px packages library) + #:use-module (px packages python-xyz)) + + +(define-public px-accounts-service + (package + (name "px-accounts-service") + (version "0.4.8") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-accounts-service_v" version ".tgz")) + (sha256 + (base32 "0nw2ggm87mbjrw0xdmq301ygxgai3q4sbpinhk59rf8jhrds182d")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'remove-tests + (lambda _ + (substitute* "tests/CMakeLists.txt" + (("test_rpc_server.cpp") "") + (("test_plugin_system.cpp") "") + (("test_event_system.cpp") "")) + #t)) + (add-after 'install 'register-plugins + (lambda* (#:key inputs outputs #:allow-other-keys) + (define* (register-plugin plugin-name plugin-type #:optional (plugin-path "")) + (let* ((out (assoc-ref outputs "out")) + (python (assoc-ref inputs "python")) + (regpath (string-append out "/etc/px/accounts/plugins")) + (target (cond + ((string=? plugin-type "python") + (string-append out "/lib/python" + ,(version-major+minor (package-version python)) + "/site-packages/")) + ((string=? plugin-type "cpp") + (string-append out "/lib/lib" plugin-name ".so")))) + (data (string-append "plugin:\n" + " name: " plugin-name "\n" + " version: " ,version "\n" + " type: " plugin-type "\n" + " path: " target "\n"))) + (mkdir-p regpath) + (display data) + (with-output-to-file (string-append regpath "/" plugin-name ".yaml") + (lambda _ (format #t data))) + (if (string=? plugin-type "python") + (begin + (mkdir-p target) + (install-file plugin-path target) + (setenv "PYTHONPATH" (string-append target ":" (getenv "GUIX_PYTHONPATH"))))) + #t)) + (register-plugin (string-append ,name "-plugin-python-test") "python" + "src/px_accounts_service_plugin_python_test.py") + (register-plugin (string-append ,name "-plugin-test-public-service") "python" + "src/px_accounts_service_plugin_test_public_service.py") + (register-plugin (string-append ,name "-plugin-cpp-test") "cpp") + (register-plugin (string-append ,name "-plugin-cpp-custom") "cpp")))))) + (inputs `(("yaml-cpp" ,yaml-cpp) + ("capnproto" ,capnproto-0.9))) + (native-inputs `(("catch2" ,catch2) + ("cli11" ,cli11) + ("pkg-config" ,pkg-config) + ("pybind11" ,pybind11-2.6.2) + ("nng" ,nng-1.5) + ("util-linux" ,util-linux "lib"))) + (propagated-inputs `(("python" ,python))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX (Online) AccountsService") + (description "This package provides a background services to manage +Online Accounts in PantherX") + (license license:expat))) + + +(define-public px-accounts-matrix-bridge + (package + (name "px-accounts-matrix-bridge") + (version "0.0.1") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 + (base32 "1nmwdxns7isgr09v5mvhbr3jz60z6ia3ib84wi2q40ja2570k2g0")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f)) + (native-inputs (list pkg-config)) + (inputs + (list capnproto-0.9)) + (home-page "https://www.pantherx.org") + (synopsis "Account integration for Matrix client library") + (description "Add support for Online Accounts integration for Matrix client library") + (license license:expat))) + + +(define-public px-accounts-service-plugin-common + (package + (name "px-accounts-service-plugin-common") + (version "0.0.6") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "1kj84df95bmgy89k0mnxv8hy1l62b2xnyymkgz9rqs6882wk5lqx")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'sanity-check)))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Accounts Service Plugin Commons") + (description "Python classes required for all +Accounts Service plugins.") + (license license:expat))) + + +(define-public px-accounts-library-python + (package + (name "px-accounts-library-python") + (version "0.3.2") + (source + (origin + (method url-fetch) + (uri + (string-append "https://source.pantherx.org/px-accounts-library-python_v" + version ".tgz")) + (sha256 + (base32 "01i3s2wscjdsml59lls91w990rg61a0c0a0pppxd5jqkh6x98za7")))) + (build-system python-build-system) + (arguments `(#:tests? #f)) + (propagated-inputs + `(("python-pycapnp", python-pycapnp) + ("python-pyyaml", python-pyyaml))) + (home-page "https://www.pantherx.org/") + (synopsis "Client library and CLI tool for px-accounts-service") + (description "Python library to work with online accounts service. plus a CLI tool") + (license license:expat))) + + +(define-public px-accounts-service-providers-mail + (package + (name "px-accounts-service-providers-mail") + (version "0.0.8") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 + (base32 "1xr5k3xkdfdfbrl295drb66q03ajb1y1psxmk6ywj6470dwbbq09")))) + (build-system cmake-build-system) + (arguments `(#:tests? #f)) + (propagated-inputs + `(("px-accounts-service-plugin-imap" ,px-accounts-service-plugin-imap) + ("px-accounts-service-plugin-smtp" ,px-accounts-service-plugin-smtp))) + (home-page "https://www.pantherx.org/") + (synopsis "Official Providers package for Online Mail Accounts Service") + (description "Collection of Official defined providers that Online Accounts Service +could load from store") + (license license:expat))) + + + (define-public px-accounts-service-plugin-imap + (package + (name "px-accounts-service-plugin-imap") + (version "0.2.5") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "0asdq32diniz2xa7q19qhhcp52cyzsa5g5l81yi7rz12vmd814sb")))) + (build-system python-build-system) + (arguments `( + #:tests? #f, + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/accounts/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ (format #t regdata)))))) + (delete 'sanity-check)))) + (propagated-inputs + `(("px-accounts-service-plugin-common", px-accounts-service-plugin-common))) + (home-page "https://www.pantherx.org/") + (synopsis "IMAP Protocol Plugin For Online Accounts System") + (description "Provides IMAP protocol support to Online Accounts System") + (license license:expat))) + + + +(define-public px-accounts-service-plugin-smtp + (package + (name "px-accounts-service-plugin-smtp") + (version "0.2.4") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-accounts-service-plugin-smtp_v" + version ".tgz")) + (sha256 + (base32 "1x6ln81h8k6qqm83crdgbkkzcg77sg1wvpvy5qp7nnb0mdji34fv")))) + (build-system python-build-system) + (arguments `( + #:tests? #f, + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/accounts/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ (format #t regdata)))))) + (delete 'sanity-check)))) + (propagated-inputs + `(("px-accounts-service-plugin-common", px-accounts-service-plugin-common))) + (home-page "https://www.pantherx.org/") + (synopsis "SMTP Protocol Plugin For Online Accounts System") + (description "Provides SMTP protocol support to Online Accounts System") + (license license:expat))) + + +(define-public px-oauth2-engine + (package + (name "px-oauth2-engine") + (version "0.3.0") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-oauth2-engine_" + version ".tgz")) + (sha256 + (base32 "19wsr2vs8dy5b99pbv3a1amivz0m6yx1lf6bi1fz9kvsxcz3b63b")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'wrap + ;; The program fails to find the QtWebEngineProcess program, + ;; so we set QTWEBENGINEPROCESS_PATH to help it. + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((bin (string-append (assoc-ref outputs "out") "/bin")) + (qtwebengineprocess (string-append + (assoc-ref inputs "qtwebengine") + "/lib/qt5/libexec/QtWebEngineProcess"))) + (for-each (lambda (program) + (wrap-program program + `("QTWEBENGINEPROCESS_PATH" = + (,qtwebengineprocess)))) + (find-files bin ".*"))) + #t))))) + (inputs `( + ("rapidjson" ,rapidjson) + ("qt" ,qtbase-5) + ("qtdeclarative" ,qtdeclarative-5) + ("qtnetworkauth-5" ,qtnetworkauth-5) + ("qtwebengine" ,qtwebengine-5) + ("qtwebchannel-5" ,qtwebchannel-5) + ("bash-minimal" ,bash-minimal))) + (native-inputs `( + ("curl" ,curl) + ("pkg-config" ,pkg-config))) + (home-page "https://www.pantherx.org/") + (synopsis "Official Providers package for Online Accounts Service") + (description "Collection of Official defined providers that Ocline Accounts Service +could load from store") + (license license:expat))) + + +(define-public px-accounts-service-plugin-etherscan + (package + (name "px-accounts-service-plugin-etherscan") + (version "0.2.5") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "0jq81nrjslp4c2kz6vnrns13n65rx248ij28grrm7lkz4mbnb8y7")))) + (build-system python-build-system) + (arguments `( + #:tests? #f, + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/accounts/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ (format #t regdata)))))) + (delete 'sanity-check)))) + (propagated-inputs + `(("px-online-sources-library", px-online-sources-library) + ("px-accounts-service-plugin-common", px-accounts-service-plugin-common))) + (home-page "https://www.pantherx.org/") + (synopsis "Etherscan provider plugin (Online) Accounts Service") + (description "Provides Etherscan support to Online Accounts System") + (license license:expat))) + + +(define-public px-accounts-service-plugin-blockio + (package + (name "px-accounts-service-plugin-blockio") + (version "0.2.4") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 (base32 "0rmx12122l1hi1smayyf7a19ss2rg53ck2db8y6y0g27zxnzwz9n")))) + (build-system python-build-system) + (arguments `( + #:tests? #f, + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/accounts/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ (format #t regdata)))))) + (delete 'sanity-check)))) + (propagated-inputs + `(("px-online-sources-library", px-online-sources-library) + ("px-accounts-service-plugin-common", px-accounts-service-plugin-common))) + (home-page "https://www.pantherx.org/") + (synopsis "Bitcoin Plugin For Online Accounts System") + (description "Provides bitcoin support to Online Accounts System") + (license license:expat))) + + +(define-public px-accounts-service-plugin-cryptocurrency + (package + (name "px-accounts-service-plugin-cryptocurrency") + (version "v0.2.1") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-online-accounts-plugin-cryptocurrency_" + version ".tgz")) + (sha256 + (base32 "1zqk5j52dpcg0lkyy7zk9n2d4ibg2wpbshdihafrx22d2d3y53zk")))) + (build-system python-build-system) + (arguments `( + #:tests? #f, + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/accounts/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ (format #t regdata))))))))) + (inputs `( + ("python-pycapnp" ,python-pycapnp))) + (propagated-inputs + `(("px-accounts-library-python", px-accounts-library-python) + ("px-secret-library-python", px-secret-library-python) + ("px-online-sources-library", px-online-sources-library) + ("px-accounts-service-plugin-common", px-accounts-service-plugin-common))) + (home-page "https://www.pantherx.org/") + (synopsis "Cryptocurrency Plugin For Online Accounts Service") + (description "Adds support for Ethereum and Bitcoin wallet addresses in Accounts Service.") + (license license:expat))) + + +(define-public px-accounts-service-plugin-etesync + (package + (name "px-accounts-service-plugin-etesync") + (version "0.1.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "16zzqh9lb5gb1yn12v48akh5rfidssxjah9f3jg8hpzy0qaca64z")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-version + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* (string-append "plugins/" ,name ".yaml") + (("PLUGIN_PATH") (assoc-ref outputs "out")) + (("PLUGIN_VERSION") ,version)))) + (delete 'sanity-check)))) + (propagated-inputs `(("etesync-dav" ,etesync-dav) + ("px-contacts-calendar" ,px-contacts-calendar) + ("python-etesync" ,python-etesync))) + (home-page "https://www.pantherx.org/") + (synopsis "EteSync Plugin for Online Accounts Service") + (description "Support Etesync account as a CardDAV/CalDAV provider") + (license license:expat))) + + +(define-public px-accounts-service-plugin-gitlab + (package + (name "px-accounts-service-plugin-gitlab") + (version "0.2.3") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "1j82f3m3y52kcamv2pnipi5gb4h2yxisshq4r3nkb5ar0i8hyrp2")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/accounts/plugins")) + (regdata (string-append "plugin:" + "\n name: " ,name + "\n version: " ,version + "\n type: " type + "\n path: " out + "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ (format #t regdata)))))) + (delete 'sanity-check)))) + (propagated-inputs + `(("px-online-sources-library", px-online-sources-library) + ("px-accounts-service-plugin-common", px-accounts-service-plugin-common))) + (home-page "https://www.pantherx.org/") + (synopsis "GitLab provider plugin for (Online) Accounts Service") + (description "Adds support for GitLab accounts with access token to Accounts Service") + (license license:expat))) + +(define-public px-accounts-service-plugin-discourse + (package + (name "px-accounts-service-plugin-discourse") + (version "0.0.3") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 (base32 "0pgw46k20ms5nzsx79xydk7synqs1k617gk432grl1wcsy5a1hii")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/accounts/plugins")) + (regdata (string-append "plugin:" + "\n name: " ,name + "\n version: " ,version + "\n type: " type + "\n path: " out + "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ (format #t regdata)))))) + (delete 'sanity-check)))) + (propagated-inputs + `(("px-online-sources-library", px-online-sources-library) + ("px-accounts-service-plugin-common", px-accounts-service-plugin-common))) + (home-page "https://www.pantherx.org/") + (synopsis "Discourse provider plugin for (Online) Accounts Service") + (description "Adds support for Discourse accounts with access token to Accounts Service") + (license license:expat))) + + + +(define-public px-accounts-service-plugin-github + (package + (name "px-accounts-service-plugin-github") + (version "0.2.3") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "17cav8xracpnlxyxgimsjbxwxbn7g5gpm7446a3lsj5lrqjyy87m")))) + (build-system python-build-system) + (arguments `( + #:tests? #f, + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/accounts/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ (format #t regdata)))))) + (delete 'sanity-check)))) + (propagated-inputs + `(("px-online-sources-library", px-online-sources-library) + ("px-accounts-service-plugin-common", px-accounts-service-plugin-common))) + (home-page "https://www.pantherx.org/") + (synopsis "GitHub provider plugin for Online Accounts Service") + (description "Adds support for GitHub to Accounts Service.") + (license license:expat))) + + +(define-public px-accounts-service-plugin-trojita + (package + (name "px-accounts-service-plugin-trojita") + (version "0.0.6") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-accounts-service-plugin-trojita_v" + version ".tgz")) + (sha256 (base32 "0k4bybh56ff0d303ik5vnd371fzr8wcm25l79rmfbxv3rd32dxm2")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/accounts/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file + (string-append regpath "/" ,name ".yaml") + (lambda _ (format #t regdata))))))))) + (home-page "https://www.pantherx.org/") + (synopsis "Trojita Plugin for Online Accounts Service") + (description "Add or modify trojita account details using Online Accounts Service") + (license license:expat))) + +(define-public px-accounts-service-plugin-oauth2-github + (package + (name "px-accounts-service-plugin-oauth2-github") + (version "v0.2.3") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-accounts-service-plugin-github-oauth_" + version ".tgz")) + (sha256 + (base32 "1znvcl0sy47zpn635h13lj5js1s0lbakk2x18bnmy1ygrqg2c309")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "cpp") + (regpath (string-append out "/etc/px/accounts/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "/lib/lib" ,name ".so\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ + (format #t regdata))) + ))) + ))) + (inputs `( + ("rapidjson" ,rapidjson))) + (propagated-inputs `( + ("px-oauth2-engine" ,px-oauth2-engine))) + (native-inputs `( + ("pkg-config" ,pkg-config))) + (home-page "https://www.pantherx.org/") + (synopsis "Github-OAuth2 Plugin For Online Accounts System") + (description "Plugin to login, get github notifications and access to git account with OAUTH2 protocol.") + (license license:expat))) + +(define-public px-accounts-service-plugin-oauth2-mastodon + (package + (name "px-accounts-service-plugin-oauth2-mastodon") + (version "v0.1.1") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" + version ".tgz")) + (sha256 + (base32 "05pd5x0cksw6q5pzq03cymbxlycmbam5a0jy16pvx4p1m4kwwl0z")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "cpp") + (regpath (string-append out "/etc/px/accounts/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "/lib/lib" ,name ".so\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ + (format #t regdata))))))))) + (inputs `(("rapidjson" ,rapidjson) + ("curl" ,curl))) + (propagated-inputs `(("px-oauth2-engine" ,px-oauth2-engine))) + (native-inputs `(("pkg-config" ,pkg-config))) + (home-page "https://www.pantherx.org/") + (synopsis "Mastodon-OAuth2 protocol plugin for (Online) Accounts Service") + (description "Plugin to login and access to mastodon account with OAUTH2 protocol.") + (license license:expat))) + +(define-public px-accounts-service-plugin-oauth2-google + (package + (name "px-accounts-service-plugin-oauth2-google") + (version "v0.2.5") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" + version ".tgz")) + (sha256 + (base32 "1h8v3p9yf8b5p207fs70lzkm9g4x1idqgd4alqd4661lpxphr140")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "cpp") + (regpath (string-append out "/etc/px/accounts/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "/lib/lib" ,name ".so\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ + (format #t regdata))))))))) + (inputs `(("rapidjson" ,rapidjson))) + (propagated-inputs `( + ("px-oauth2-engine" ,px-oauth2-engine))) + (native-inputs `( + ("pkg-config" ,pkg-config))) + (home-page "https://www.pantherx.org/") + (synopsis "Google-OAuth2 protocol plugin for (Online) Accounts Service") + (description "Plugin to login and access to Google account with OAUTH2 protocol.") + (license license:expat))) + + +(define-public px-accounts-service-plugin-claws-mail + (package + (name "px-accounts-service-plugin-claws-mail") + (version "0.2.9") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "0fvq8sqiph6hkwcz8ya93lr0wd2faczi6xi6vjbqqmwmzlx35xxn")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-version + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* (string-append "plugins/" ,name ".yaml") + (("PLUGIN_PATH") (assoc-ref outputs "out")) + (("PLUGIN_VERSION") ,version)))) + (delete 'sanity-check)))) + (propagated-inputs + `(("python-pbkdf2" ,python-pbkdf2) + ("python-pycryptodomex" ,python-pycryptodomex) + ("python-imap-tools" ,python-imap-tools) + ("python-lxml" ,python-lxml))) + (home-page "https://www.pantherx.org/") + (synopsis "Claws Mail plugin for Online Accounts Service") + (description "Support Claws Mail account for Online Accounts Service") + (license license:expat))) + +(define-public px-accounts-service-plugin-s3 + (package + (name "px-accounts-service-plugin-s3") + (version "0.2.6") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "0zqaxfh2vks0a6wgh2qs9nf3dbprnvr8vyv3hq448wx5db9yrbyz")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/accounts/plugins")) + (regdata (string-append "plugin:" + "\n name: " ,name + "\n version: " ,version + "\n type: " type + "\n path: " out + "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ (format #t regdata)))))) + (delete 'sanity-check)))) + (propagated-inputs + `(("python-botocore" ,python-botocore) + ("px-accounts-service-plugin-common", px-accounts-service-plugin-common))) + (home-page "https://www.pantherx.org/") + (synopsis "S3 protocol support for (Online) Accounts Service") + (description "Adds support for S3 (AWS/Wasabi) to Accounts Service") + (license license:expat))) + +(define-public px-accounts-service-plugin-cm + (package + (name "px-accounts-service-plugin-cm") + (version "0.1.3") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "11rs7jrx69798fr19byp9grqr4i3ym3hmwnffand36dh9niz8sz0")))) + (build-system python-build-system) + (propagated-inputs + `(("python-pyqt" ,python-pyqt) + ("python-pyyaml" ,python-pyyaml) + ("python-qrcode" ,python-qrcode) + ("python-requests" ,python-requests))) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'reguster-plugin + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "plugins/px-accounts-service-plugin-cm.yaml" + (("PLUGIN_PATH") (assoc-ref outputs "out")) + (("PLUGIN_VERSION") ,version))))))) + (home-page "https://www.pantherx.org/") + (synopsis "Central Management plugin for Online Accounts Service") + (description "Add support for the Central Management to the +online accounts service") + (license license:expat))) + + +(define-public px-accounts-service-plugin-carddav + (package + (name "px-accounts-service-plugin-carddav") + (version "0.2.3") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "0hgq3vwdcvswikf6ii4rhl6aykmb6rb2n7naa5m9s65zxsc1d7rk")))) + (build-system python-build-system) + (arguments `( + #:tests? #f, + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/accounts/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ (format #t regdata)))))) + (delete 'sanity-check)))) + (propagated-inputs + `(("python-requests" ,python-requests) + ("px-accounts-service-plugin-common", px-accounts-service-plugin-common))) + (home-page "https://www.pantherx.org/") + (synopsis "CardDAV protocol plugin (Online) Accounts Service") + (description "Provides CardDAV support to Online Accounts System") + (license license:expat))) + +(define-public px-accounts-service-plugin-backup-local + (package + (name "px-accounts-service-plugin-backup-local") + (version "0.0.2") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "0ycjd8gyd53s6hc7xvbf9bmswx53xa73pq2a4mhljavgcyldsakk")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/accounts/plugins")) + (regdata (string-append "plugin:" + "\n name: " ,name + "\n version: " ,version + "\n type: " type + "\n path: " out + "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ (format #t regdata)))))) + (delete 'sanity-check)))) + (propagated-inputs + `(("px-accounts-service-plugin-common", px-accounts-service-plugin-common))) + (home-page "https://www.pantherx.org/") + (synopsis "Local backup account plugin for Online Accounts Service") + (description "Adds support to save a password for +automatic, local backups with px-backup, to Online Accounts Service.") + (license license:expat))) + + +(define-public px-accounts-service-plugin-activity-watch + (package + (name "px-accounts-service-plugin-activity-watch") + (version "0.0.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "1zgl625ay8g8xlwc7bgchcd7yx9y43kjxnpgxxc90kg737lvaa54")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-path + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "plugins/px-accounts-service-plugin-activity-watch.yaml" + (("PLUGIN_PATH") (assoc-ref outputs "out")) + (("PLUGIN_VERSION") ,version)))) + (delete 'sanity-check)))) + (propagated-inputs + `(("px-accounts-service" ,px-accounts-service) + ("px-accounts-service-plugin-common" ,px-accounts-service-plugin-common) + ("python-appdirs" ,python-appdirs) + ("python-psutil" ,python-psutil) + ("python-pyyaml" ,python-pyyaml))) + (home-page "https://www.pantherx.org") + (synopsis "ActivityWatch plugin for Online Accounts Service") + (description "Support ActivityWatch for PantherX Online Accounts Service") + (license license:expat))) + + +(define-public px-accounts-service-plugin-maestral + (package + (name "px-accounts-service-plugin-maestral") + (version "0.0.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "0fsivz2mxzpgjpgspr3pggj8wjanvnmipwpj2hq7c7s3wqzd499i")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-path + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "plugins/px-accounts-service-plugin-maestral.yaml" + (("PLUGIN_PATH") (assoc-ref outputs "out")) + (("PLUGIN_VERSION") ,version)))) + (delete 'sanity-check)))) + + (propagated-inputs + `(("px-accounts-service" ,px-accounts-service) + ("px-accounts-service-plugin-common" ,px-accounts-service-plugin-common) + ("python-click" ,python-click-8) + ("python-pyqt" ,python-pyqt) + ("python-maestral" ,python-maestral))) + (home-page "https://www.pantherx.org") + (synopsis "Dropbox (Maestral) plugin for Online Accounts Service") + (description "Support Dropbox (Maestral) plugin for PantherX Online Accounts Service") + (license license:expat))) + + +(define-public px-accounts-service-plugin-matrix + (package + (name "px-accounts-service-plugin-matrix") + (version "0.0.2") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "16f9fzv57p4zb047wxj4d8kw49h9k3m8wi22bi9914svd7nh46dv")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'sanity-check) + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (regpath (string-append out "/etc/px/accounts/plugins"))) + (mkdir-p regpath) + (call-with-output-file (string-append regpath "/" ,name ".yaml") + (lambda (port) + (format port (string-append "plugin:\n" + " name: ~a\n" + " version: ~a\n" + " type: python\n" + " path: ~a\n") + ,name , version out))))))))) + (propagated-inputs + `(("python-requests" ,python-requests) + ("px-accounts-service-plugin-common" ,px-accounts-service-plugin-common))) + (home-page "https://www.pantherx.org") + (synopsis "Matrix plugin for Online Accounts Service") + (description "Matrix plugin for Online Accounts Service") + (license license:expat))) diff --git a/px/packages/activity.scm b/px/packages/activity.scm new file mode 100644 index 0000000..8858931 --- /dev/null +++ b/px/packages/activity.scm @@ -0,0 +1,59 @@ +(define-module (px packages activity) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (guix build-system trivial) + #:use-module (guix utils) + #:use-module (gnu packages compression) + #:use-module (guix git-download) + #:use-module (guix build utils) + #:use-module (px packages common) + #:use-module (guix build-system gnu) + #:use-module (guix git-download) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages) + #:use-module (gnu packages certs) + #:use-module (gnu packages tls) + #:use-module (gnu packages icu4c) + #:use-module (gnu packages perl) + #:use-module (gnu packages python) + #:use-module (gnu packages shells) + #:use-module (gnu packages curl) + #:use-module (gnu packages web) + #:use-module (gnu packages documentation) + #:use-module (gnu packages tls) + #:use-module (gnu packages serialization)) + + +(define-public px-org-remote-user-activity-service + (package + (name "px-org-remote-user-activity-service") + (version "0.0.4") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 + (base32 + "0zjry2gflrk9vpwhlyy4ik8c4gnh8sz4lay3dfrm789ym0yv5lxd")))) + (build-system cmake-build-system) + (arguments + `(#:configure-flags '("../") #:tests? #f)) + (inputs `( + ("yaml-cpp", yaml-cpp) + ("rapidjson", rapidjson) + ("nss-certs",nss-certs) + ("openssl",openssl) + ("curl",curl))) + ; (native-inputs `( +; ("pkg-config" ,pkg-config) + ; )) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX PXCENTRAL Activity Service") + (description "Report Activity Watch events to Central Management") + (license license:expat))) + + + diff --git a/px/packages/activitywatch.scm b/px/packages/activitywatch.scm new file mode 100644 index 0000000..a4228b0 --- /dev/null +++ b/px/packages/activitywatch.scm @@ -0,0 +1,146 @@ +(define-module (px packages activitywatch) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (ice-9 match) + #:use-module (nonguix build-system binary) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages bash) + #:use-module (gnu packages nss) + #:use-module (gnu packages gtk) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages xorg) + #:use-module (gnu packages xml) + #:use-module (gnu packages xdisorg) + #:use-module (gnu packages gl) + #:use-module (gnu packages linux) + #:use-module (gnu packages cups) + #:use-module (gnu packages gcc)) + +(define* (make-aw-release-asset version asset hash) + (origin + (method url-fetch) + (uri + (string-append + "https://github.com/ActivityWatch/activitywatch/releases/download/v" + version "/" asset "-v" version "-" + (match (or (%current-system) (%current-target-system)) + ("x86_64-linux" "linux-x86_64") + ("i686-linux" "linux-ia32") + ("aarch64-linux" "linux-arm64") + ("armhf-linux" "linux-armv7l")) + ".zip")) + (sha256 + (base32 hash)))) + +(define-public activitywatch + (package + (name "activitywatch") + (version "0.11.0") + (source #f) + (build-system binary-build-system) + (arguments + `(#:patchelf-plan + `(("opt/activitywatch/aw-qt" + ("libxkbcommon" "xkeyboard-config" "libxcb" "glibc" "gcc:lib")) + ("opt/activitywatch/aw-server/aw-server" ("glibc")) + ("opt/activitywatch/aw-server-rust/aw-server-rust" ("glibc")) + ("opt/activitywatch/aw-watcher-afk/aw-watcher-afk" ("glibc")) + ("opt/activitywatch/aw-watcher-window/aw-watcher-window" ("glibc"))) + #:phases + (modify-phases %standard-phases + (replace 'unpack + (lambda* (#:key inputs outputs #:allow-other-keys) + (invoke "unzip" (assoc-ref inputs "activitywatch")) + (mkdir "opt") + (invoke "mv" "activitywatch" "opt/") + (substitute* '("opt/activitywatch/aw-qt.desktop") + (("aw-qt") (string-append %output "/bin/aw-qt"))) + ;; remove for conflicting issue with libpng + (invoke "rm" "opt/activitywatch/libz.so.1") + ;; mv desktop file + (mkdir-p "share/applications/") + (invoke "mv" "opt/activitywatch/aw-qt.desktop" "share/applications/") + ;; + (mkdir-p "share/icons/hicolor/512x512/apps/") + (invoke "cp" "opt/activitywatch/aw-server/aw_server/static/static/logo.png" "share/icons/hicolor/512x512/apps/activitywatch.png") + #t)) + (add-after 'install 'symlink-binary-file-and-cleanup + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (realexecpath (string-append %output "/opt/activitywatch/aw-qt ")) + (sh_path (string-append %output "/bin/aw-qt")) + (sh_content (string-append "#!" (assoc-ref inputs "bash") "/bin/bash\n" + "export ROCKET_ENV=production\n" + "if [ $# -eq 0 ]; then " + realexecpath "--autostart-modules aw-server-rust,aw-watcher-afk,aw-watcher-window;" + "else " + realexecpath "$@;" + "fi"))) + (invoke "rm" (string-append %output "/environment-variables")) + (mkdir-p (string-append %output "/bin")) + (with-output-to-file sh_path + (lambda _ (format #t sh_content))) + (chmod sh_path #o555)) + #t)) + (add-after 'install 'wrap-where-patchelf-does-not-work + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (wrap-program (string-append out "/opt/activitywatch/aw-qt") + `("QT_XKB_CONFIG_ROOT" ":" + prefix + (,(string-join + (list + (string-append (assoc-ref inputs "xkeyboard-config") "/share/X11/") + out) + ":")))) + (wrap-program (string-append out "/opt/activitywatch/aw-qt") + `("FONTCONFIG_PATH" ":" + prefix + (,(string-join + (list + (string-append (assoc-ref inputs "fontconfig") "/etc/fonts") + out) + ":")))) + (wrap-program (string-append out "/opt/activitywatch/aw-qt") + `("LD_LIBRARY_PATH" ":" + prefix + (,(string-join + (list + (string-append (assoc-ref inputs "mesa") "/lib") + (string-append (assoc-ref inputs "fontconfig") "/lib") + (string-append (assoc-ref inputs "zlib") "/lib") + (string-append (assoc-ref inputs "libxcb") "/lib") + (string-append (assoc-ref inputs "glibc") "/lib") + (string-append (assoc-ref inputs "gcc") "/lib") + (string-append (assoc-ref inputs "freetype") "/lib") + (string-append out "/opt/activitywatch") + out) + ":"))))) + #t))))) + (native-inputs + `(("unzip" ,unzip))) + (inputs + `(("activitywatch" + ,(make-aw-release-asset + version "activitywatch" + "1w62s9y8z6yn2mv55npsg1rfi2az4lim62v4awxwq1xzx4249pi0")) + ("gcc:lib" ,gcc "lib") + ("gcc" ,gcc "lib") + ("glibc" ,glibc) + ("fontconfig" ,fontconfig) + ("freetype" ,freetype) + ("libxcb" ,libxcb) + ("libxkbcommon" ,libxkbcommon) + ("mesa" ,mesa) + ("xkeyboard-config" ,xkeyboard-config) + ("zlib" ,zlib) + ("bash-minimal" ,bash-minimal))) + (home-page "https://activitywatch.net/") + (synopsis "ActivityWatch is an automatic time-tracking software which helps you keep track of what you do.") + (description "ActivityWatch is about recording our digital lives, an evergrowing part of our lives in general, and the new opportunities enabled by such a record.") + (license license:mpl2.0))) diff --git a/px/packages/aidc.scm b/px/packages/aidc.scm new file mode 100644 index 0000000..9c8ec9a --- /dev/null +++ b/px/packages/aidc.scm @@ -0,0 +1,94 @@ +(define-module (px packages aidc) + #:use-module (gnu packages) + #:use-module (guix gexp) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (gnu packages autotools) + #:use-module (gnu packages check) + #:use-module (gnu packages imagemagick) + #:use-module (gnu packages gettext) + #:use-module (gnu packages glib) + #:use-module (gnu packages gtk) + #:use-module (gnu packages image) + #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages pretty-print) + #:use-module (gnu packages qt) + #:use-module (gnu packages stb) + #:use-module (gnu packages video) + #:use-module (guix build-system cmake) + #:use-module (guix build-system gnu)) + +(define-public zxing-cpp-08978e2 + (let ((revision "0") + (commit "08978e2c6cf3befb54320c9ca8ab33f7775e6ec4")) + (package + (name "zxing-cpp-08978e2") + (version (git-version "1.2.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nu-book/zxing-cpp") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "13wzs7dhb7vv7j9i40gib4ns9bfsp4kkdx4gkgykgqqb4imvvvvp")))) + (arguments '(#:tests? #f + #:configure-flags '("-DBUILD_BLACKBOX_TESTS=OFF"))) + (build-system cmake-build-system) + (native-inputs (list fmt-8 googletest)) + (synopsis "C++ port of ZXing") + (description "ZXing-CPP is a barcode scanning library.") + (home-page "https://github.com/nu-book/zxing-cpp") + (license license:asl2.0)))) + +(define-public scodes + (let ((revision "0") + (commit "fac97f2800db37c7f018813c16038799e6e224cd")) + (package + (name "scodes") + (version (git-version "0.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/scytheStudio/SCodes") + (commit commit))) + (file-name (git-file-name name version)) + (patches + (search-patches "scodes-zxing-path.patch")) + (sha256 + (base32 + "0vbbz8z04c3w370vbjq85xd9kkykcb0xm3rrkcb71k0ycrrhc183")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f ; no test suite + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'zxing-path-patch + (lambda* (#:key inputs #:allow-other-keys) + (let ((zxing-cpp-08978e2 (assoc-ref inputs "zxing-cpp-08978e2"))) + (chdir "src") + (substitute* "CMakeLists.txt" + (("/usr/local/include/ZXing") + (string-append zxing-cpp-08978e2 "/include/ZXing"))) + (invoke "cat" "CMakeLists.txt") + #t)))))) + (inputs (list qtbase-5 + qtdeclarative-5 + qtmultimedia-5 + qtquickcontrols-5 + qtquickcontrols2-5 + stb-image + stb-image-write + zxing-cpp-08978e2 + )) + (synopsis "Qt & Qml wrapper for ZXing library") + (description "Qt & Qml wrapper for ZXing library") + (home-page "https://github.com/scytheStudio/SCodes") + (license license:asl2.0)))) +
\ No newline at end of file diff --git a/px/packages/atril-thumbnailer.scm b/px/packages/atril-thumbnailer.scm new file mode 100644 index 0000000..3efbdee --- /dev/null +++ b/px/packages/atril-thumbnailer.scm @@ -0,0 +1,32 @@ +(define-module (px packages atril-thumbnailer) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (gnu packages mate)) + +(define-public atril-thumbnailer + (package + (inherit atril) + (name "atril-thumbnailer") + (version (package-version atril)) + (source + (origin + (inherit (package-source atril)) + (uri (string-append "mirror://mate/" (version-major+minor version) "/" + "atril-" version ".tar.xz")))) + (arguments + (substitute-keyword-arguments (package-arguments atril) + ((#:phases phases) + `(modify-phases ,phases + (replace 'build + (lambda _ + (invoke "make" "thumbnailer") + #t)) + (replace 'install + (lambda _ + (invoke "make" "install" "thumbnailer") + #t)) + (add-after 'install 'remove-desktop-file + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (invoke "rm" (string-append out "/share/applications/atril.desktop")) + #t))))))))) diff --git a/px/packages/backup.scm b/px/packages/backup.scm new file mode 100644 index 0000000..6d60bd1 --- /dev/null +++ b/px/packages/backup.scm @@ -0,0 +1,92 @@ +;;; Backup Packages Module for PantherX + +(define-module (px packages backup) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix gexp) + #:use-module (guix build-system trivial) + #:use-module (guix build-system python) + #:use-module (guix utils) + #:use-module (gnu packages compression) + #:use-module (gnu packages base) + #:use-module (gnu packages gnupg) + #:use-module (gnu packages python) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages bash) + #:use-module (gnu packages backup) + #:use-module (px packages accounts) + #:use-module (px packages library) + #:use-module (px packages tarsnap)) + + (define-public px-org-remote-backup-service + (package + (name "px-org-remote-backup-service") + (version "v0.0.6") + (source (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-org-remote-backup-service_" + version + ".tgz")) + (sha256 + (base32 + "062p4p6jf8y8cw2pdxj50sw00sw9lfh404168ljhqqgzwhdxpp6p")))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils) + (srfi srfi-26)) + (let* ((source (assoc-ref %build-inputs "source")) + (tar (assoc-ref %build-inputs "tar")) + (ls (assoc-ref %build-inputs "source")) + (gzip (assoc-ref %build-inputs "gzip")) + (bin-dir (string-append %output "/bin")) + (backup-bin-file (string-append bin-dir "/" ,"px-org-remote-backup-create.sh")) + (restore-bin-file (string-append bin-dir "/" ,"px-org-remote-backup-restore.sh")) + (bash-bin (string-append (assoc-ref %build-inputs "bash") + "/bin"))) + (mkdir-p bin-dir) + (setenv "PATH" (string-append gzip "/bin")) + (invoke (string-append tar "/bin/tar") "xvf" source "-C" bin-dir) + (patch-shebang backup-bin-file (list bash-bin)) + (patch-shebang restore-bin-file (list bash-bin)) + (chmod backup-bin-file #o555) + (chmod restore-bin-file #o555))))) + (native-inputs `(("tar" ,tar) + ("gzip" ,gzip) + )) + (inputs `(("bash" ,bash))) + (propagated-inputs `(("tarsnap" ,tarsnap))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Backup/Restore shell scripts") + (description + "This package provides two scripts for create backup and restore based on given user as parameter.") + (license license:expat))) + + +(define-public px-backup + (package + (name "px-backup") + (version "0.2.5") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "0pzmq8kiw740nj1iswba5k7j0rqicrai27mbl2xiqf1k5r3406ra")))) + (build-system python-build-system) + (propagated-inputs + `(("restic", restic) + ("python-psutil", python-psutil) + ("python-appdirs", python-appdirs) + ("python-pyyaml", python-pyyaml) + ("px-secret-library-python", px-secret-library-python) + ("px-accounts-library-python", px-accounts-library-python))) + (home-page "https://www.pantherx.org/") + (synopsis "Client library and CLI tool for easy backup") + (description "Python library that integrates with Accounts and Secrets +to provide a more automated backup experience. The CLI may be +accessed via: px-backup-cli") + (license license:expat))) diff --git a/px/packages/base.scm b/px/packages/base.scm new file mode 100644 index 0000000..054b806 --- /dev/null +++ b/px/packages/base.scm @@ -0,0 +1,114 @@ +;;; PantherX System Configuration Module +;;; This module supports configuration modules for PantherX OS definitions +;;; +;;; Reza Alizadeh Majd <r.majd@pantherx.org> +;;; Franz Geffke <franz@pantherx.org> +;;; + +(define-module (px packages base) + #:use-module (gnu packages admin) + #:use-module (gnu packages certs) + #:use-module (gnu packages curl) + #:use-module (gnu packages dunst) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages linux) + #:use-module (gnu packages networking) + #:use-module (gnu packages openbox) + #:use-module (gnu packages screen) + #:use-module (gnu packages security-token) + #:use-module (gnu packages tls) + #:use-module (gnu packages xorg) + #:use-module (gnu system) + #:use-module (px packages activity) + #:use-module (px packages desktop) + #:use-module (px packages device) + #:use-module (px packages multimedia) + #:use-module (px packages package-management) + #:use-module (px packages setup) + #:use-module (px packages themes) + #:use-module (guix gexp) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:export (%px-core-packages + + %px-desktop-packages-gtk + %px-desktop-packages-qt + %px-desktop-packages + %px-desktop-ee-packages + + %px-server-packages + %px-server-ee-packages + + %px-core-arm-packages + %px-gui-arm-packages + %px-desktop-arm-packages)) + +;;; +;;; CORE +;;; + +(define %px-core-packages + (append (list px ;; User and system updates + px-install px-setup-assistant ;; System installation + gnutls nss-certs ;; TLS library and NNS certificates + screen) + %base-packages)) + +;;; +;;; DESKTOP +;;; + +(define %px-desktop-packages-gtk + (append + %gtk-desktop-applications + %common-desktop-applications + %px-core-packages)) + +(define %px-desktop-packages-qt + (append + %qt-desktop-applications + %common-desktop-applications + %px-core-packages)) + +(define %px-desktop-packages + (append + %px-desktop-packages-qt)) + +(define %px-desktop-ee-packages + (append (list px-device-identity + px-org-remote-user-activity-service) + %px-desktop-packages)) + +;;; +;;; SERVER +;;; + +(define %px-server-packages + (append (list ) + %px-core-packages)) + +(define %px-server-ee-packages + (append (list px-device-identity) + %px-server-packages)) + +;;; +;;; ARM-SPECIFIC +;;; + +(define %px-core-arm-packages + (append (list cloud-utils ;; disk utilities + gnutls nss-certs curl ;; networking + evtest ;; hardware status + %base-packages))) + +(define %px-gui-arm-packages + (append (list openbox ;; window manager + libnotify dunst dbus ;; desktop notifications + xterm xdg-utils + %px-core-arm-packages))) + +(define %px-desktop-arm-packages + (append (list px-sddm-theme) + %base-packages))
\ No newline at end of file diff --git a/px/packages/bootloaders.scm b/px/packages/bootloaders.scm new file mode 100644 index 0000000..3e5e49c --- /dev/null +++ b/px/packages/bootloaders.scm @@ -0,0 +1,64 @@ +;;; Bootloader definitions for PantherX OS +;;; Author: Reza Alizadeh Majd <r.majd@pantherx.org> +;;; + +(define-module (px packages bootloaders) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader u-boot) + #:use-module (gnu packages) + #:use-module (gnu packages bootloaders) + #:use-module (gnu packages firmware) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix utils) + ; #:export (u-boot-khadas-edge-rk3399-bootloader) +) + +;;; required items: +;;; 1. bootloader package +;;; 2. bootloader definition +;;; + +; (define-public u-boot-khadas-edge-rk3399 +; (let ((base (make-u-boot-package "khadas-edge-rk3399" "aarch64-linux-gnu"))) +; (package +; (inherit base) +; (arguments +; (substitute-keyword-arguments (package-arguments base) +; ((#:phases phases) +; `(modify-phases ,phases +; (add-after 'unpack 'set-environment +; (lambda* (#:key inputs #:allow-other-keys) +; ;; Reference: +; ;; https://github.com/krescue/khadas-uboot/blob/2a2c7b5058b8cf26b4aa315d463f2c32c32d1abb/packages/arm-trusted-firmware/package.mk#L23 +; (setenv "BL31" (string-append (assoc-ref inputs "firmware") +; "/bl31.elf")) +; #t)) +; ;; Phases do not succeed on bl31 ELF. +; (delete 'strip) +; (delete 'validate-runpath))))) +; (native-inputs +; `(("firmware" ,arm-trusted-firmware-rk3399) +; ,@(package-native-inputs base)))))) + + +; (define install-khadas-edge-rk3399-u-boot +; #~(lambda (bootloader root-index image) +; (let ((idb (string-append bootloader "/libexec/idbloader.img")) +; (u-boot (string-append bootloader "/libexec/u-boot.itb"))) +; ;; (write-file-on-device file size device offset) +; ;; TODO: we might need to update offset +; (write-file-on-device idb (stat:size (stat idb)) +; image (* 64 512)) +; (write-file-on-device u-boot (stat:size (stat u-boot)) +; image (* 16384 512))))) + +; (define u-boot-khadas-edge-rk3399-bootloader +; (bootloader +; (inherit u-boot-bootloader) +; (package u-boot-khadas-edge-rk3399) +; (disk-image-installer install-khadas-edge-rk3399-u-boot))) + + +(define-public u-boot-rpi-arm64 + (make-u-boot-package "rpi_arm64" "aarch64-linux-gnu"))
\ No newline at end of file diff --git a/px/packages/browser.scm b/px/packages/browser.scm new file mode 100644 index 0000000..cae9581 --- /dev/null +++ b/px/packages/browser.scm @@ -0,0 +1,49 @@ +(define-module (px packages browser) + #:use-module (guix build-system qt) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (gnu packages kde-frameworks) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages qt) + #:use-module (gnu packages tls) + #:use-module (gnu packages xorg)) + +(define-public falkon + (package + (name "falkon") + (version "22.08.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://anongit.kde.org/falkon") + (commit (string-append "v" version)))) + (file-name (string-append name "-" version "-checkout")) + (sha256 + (base32 "12zrv4csbwl9x68v99bmwdz31qp0z7f8nwvr9cgc0iy27l0ay16l")))) + (build-system qt-build-system) + (arguments + `(#:tests? #f + #:configure-flags '("-DBUILD_TESTS=FALSE"))) + (native-inputs + (list extra-cmake-modules pkg-config qttools-5)) + (inputs + (list karchive + libxcb + openssl + qtbase-5 + qtdeclarative-5 + qtquickcontrols-5 + qtwebchannel-5 + qtx11extras + xcb-util)) + (propagated-inputs + (list qtwebengine-5)) + (home-page "https://falkon.org") + (synopsis "Falkon is a KDE web browser. It uses QtWebEngine rendering engine") + (description "Falkon is a KDE web browser using QtWebEngine rendering engine, +previously known as QupZilla. It aims to be a lightweight web browser +available through all major platforms.") + (license license:gpl3))) diff --git a/px/packages/ci.scm b/px/packages/ci.scm new file mode 100644 index 0000000..d2e39b7 --- /dev/null +++ b/px/packages/ci.scm @@ -0,0 +1,47 @@ +;;; continuous integration related packages for PantherX +;;; Author: Reza Alizadeh Majd (r.majd@pantherx.org) + +(define-module (px packages ci) + #:use-module (gnu packages bash) + ; #:use-module (guix build-system go) + #:use-module (guix build-system trivial) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module ((guix licenses) #:prefix license:)) + +(define-public gitlab-runner + (package + (name "gitlab-runner") + (version "v12.8.0") + (source + (origin + (method url-fetch) + ; (uri (string-append "https://gitlab.com/gitlab-org/gitlab-runner/-/archive/v" + ; version "/gitlab-runner-v" version ".tar.gz")) + ; (sha256 (base32 "1gb3mflz57niyyn4kj5l4m1g2sa2w4cn8gig5dfr04ns9w9kj8jr")))) + (uri (string-append "https://s3.amazonaws.com/gitlab-runner-downloads/" + version "/binaries/gitlab-runner-linux-386")) + (sha256 (base32 "1lbri42l0bjz21gnq7prhi1g06mqz43qdgdzh5llq8vl49gfz0ap")))) + ; (build-system go-build-system) + (build-system trivial-build-system) + (supported-systems '("x86_64-linux" "i686-linux")) ; As long as we download binaries + ; (arguments '(#:import-path "gitlab.com/gitlab-org/gitlab-runner")) + (arguments `( + #:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils)) + (let* ((src (assoc-ref %build-inputs "source")) + (bash (string-append (assoc-ref %build-inputs "bash") "/bin/sh")) + (out (assoc-ref %outputs "out")) + (target (string-append out "/bin/gitlab-runner"))) + (setenv "PATH" bash) + (mkdir-p (string-append out "/bin")) + (copy-file src target) + (chmod target #o755) + #t)))) (home-page "https://docs.gitlab.com/runner/") + (native-inputs `(("bash" ,bash))) + (synopsis "GitLab Runner") + (description "GitLab Runner is the open source project that is used +to run your jobs and send the results back to GitLab.") + (license license:expat))) diff --git a/px/packages/clawsmail.scm b/px/packages/clawsmail.scm new file mode 100644 index 0000000..e426b18 --- /dev/null +++ b/px/packages/clawsmail.scm @@ -0,0 +1,74 @@ +;;; Theme Packages Module for PantherX +;;; Author: Hamzeh Nasajpour (h.nasajpour@pantherx.org) +;;; + +(define-module (px packages clawsmail) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix git-download) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (guix build-system glib-or-gtk) + #:use-module (guix build-system trivial) + #:use-module (gnu packages) + #:use-module (gnu packages backup) + #:use-module (gnu packages base) + #:use-module (gnu packages bison) + #:use-module (gnu packages calendar) + #:use-module (gnu packages compression) + #:use-module (gnu packages curl) + #:use-module (gnu packages enchant) + #:use-module (gnu packages flex) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages gettext) + #:use-module (gnu packages glib) + #:use-module (gnu packages ghostscript) + #:use-module (gnu packages gnome) + #:use-module (gnu packages gnupg) + #:use-module (gnu packages gtk) + #:use-module (gnu packages libcanberra) + #:use-module (gnu packages mail) + #:use-module (gnu packages nettle) + #:use-module (gnu packages openldap) + #:use-module (gnu packages perl) + #:use-module (gnu packages pdf) + #:use-module (gnu packages python) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages tls) + #:use-module (gnu packages xdisorg) + #:use-module (gnu packages xml) + #:use-module (gnu packages xorg) + #:use-module (gnu packages web)) + +(define-public claws-mail-theme-breeze + (package + (name "claws-mail-theme-breeze") + (version "0.0.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://www.claws-mail.org/download.php?file=themes/png/claws-mail-theme_breeze.tar.gz")) + (sha256 + (base32 "104ak4m3s7i4d44clpn4kcq4bhjz92ybmpiw83dpg2xwc9w8k2pf")))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils) + (srfi srfi-26)) + (let* ((source (assoc-ref %build-inputs "source")) + (tar (assoc-ref %build-inputs "tar")) + (gzip (assoc-ref %build-inputs "gzip")) + (theme-dir (string-append %output "/share/claws-mail/themes"))) + (mkdir-p theme-dir) + (setenv "PATH" (string-append gzip "/bin")) + (invoke (string-append tar "/bin/tar") "xvf" source "-C" theme-dir) + )))) + (native-inputs `(("tar" ,tar) + ("gzip" ,gzip))) + (synopsis "claws-mail breeze theme") + (home-page "https://www.claws-mail.org/themes.php") + (description "claws-mail breeze theme") + (license license:gpl3+))) diff --git a/px/packages/common.scm b/px/packages/common.scm new file mode 100644 index 0000000..0da9c3f --- /dev/null +++ b/px/packages/common.scm @@ -0,0 +1,169 @@ +;;; Definition for Shared Packages between PantherX Applications +;;; Author: Reza Alizadeh Majd (r.majd@pantherx.org) +;;; + +(define-module (px packages common) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system gnu) + #:use-module (guix build-system cmake) + #:use-module (guix build-system python) + #:use-module (gnu packages cmake) + #:use-module (gnu packages haskell-xyz) + #:use-module (gnu packages libffi) + #:use-module (gnu packages python) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-check) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages serialization) + #:use-module (gnu packages sphinx) + #:use-module (guix utils) + #:use-module (gnu packages autotools) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages curl) + #:use-module (gnu packages check) + #:use-module (gnu packages networking) + #:use-module (px packages python-xyz) + #:use-module (px packages common)) + + +(define-public capnproto-0.9 + (package + (inherit capnproto) + (name "capnproto") + (version "0.9.2") + (source (origin + (method url-fetch) + (uri (string-append + "https://capnproto.org/capnproto-c++-" + version ".tar.gz")) + (sha256 + (base32 + "0hi5lpyhskdg99n9zgn0ffr79gn12m1j7igkp9wikklg2p4yjca0")))))) + +(define-public python-pycapnp + (package + (name "python-pycapnp") + (version "1.1.0") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/capnproto/pycapnp/archive/v" version ".tar.gz")) + (sha256 (base32 "0kj9jpg6vpmlqgzqnxz2dsbihwhimq9xzq6yrkqvgdzz3sdlk8fh")))) + (build-system python-build-system) + (arguments + `(#:python ,python-3 + #:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-source + (lambda _ + (substitute* '("setup.py") + (("if need_build") "if False")) + #t)) + (delete 'sanity-check)))) + (native-inputs `( + ("python-pkgconfig" ,python-pkgconfig) + ("python-setuptools" ,python-setuptools) + ("python-wrapper", python-wrapper) + ("python-cython", python-cython) + ("capnproto", capnproto) + ("python-sphinx" ,python-sphinx) + ("python-tox" ,python-tox) + ("python-wheel" ,python-wheel))) + (propagated-inputs `( + ("python-jinja2" ,python-jinja2))) + (home-page "http://jparyani.github.io/pycapnp") + (synopsis "Capability-based RPC and serialization system") + (description "This is a python3 wrapping of the C++ +implementation of the Cap’n Proto library.") + (license license:gpl2+))) + +(define-public python-pynng + (package + (name "python-pynng") + (version "0.4.0") + (source (origin + (method url-fetch) + (uri (pypi-uri "pynng" version)) + (sha256 (base32 "0621j0dmrhg8ydrpr3k5ia50hp73r9khrcbwvp43jb51igl6wwvc")))) + (build-system python-build-system) + (arguments `( + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-source + (lambda _ + (substitute* '("setup.py" "build_nng.sh") + ;; Replace default shell path. + (("/bin/bash") (which "sh"))) + #t))) + #:tests? #f)) + (native-inputs `( + ("python-pytest-runner" ,python-pytest-runner) + ("cmake" ,cmake) + )) + (propagated-inputs `( + ("python-cffi" ,python-cffi) + ("python-sniffio" ,python-sniffio))) + (home-page "https://github.com/codypiersall/pynng") + (synopsis "Python bindings for Nanomsg Next Generation") + (description "Ergonomic bindings for nanomsg next generation (nng), in Python. +pynng provides a nice interface on top of the full power of nng") + (license license:expat))) + +(define-public cpr + (package + (name "cpr") + (version "1.5.1") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/whoshuu/cpr/archive/v" + version + ".tar.gz")) + (sha256 + (base32 + "18w0v6jhjz05c844wgsb07cxp4bbmcw0jiz9ka4hjsn6g5s3rmx6")))) + (arguments + `(#:tests? #f + #:configure-flags '("-DUSE_SYSTEM_CURL=ON" "-DBUILD_CPR_TESTS=OFF"))) + (build-system cmake-build-system) + (native-inputs `( + ("curl" ,curl) + ("pkg-config" ,pkg-config))) + (inputs `( + ("curl" ,curl))) + (home-page "https://whoshuu.github.io/cpr/") + (synopsis "C++ Requests: Curl for People ") + (description "C++ Requests is a simple wrapper around libcurl + inspired by the excellent Python Requests project.") + (license license:expat))) + +(define-public restclient-cpp + (package + (name "restclient-cpp") + (version "0.5.2") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/mrtazz/restclient-cpp/archive/" + version + ".tar.gz")) + (sha256 + (base32 + "1v35pkgqdcmyr1c91r9r312rjak6x24k4j1vslpnaf59z4cacayn")))) + (arguments + `(#:tests? #f)) + (build-system cmake-build-system) + (native-inputs `( + ("libtool" ,libtool) + ("pkg-config" ,pkg-config))) + (inputs `( + ("curl" ,curl))) + (home-page "https://github.com/mrtazz/restclient-cpp") + (synopsis "C++ client") + (description "C++ client for making HTTP/REST requests ") + (license license:expat))) + diff --git a/px/packages/contacts-calendar.scm b/px/packages/contacts-calendar.scm new file mode 100644 index 0000000..b0e8c19 --- /dev/null +++ b/px/packages/contacts-calendar.scm @@ -0,0 +1,100 @@ +(define-module (px packages contacts-calendar) + #:use-module (guix licenses) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (gnu packages) + #:use-module (guix build-system cmake) + #:use-module (guix build-system python) + #:use-module (gnu packages base) + #:use-module (gnu packages check) + #:use-module (gnu packages compression) + #:use-module (gnu packages databases) + #:use-module (gnu packages dav) + #:use-module (gnu packages libffi) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-crypto) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages python-web) + #:use-module (gnu packages qt) + #:use-module (gnu packages serialization) + #:use-module (gnu packages time) + #:use-module (gnu packages xml) + #:use-module (px packages etesync) + #:use-module (px packages common) + #:use-module (px packages library) + #:use-module (px packages python-xyz)) + +(define-public px-etesync-dav + (package + (inherit etesync-dav) + (name "px-etesync-dav") + (version "0.20.3.2") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/px-contacts-calendar-service_v" version ".tgz")) + (sha256 + (base32 "1hllxmh6w6bj4d0sbzdxmvs3n8m0q1w2d812m1vr5v4pr8xj2w5q")))))) + +(define-public px-contacts-calendar + (package + (name "px-contacts-calendar") + (version "0.4.9") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/px-contacts-calendar_v" version ".tgz")) + (sha256 + (base32 "1mrp683izfnqp9pvgl44kwm9vd29fv8d515vd5r2ihn5sa39sfdz")))) + (build-system python-build-system) + (arguments + '(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'sanity-check)))) + (inputs + `(("python-cryptography" ,python-cryptography) + ("python-etebase" ,python-etebase) + ("python-lxml" ,python-lxml) + ("python-requests" ,python-requests-2.23) + ("python-pysocks" ,python-pysocks) + ("python-urllib3" ,python-urllib3) + ("python-vobject" ,python-vobject) + ("python-peewee" ,python-peewee) + ("python-pycapnp" ,python-pycapnp) + ("python-pyyaml" ,python-pyyaml-v5.3.1) + ("python-appdirs" ,python-appdirs))) + (home-page "https://git.pantherx.org/development/applications/px-contacts-calendar") + (synopsis "Sync and access PIM related data like contacts and calendar.") + (description "Sync and access PIM related data like contacts and calendar.") + (license license:expat))) + +(define-public px-contacts + (package + (name "px-contacts") + (version "0.0.1") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 + (base32 + "0vsnyi4m8r92qfrslv8060813fzr6svcghn37i3ib37wf3nv0rzr")))) + (build-system cmake-build-system) + (arguments + `( + #:tests? #f)) + (inputs `( + ("capnproto" ,capnproto-0.9) + ("px-gui-library" ,px-gui-library) + ("qtbase" ,qtbase-5))) + (native-inputs `( + ("pkg-config" ,pkg-config))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Contacts Management Application") + (description "This package provides a gui application to manage you contacts.") + (license license:expat))) diff --git a/px/packages/crates-io.scm b/px/packages/crates-io.scm new file mode 100644 index 0000000..cae8612 --- /dev/null +++ b/px/packages/crates-io.scm @@ -0,0 +1,115 @@ +(define-module (px packages crates-io) + #:use-module (guix build-system cargo) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (gnu packages crates-io) + #:use-module ((guix licenses) #:prefix license:)) + + +(define-public rust-iso8601-0.4 + (package + (name "rust-iso8601") + (version "0.4.2") + (source (origin + (method url-fetch) + (uri (crate-uri "iso8601" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "15nfg6d4qlniw4gk7039s5y07lzgr1dp9snsw63lsxarnyz4zfg5")))) + (build-system cargo-build-system) + (arguments + `(#:skip-build? #t + #:cargo-inputs (("rust-nom" ,rust-nom-7)))) + (home-page "https://github.com/badboy/iso8601") + (synopsis "Parsing ISO8601 dates using nom") + (description "Parsing ISO8601 dates using nom") + (license license:expat))) + + +(define-public rust-lock-api-0.4.6 + (package + (inherit rust-lock-api-0.4) + (name "rust-lock-api") + (version "0.4.6") + (source + (origin + (method url-fetch) + (uri (crate-uri "lock_api" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0frbbqqiwngg33xrc69xagi4rqqk62msllr7z95mlbjaxzbkv548")))))) + + +(define-public rust-parking-lot-0.12-patched + (package + (name "rust-parking-lot") + (version "0.12.1") + (source + (origin + (method url-fetch) + (uri (crate-uri "parking_lot" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 "13r2xk7mnxfc5g0g6dkdxqdqad99j7s7z8zhzz4npw5r0g0v4hip")))) + (build-system cargo-build-system) + (arguments + (list #:skip-build? #t + #:cargo-inputs + `(("rust-instant" ,rust-instant-0.1) + ("rust-lock-api" ,rust-lock-api-0.4.6) + ("rust-parking-lot-core" ,rust-parking-lot-core-0.8)))) + (home-page "https://github.com/Amanieu/parking_lot") + (synopsis + "Efficient implementations of the standard synchronization primitives") + (description + "This package provides more compact and efficient implementations +of the standard synchronization primitives.") + (license (list license:asl2.0 license:expat)))) + +(define-public rust-tokio-1-patched + (package + (inherit rust-tokio-1) + (arguments + (list #:skip-build? #t + #:cargo-inputs + `(("rust-autocfg" ,rust-autocfg-1) + ("rust-bytes" ,rust-bytes-1) + ("rust-libc" ,rust-libc-0.2) + ("rust-memchr" ,rust-memchr-2) + ("rust-mio" ,rust-mio-0.8) + ("rust-num-cpus" ,rust-num-cpus-1) + ("rust-parking-lot" ,rust-parking-lot-0.12-patched) + ("rust-pin-project-lite" ,rust-pin-project-lite-0.2) + ("rust-signal-hook-registry" ,rust-signal-hook-registry-1) + ("rust-socket2" ,rust-socket2-0.4) + ("rust-tokio-macros" ,rust-tokio-macros-1) + ("rust-tracing" ,rust-tracing-0.1) + ("rust-winapi" ,rust-winapi-0.3)))))) + + +(define-public rust-xmlrpc-0.15 + (package + (name "rust-xmlrpc") + (version "0.15.1") + (source (origin + (method url-fetch) + (uri (crate-uri "xmlrpc" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1xviwks6c4w408kbi419wa8fn3lfbizz226qffxg04m4hqpcsdlb")))) + (build-system cargo-build-system) + (arguments + `(#:skip-build? #t + #:cargo-inputs (("rust-base64" ,rust-base64-0.13) + ("rust-iso8601" ,rust-iso8601-0.4) + ("rust-mime" ,rust-mime-0.3) + ("rust-reqwest" ,rust-reqwest-0.11) + ("rust-xml-rs" ,rust-xml-rs-0.8)) + #:cargo-development-inputs (("rust-version-sync" ,rust-version-sync-0.9)))) + (home-page "https://github.com/jonas-schievink/xml-rpc-rs.git") + (synopsis "An XML-RPC implementation for Rust") + (description "An XML-RPC implementation for Rust") + (license license:cc0))) diff --git a/px/packages/data-service.scm b/px/packages/data-service.scm new file mode 100644 index 0000000..3a6a7e4 --- /dev/null +++ b/px/packages/data-service.scm @@ -0,0 +1,57 @@ +;;; Data-service Packages Module for PantherX +;;; Author: H.ghaffari (h.ghaffari@pantherx.org) +;;; + +(define-module (px packages data-service) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (guix build-system python) + #:use-module (guix utils) + #:use-module (gnu packages compression) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages serialization) + #:use-module (px packages common) + #:use-module (px packages python-xyz) + #:use-module (guix gexp) +) + + +(define-public px-data-service + (package + (name "px-data-service") + (version "v0.0.10") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/px-data-service_" + version ".tgz")) + (sha256 + (base32 "0rq1fi7ymizmcfzlycn31z2sz96zx3fw91h7gjkg707qys92dfcm")))) + (build-system python-build-system) + (propagated-inputs `( + ("python-pycapnp" ,python-pycapnp) + ("python-pynng" ,python-pynng) + ("python-pygithub" ,python-pygithub) + ("python-block-io" ,python-block-io))) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'wrap-binary + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin/px-data-service"))) + (wrap-program bin + `("PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH")))) + #t))) + (delete 'sanity-check) + ))) + (home-page "https://www.pantherx.org") + (synopsis "") + (description "This service fetch data periodically and send event to px-hub-service to sync data ") + (license license:expat))) diff --git a/px/packages/databases.scm b/px/packages/databases.scm new file mode 100644 index 0000000..5cc7d23 --- /dev/null +++ b/px/packages/databases.scm @@ -0,0 +1,160 @@ +;;; Databases Packages Module for PantherX +;;; Authors: Hamzeh Nasajpour (h.nasajpour@pantherx.org) +;;; Reza Alizadeh Majd (r.majd@pantherx.org) +;;; + +(define-module (px packages databases) + #:use-module (gnu packages) + #:use-module (gnu packages admin) + #:use-module (gnu packages base) + #:use-module (gnu packages check) + #:use-module (gnu packages commencement) + #:use-module (gnu packages compression) + #:use-module (gnu packages curl) + #:use-module (gnu packages databases) + #:use-module (gnu packages gcc) + #:use-module (gnu packages golang) + #:use-module (gnu packages pcre) + #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages serialization) + #:use-module (gnu packages sqlite) + #:use-module (gnu packages terminals) + #:use-module (gnu packages valgrind) + #:use-module (gnu packages tls) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (guix build-system gnu) + #:use-module (guix build-system go) + #:use-module (guix build-system python) + #:use-module (guix build-system scons) + #:use-module (guix utils) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (nonguix build-system binary) + #:use-module (px packages common) + #:use-module (px packages python-xyz) + #:use-module (px packages tls) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:use-module (ice-9 match)) + +(define-public mongodb + (package + (name "mongodb") + (version "5.0.9") + (source (origin + (method url-fetch) + (uri (string-append "https://fastdl.mongodb.org/linux/" name + "-linux-x86_64-debian10-" version ".tgz")) + (sha256 (base32 "0ycav2jckl5v8mjaiddzll2i25z4lp8fpsg9ymcxpzyj3kxxip6q")))) + (build-system binary-build-system) + (arguments + `(#:patchelf-plan + `(("bin/mongo" ("curl" "gcc" "gcc-toolchain" "openssl" "xz")) + ("bin/mongod" ("curl" "gcc" "gcc-toolchain" "openssl" "xz")) + ("bin/mongos" ("curl" "gcc" "gcc-toolchain" "openssl" "xz"))))) + (inputs + (list + curl + (list gcc "lib") + gcc-toolchain + openssl + xz)) + (home-page "https://www.mongodb.org") + (synopsis "High performance and high availability document database") + (description "Mongo is a high-performance, high availability, schema-free +document-oriented database. A key goal of MongoDB is to bridge the gap +between key/value stores (which are fast and highly scalable) and traditional +RDBMS systems (which are deep in functionality).") + (license license:expat))) + + +(define-public sqlitecpp + (package + (name "sqlitecpp") + (version "3.2.1") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/SRombauts/SQLiteCpp/archive/" version ".tar.gz")) + (sha256 + (base32 + "14yn8bdnmh5bv2k85acm0yqjzgr90dmqxgvs5bw60x64h1b7vikh")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f)) + (native-inputs `( + ("pkg-config" ,pkg-config) + ("sqlite", sqlite))) + (home-page "https://github.com/SRombauts/SQLiteCpp") + (synopsis "SQLiteC++ (SQLiteCpp) is a smart and easy to use C++ SQLite3 wrapper.") + (description "SQLiteC++ offers an encapsulation around the native C APIs of SQLite, with a few intuitive and well documented C++ classes.") + (license license:expat))) + + +(define-public px-database-utility + (package + (name "px-database-utility") + (version "0.1.4") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "0qqgr8nvgxf3dp1wcaciiv4n4xr5akf3f7k2aiiihfa89h2v7kq1")))) + (build-system python-build-system) + (arguments + `(#:tests? #f)) + (inputs + `(("python-psycopg2" ,python-psycopg2))) + (native-inputs + `(("pkg-config" ,pkg-config))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Database Utility") + (description "Easily dump (backup), restore and list PostgreSQL databases.") + (license license:expat))) + + +(define-public wiredtiger-2.9.2 + (package + (name "wiredtiger") + (version "2.9.2") + (source (origin + (method url-fetch) + (uri (string-append + "http://source.wiredtiger.com/releases/wiredtiger-" + version ".tar.bz2")) + (sha256 + (base32 + "1n8qlhk9fcnan6w38i0lqdwm02bxm91nlzq1976qqmmv989nmmi2")))) + (build-system gnu-build-system) + (arguments + '(#:configure-flags '("--enable-lz4" "--with-builtins=snappy,zlib" "--enable-verbose") + #:phases + (modify-phases %standard-phases + (add-before 'check 'disable-test/fops + (lambda _ + ;; XXX: timed out after 3600 seconds of silence + (substitute* "Makefile" + (("test/fops") "")) + #t))))) + (inputs + `(("lz4" ,lz4) + ("zlib" ,zlib) + ("snappy" ,snappy))) + (home-page "http://source.wiredtiger.com/") + (synopsis "NoSQL data engine") + (description + "WiredTiger is an extensible platform for data management. It supports +row-oriented storage (where all columns of a row are stored together), +column-oriented storage (where columns are stored in groups, allowing for +more efficient access and storage of column subsets) and log-structured merge +trees (LSM), for sustained throughput under random insert workloads.") + (license license:gpl3) ; or GPL-2 + ;; configure.ac: WiredTiger requires a 64-bit build. + (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux")))) diff --git a/px/packages/dav.scm b/px/packages/dav.scm new file mode 100644 index 0000000..18cec24 --- /dev/null +++ b/px/packages/dav.scm @@ -0,0 +1,83 @@ +(define-module (px packages dav) + #:use-module ((guix licenses) #:select (gpl3)) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix build-system cmake) + #:use-module (gnu packages) + #:use-module (gnu packages aspell) + #:use-module (gnu packages autotools) + #:use-module (gnu packages base) + #:use-module (gnu packages bison) + #:use-module (gnu packages compression) + #:use-module (gnu packages ebook) + #:use-module (gnu packages file) + #:use-module (gnu packages linux) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages qt) + #:use-module (gnu packages search) + #:use-module (gnu packages file) + #:use-module (gnu packages xml)) + + +(define-public px-cal-card-dav-lib + (package + (name "px-cal-card-dav-lib") + (version "0.0.5") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 + (base32 + "1273cy1yxx9i4723s88xrq1vf9448dk42i52rfc6245hnb83lcv2")))) + (build-system cmake-build-system) + (arguments + `( + #:tests? #f)) + (native-inputs `( + ("pkg-config" ,pkg-config) + ("qtbase" ,qtbase-5))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX C++ CardDAV/CalDAV Client library built with QT to connect to CardDAV/CalDAV Servers") + (description "PantherX C++ CardDAV/CalDAV Client library built with QT to connect to CardDAV/CalDAV Servers") + (license license:expat))) + +(define-public libccdav + (package + (name "libccdav") + (version "0.0.3") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/FSajadi/libccdav") + (commit "6ab7e1479b7b6696ca6be6491b527f41e799c0bc"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "01s3rfmafvwadlqv6qx0dzlax0vga3g8w6wxkcasyxjdc1qygcx5")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'update-installation-path + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (substitute* "CMakeLists.txt" (("/usr") out)) + #t))) + ))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("qtbase" ,qtbase-5))) + (inputs + `(("qtbase" ,qtbase-5))) + (home-page "https://github.com/FSajadi/libccdav") + (synopsis "A C++ CardDAV/CalDAV Client library built with QT to connect to CardDAV/CalDAV Servers") + (description + "A C++ CardDAV/CalDAV Client library built with QT to connect to CardDAV/CalDAV Servers") + (license gpl3))) + diff --git a/px/packages/desktop-tools.scm b/px/packages/desktop-tools.scm new file mode 100644 index 0000000..e534c0f --- /dev/null +++ b/px/packages/desktop-tools.scm @@ -0,0 +1,426 @@ +;;; PantherX Desktop Packages and Tools +;;; Author: Reza Alizadeh Majd (r.majd@pantherx.org) +;;; +;;; Note: This module is exported from (px packages desktop) to prevent +;;; circular import problem. +;;; + +(define-module (px packages desktop-tools) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix build-system cmake) + #:use-module (guix build-system qt) + #:use-module (guix build-system copy) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix gexp) + #:use-module (guix utils) + #:use-module (gnu packages boost) + #:use-module (gnu packages bash) + #:use-module (gnu packages check) + #:use-module (gnu packages cups) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages gcc) + #:use-module (gnu packages gnome) + #:use-module (gnu packages gnuzilla) + #:use-module (gnu packages lxqt) + #:use-module (gnu packages mate) + #:use-module (gnu packages maths) + #:use-module (gnu packages pdf) + #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages qt) + #:use-module (gnu packages search) + #:use-module (gnu packages video) + #:use-module (gnu packages xfce) + #:use-module (gnu packages xorg) + #:use-module (gnu packages kde-frameworks) + #:use-module (px packages images) + #:use-module (srfi srfi-1)) + + +(define-public px-recoll + (package + (inherit recoll) + (name "px-recoll") + (arguments + '(#:tests? #f + #:configure-flags '("--disable-webkit" ; no qtwebkit yet + "--with-inotify" + "--enable-recollq" + "QMAKEPATH=") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-icon + (lambda _ + ;;Update icon + (substitute* '("desktop/recoll-searchgui.desktop") + (("Icon=recoll") + "Icon=preferences-desktop-search")) + (substitute* '("qtgui/main.cpp") + (("app.setWindowIcon\\(icon\\)") + "app.setWindowIcon(QIcon::fromTheme(\"preferences-desktop-search\"))")) + (substitute* '("qtgui/rclmain_w.cpp") + (("QIcon\\(QString\\(\":/images/recoll.png\"\\)\\)") + "QIcon::fromTheme(\"preferences-desktop-search\")")) + ;;Enable show tray icon + (substitute* '("qtgui/guiutils.cpp") + (("showTrayIcon\", Bool, false") "showTrayIcon\", Bool, true")) + ;;Enable show close to tray + (substitute* '("qtgui/guiutils.cpp") + (("closeToTray\", Bool, false") "closeToTray\", Bool, true")) + ;;Enable desktop notification + (substitute* '("qtgui/guiutils.cpp"); + (("trayMessages\", Bool, false") "trayMessages\", Bool, true")) + ;;Rename Recoll to Advanced Search + (substitute* '("desktop/recoll-searchgui.desktop"); + (("Name=Recoll") "Name=Advanced Search")) + ;;Update category to Settings + (substitute* '("desktop/recoll-searchgui.desktop"); + (("Categories=Qt;Utility;Filesystem;Database;") "Categories=Settings;")) + #t))))))) + +(define-public albert-launcher + (package + (name "albert-launcher") + (version "v0.16.1-0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/albertlauncher/albert") + (commit "579d063b8e90fd854fd4738480c2d8dc833f908e") + (recursive? #t))) + (sha256 + (base32 "1cqh4nsvxwarxm7v0fyzabph3c2ff3ap0q2xi2h4c0s2snrk4qh4")) + (file-name (git-file-name name version)))) + (build-system cmake-build-system) + (arguments + '(#:tests? #f + #:configure-flags '("-DBUILD_VIRTUALBOX=OFF" "-DCMAKE_INSTALL_LIBDIR=libs") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-cmakelists + (lambda _ + ;; path-main-cpp-add-plugin-dirs + (substitute* '("src/app/main.cpp") + (("QStringList dirs = \\{") (string-append "QStringList dirs = {\"" %output "/libs\", " ))) + ;; Adding X11Extras to target_link_libraries of widgetboxmodel plugin + (substitute* '("plugins/widgetboxmodel/CMakeLists.txt") + (("COMPONENTS Widgets") "COMPONENTS Widgets X11Extras")) + (substitute* '("plugins/widgetboxmodel/CMakeLists.txt") + (("Qt5::Widgets") "Qt5::Widgets Qt5::X11Extras X11")) + ;; Adding X11Extras to target_link_libraries of qmlboxmodel plugin + (substitute* '("plugins/qmlboxmodel/CMakeLists.txt") + (("COMPONENTS Widgets") "COMPONENTS Widgets X11Extras")) + (substitute* '("plugins/qmlboxmodel/CMakeLists.txt") + (("Qt5::Widgets") "Qt5::Widgets Qt5::X11Extras X11")) + #t))))) + (native-inputs `( + ("libx11" ,libx11) + ("muparser" ,muparser) + ("pkg-config" ,pkg-config) + ("python3" ,python) + ("qtbase" ,qtbase-5) + ("qtcharts" ,qtcharts) + ("qtdeclarative" ,qtdeclarative-5) + ("qtsvg" ,qtsvg-5) + ("qtx11extras" ,qtx11extras))) + (home-page "https://albertlauncher.github.io/") + (synopsis "Albert is a unified and efficient access to your machine.") + (description "Albert is a desktop agnostic launcher. Its goals are usability and beauty, performance and extensibility. It is written in C++ and based on the Qt framework.") + (license license:gpl3+))) + + +(define-public px-file-archiver + (package + (inherit lxqt-archiver) + (name "px-file-archiver") + (version "0.5.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url (string-append "https://github.com/lxqt/lxqt-archiver.git")) + (commit version))) + (file-name (git-file-name "lxqt-archiver" version)) + (sha256 + (base32 "0qz3j0qby78ngck60rv7kgwygya8cr1v4kn575wrsg3w287v33qb")))) + (arguments + '(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-app-name + (lambda _ + (substitute* (find-files "src/translations" "\\.desktop.yaml") + (("LXQt File Archiver") "File Archiver")) + #t))))))) + + +(define-public px-image-viewer + (package + (inherit qimgv) + (name "px-image-viewer") + (arguments + '(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-menu-item + (lambda _ + (substitute* '("qimgv/distrib/qimgv.desktop") + (("Name=qimgv") "Name=Pictures")) + #t))))))) + +(define-public px-terminal + (package + (inherit qterminal) + (name "px-terminal") + (arguments + '(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-menu-item + (lambda _ + (substitute* (find-files "src/translations" "\\.desktop.yaml") + (("QTerminal") "Terminal")) + (substitute* (find-files "src/translations" "\\.desktop.yaml") + (("Qterminal") "Terminal")) + (substitute* '("CMakeLists.txt") + (("qterminal-drop.desktop.in") "")) + #t))))))) + +(define-public qlipper + (package + (name "qlipper") + (version "5.1.2") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/pvanek/qlipper/archive/" version ".tar.gz")) + (sha256 + (base32 + "0vbhiyn56qwlssavim02kp0y5rxj6gdffchyigkhpg8qza64afch")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f)) + (native-inputs + (list qtbase-5 qttools-5)) + (home-page "https://github.com/pvanek/qlipper") + (synopsis "Lightweight and cross-platform clipboard history applet.") + (description "Lightweight and cross-platform clipboard history applet.") + (license license:gpl2+))) + + +(define-public px-network-manager-applet + (package + (inherit network-manager-applet) + (name "px-network-manager-applet") + (arguments + (substitute-keyword-arguments (package-arguments network-manager-applet) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'patch-menu-item + (lambda _ + (substitute* '("nm-connection-editor.desktop.in") + (("Name=Advanced Network Configuration") "Name=Network")) + #t)))))))) + +(define-public cpputilities + (package + (name "cpputilities") + (version "5.22.0") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/Martchus/cpp-utilities/archive/refs/tags/v" version ".tar.gz")) + (sha256 + (base32 + "18mbzw8w0a4l5r0w1fr200m4v8ww65r838618z19v1ymz6aahs7a")))) + (build-system cmake-build-system) + (inputs + `(("gcc" ,gcc-11))) + (arguments + `(#:tests? #f + #:configure-flags '("-DCMAKE_VERBOSE_MAKEFILE=ON" "-DBUILD_VIRTUALBOX=OFF" "-DCMAKE_INSTALL_LIBDIR=libs") + )) + (home-page "https://github.com/Martchus/cpp-utilities/") + (synopsis "Useful C++ classes and routines") + (description "Useful C++ classes and routines such as +argument parser, IO and conversion utilities.") + (license license:gpl2+))) + +(define-public qtutilities + (package + (name "qtutilities") + (version "6.12.0") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/Martchus/qtutilities/archive/refs/tags/v" version ".tar.gz")) + (sha256 + (base32 + "0b58i66hhfg18d9bzbkzx8m34x070af5k3dankz5q69dr1lbrf6k")))) + (build-system cmake-build-system) + (native-inputs + (list cpputilities qtbase-5 qttools-5)) + (arguments + `(#:tests? #f + )) + (home-page "https://github.com/Martchus/qtutilities") + (synopsis "Common Qt related C++ classes and routines") + (description "Common Qt related C++ classes and routines") + (license license:gpl2+))) + +(define-public fork-awesome + (package + (name "fork-awesome") + (version "1.2.0") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/ForkAwesome/Fork-Awesome/archive/refs/tags/" version ".tar.gz")) + (sha256 + (base32 + "1cxxbyklk139cj7hw9jiq51cmmqgn74z8ysl9i0y017jj7qsbyr3")))) + (build-system copy-build-system) + (arguments + '(#:install-plan + '(("fonts" "share/") + ("src" "share/")))) + (home-page "https://github.com/ForkAwesome/Fork-Awesome") + (synopsis "A fork of the iconic font and CSS toolkit ") + (description "Fork Awesome is a suite of 796 pictographic and +brand icons for easy, scalable vector graphics on websites and beyond.") + (license license:expat))) + +(define-public qtforkawesome + (package + (name "qtforkawesome") + (version "0.1.0") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/Martchus/qtforkawesome/archive/refs/tags/v" version ".tar.gz")) + (sha256 + (base32 + "0pj4w93vrsmgqlgihwz6s2jdazmfsdw3lxns7wk9908l4ilcqw9d")))) + (build-system cmake-build-system) + (native-inputs + (list gcc-11 qtutilities cpputilities qtbase-5 qtquickcontrols-5 qtquickcontrols2-5 qtdeclarative-5 perl perl-yaml fork-awesome)) + (arguments + `(#:tests? #f + #:configure-flags + ,#~(list (string-append "-DFORK_AWESOME_FONT_FILE=" + #$(this-package-native-input "fork-awesome") "/share/fonts/forkawesome-webfont.woff2") + (string-append "-DFORK_AWESOME_ICON_DEFINITIONS=" + #$(this-package-native-input "fork-awesome") "/share/src/icons/icons.yml")))) + (home-page "https://github.com/Martchus/qtforkawesome/") + (synopsis "Useful C++ classes and routines such as argument parser, IO and conversion utilities.") + (description "Useful C++ classes and routines such as argument parser, IO and conversion utilities.") + (license license:gpl2+))) + +(define-public qxkb + (package + (name "qxkb") + (version "0.5.2") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/thegala/qxkb/archive/refs/tags/" name "-" version ".tar.gz")) + (sha256 + (base32 + "1nprswfdnqmy6xs6pdkzy6c3xkzh79zifdvy4vpw4l41gnqrl94s")))) + (build-system qt-build-system) + (inputs + (list libxkbfile + qtbase-5 + qtsvg-5 + qtx11extras)) + (native-inputs + (list qttools-5)) + (arguments (list #:tests? #f)) ; no upstream tests + (home-page "https://github.com/thegala/qxkb") + (synopsis "Keyboard layout switcher") + (description "Keyboard layout switcher") + (license license:gpl2+))) + +(define-public syncthingtray + (package + (name "syncthingtray") + (version "1.4.1") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/Martchus/syncthingtray/archive/refs/tags/v" version ".tar.gz")) + (sha256 + (base32 + "0cyimd018bknvip6jxz83w0va05kgfcix53jryqdka665p4048ba")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (replace 'build + (lambda _ + (invoke "make" "-j" "1") + #t)) + (add-after 'install 'wrap + ;; The program fails to find the QtWebEngineProcess program, + ;; so we set QTWEBENGINEPROCESS_PATH to help it. + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((bin (string-append (assoc-ref outputs "out") "/bin")) + (qtwebengineprocess (string-append + (assoc-ref inputs "qtwebengine") + "/lib/qt5/libexec/QtWebEngineProcess"))) + (for-each (lambda (program) + (wrap-program program + `("QTWEBENGINEPROCESS_PATH" = + (,qtwebengineprocess)))) + (find-files bin ".*"))) + #t))))) + (native-inputs + (list extra-cmake-modules qttools-5 gcc-11)) + (inputs `( + ("qtbase" ,qtbase-5) + ("qtquickcontrols2" ,qtquickcontrols2-5) + ("qtutilities" ,qtutilities) + ("boost", boost) + ("gcc" ,gcc-11) + ("qtdeclarative" ,qtdeclarative-5) + ("qtsvg" ,qtsvg-5) + ("qtwebchannel-5" ,qtwebchannel-5) + ("qtwebengine" ,qtwebengine-5) + ("plasma-framework" ,plasma-framework) + ("kwindowsystem" ,kwindowsystem) + ("kio" ,kio) + ("cppunit" ,cppunit) + ("cpputilities" ,cpputilities) + ("qtforkawesome" ,qtforkawesome) + ("bash-minimal" ,bash-minimal))) + (home-page "https://github.com/Martchus/syncthingtray") + (synopsis "Qt-based tray application") + (description "Qt-based tray application") + (license license:gpl2+))) + +(define-public px-about + (package + (inherit lxqt-about) + (name "px-about") + (version "1.2.0") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name"_" version ".tgz")) + (sha256 + (base32 + "12cnydcw8rhbwh21j8ayj2x47nvr5zicnqfp6r13dapy1nss5rd4")))))) + diff --git a/px/packages/desktop.scm b/px/packages/desktop.scm new file mode 100644 index 0000000..4fe3e09 --- /dev/null +++ b/px/packages/desktop.scm @@ -0,0 +1,423 @@ +;;; Desktop related packages Module for PantherX +;;; +;;; Reza Alizadeh Majd <r.majd@pantherc.org> +;;; Franz Geffke <franz@pantherx.org> +;;; + +(define-module (px packages desktop) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (gnu system) + #:use-module (guix utils) + #:use-module (guix build-system trivial) + #:use-module (guix build-system cmake) + #:use-module (guix build-system qt) + #:use-module (gnu packages) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages admin) + #:use-module (gnu packages aspell) + #:use-module (gnu packages base) + #:use-module (gnu packages bittorrent) + #:use-module ((gnu packages compression) #:prefix compression:) + #:use-module (gnu packages compton) + #:use-module (gnu packages curl) + #:use-module (gnu packages fonts) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages gnome) + #:use-module (gnu packages networking) + #:use-module (gnu packages gnupg) + #:use-module (gnu packages image) + #:use-module (gnu packages jami) + #:use-module (gnu packages kde-frameworks) + #:use-module (gnu packages kde-plasma) + #:use-module (gnu packages kde-utils) + #:use-module (gnu packages libreoffice) + #:use-module (gnu packages lxde) + #:use-module (gnu packages lxqt) + #:use-module (gnu packages mail) + #:use-module (gnu packages maths) + #:use-module (gnu packages openbox) + #:use-module (gnu packages qt) + #:use-module (gnu packages security-token) + #:use-module (gnu packages suckless) + #:use-module (gnu packages video) + #:use-module (gnu packages wget) + #:use-module (gnu packages wm) + #:use-module (gnu packages xfce) + #:use-module (gnu packages xorg) + #:use-module (gnu packages pdf) + #:use-module (gnu packages xdisorg) ;; copyq + #:use-module (nongnu packages compression) + #:use-module (nongnu packages mozilla) + #:use-module (px packages accounts) + #:use-module (px packages atril-thumbnailer) + #:use-module (px packages backup) ;; px-backup + #:use-module (px packages common) ;; capnproto + #:use-module (px packages contacts-calendar) ;; px-contacts + #:use-module (px packages desktop-tools) ;; px-about + #:use-module (px packages document) + #:use-module (px packages hub) + #:use-module (px packages kde-frameworks) + #:use-module (px packages library) + #:use-module (px packages lxqt-dev) + #:use-module (px packages matrix-client) + #:use-module (px packages multimedia) + #:use-module (px packages package-management) + #:use-module (px packages pantherx-panel) + #:use-module (px packages px-themes) + #:use-module (px packages settings) + #:use-module (px packages setup) + #:use-module (px packages software) + #:use-module (px packages images) + #:use-module (px packages themes) + #:use-module (px packages backup) + #:use-module (px packages user-services) + #:use-module (px packages wiki) + #:use-module (px packages device) ;; px-remote-access + #:use-module (px packages time-tracking) + #:use-module (srfi srfi-1) + #:export (%common-desktop-applications + %gtk-desktop-applications + %qt-desktop-applications + + lxqt-modified + ;; TODO: This should probably go into px/services/desktop + px-desktop-defaults)) + +;; Currently only lxqt-modified +(define-public openbox-modified + (package + (inherit openbox) + (name "openbox-modified") + (arguments + (list #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'force-reconfigure + ;; This is made necessary by the openbox-python3 patch. + (lambda _ + (delete-file "configure"))) + (add-after 'unpack 'patch-config-file + (lambda _ + (substitute* "data/rc.xml" + (("Clearlooks") "Arc-Dark"))))))))) + +;; Currently only lxqt-modified +(define-public px-file-manager + (package + (inherit pcmanfm-qt) + (name "px-file-manager") + (source + (origin + (inherit (package-source pcmanfm-qt)) + (patches (search-patches "px-file-manager-0001-update-config.patch")))) + (arguments + (substitute-keyword-arguments (package-arguments pcmanfm-qt) + ((#:phases phases) + #~(modify-phases #$phases + (add-before 'configure 'patch-settings.conf.in + (lambda* (#:key inputs #:allow-other-keys) + (let ((wallpaper (search-input-file inputs + "share/lxqt/wallpapers/pantherx.jpg"))) + (substitute* "config/pcmanfm-qt/lxqt/settings.conf.in" + (("Wallpaper=.*") + (string-append "Wallpaper=" wallpaper "\n"))) + (substitute* (find-files "pcmanfm/translations" "\\.desktop.yaml") + (("PCManFM-Qt File Manager") "File Manager")) + (substitute* '("config/pcmanfm-qt/lxqt/settings.conf.in") + (("WallpaperMode=stretch") "WallpaperMode=zoom") + ;; Patch FONT + (("Font=\"Sans Serif,10,-1,5,50,0,0,0,0,0\"") "Font=\"IBM Plex Sans,10,-1,5,50,0,0,0,0,0,Regular\"") + ;; Patch DEFAULT APPLICATIONS + (("TerminalDirCommand=xterm") "TerminalDirCommand=qterminal") + (("TerminalExecCommand=xterm") "TerminalExecCommand=qterminal") + ;; Patch TUMBNAILS + (("MaxThumbnailFileSize=4096") "MaxThumbnailFileSize=30720")) + (substitute* '("config/CMakeLists.txt") + (("\\$\\{CMAKE_INSTALL_DATADIR\\}") "etc/xdg")) + ))))))) + (inputs + (list libfm-qt qtbase-5 qtx11extras px-lxqt-themes)) + (propagated-inputs + `(("atril-thumbnailer" ,atril-thumbnailer) + ("ffmpegthumbnailer" ,ffmpegthumbnailer) + ("freetype" ,freetype) + ("libgsf" ,libgsf) + ("tumbler" ,tumbler))))) + +(define-public px-terminal-launcher + (package + (name "px-terminal-launcher") + (version "v0.1.9") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 (base32 "14b3kn9invpawynn3nxgwvyr1l8k796v3jjcq8rzjmbfc48qpxi6")))) + (build-system qt-build-system) + (arguments + `(#:tests? #f ; no tests + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-source + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* "mainwindow.cpp" + (("matrix-call-auto-accept-load-params.py") + (string-append (assoc-ref outputs "out") "/bin/matrix-call-auto-accept-load-params.py"))) + (substitute* "scripts/matrix-call-auto-accept-load-params.py" + (("matrix-client-call-auto-accept") + (string-append (assoc-ref inputs "matrix-client-call-auto-accept") + "/bin/matrix-client-call-auto-accept")))))))) + (native-inputs + (list qttools-5 + pkg-config + extra-cmake-modules) + ) + (inputs + (list capnproto-0.9 + qtbase-5 + qtcharts + px-auth-library-cpp + matrix-client-call-auto-accept + networkmanager-qt)) + (propagated-inputs (list px-icons)) + (home-page "https://www.pantherx.dev") + (synopsis "PantherX Terminal Launcher") + (description "PantherX Terminal Launcher") + (license license:expat))) + +(define-public lxqt-modified + (package + (inherit lxqt) + (name "lxqt-modified") + (propagated-inputs + `( + ;; Apply Arc-Dark to openbox: + ("openbox-modified" ,openbox-modified) + ;; Apply modified menu and others to lxqt-panel: + ;; TODO: FIX and restore + ;; ("pantherx-panel" ,pantherx-panel) + ;; ("libqtxdg" ,libqtxdg) + ;; Apply default wallpaper and so on to pcmanfm-qt: + ("px-file-manager" ,px-file-manager) + ;; Rename QTerminal to Terminal: + ("px-terminal" ,px-terminal) + ("px-icons" ,px-icons) + ("px-lxqt-themes" ,px-lxqt-themes) + ;; "lxqt-panel" + ,@(fold alist-delete (package-propagated-inputs lxqt) + '("lximage-qt" "pcmanfm-qt" "qterminal" + "lxqt-themes" + "breeze-icons")))))) + +;; +;; Desktop Configuration +;; + +;; This goes straight into px/services/desktop +(define-public px-desktop-defaults + (package + (name "px-desktop-defaults") + (version "0.0.47") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-desktop-defaults_" + version ".tgz")) + (sha256 (base32 "1y9wp2d35nrf72bkiv39k17paa6arxp2hpz2102mymj61zb96fvk")))) + (build-system trivial-build-system) + (arguments `( + #:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (mkdir %output) + (setenv "PATH" (string-append + (assoc-ref %build-inputs "coreutils") "/bin" ":" + (assoc-ref %build-inputs "tar") "/bin" ":" + (assoc-ref %build-inputs "gzip") "/bin")) + (invoke "tar" "zxvf" (assoc-ref %build-inputs "source")) + ; (chdir (string-append (string-capitalize ,name) "-" ,version)) + ; (display (string-append ,name "_" ,version)) + ; (chdir (string-append ,name "_" ,version)) + (let ((source (assoc-ref %build-inputs "source")) + (albert (assoc-ref %build-inputs "albert-launcher")) + (copyq (assoc-ref %build-inputs "copyq")) + (px-first-login-welcome-screen + (assoc-ref %build-inputs "px-first-login-welcome-screen")) + (out (assoc-ref %outputs "out"))) + (chdir ,name) + (substitute* '("etc/xdg/autostart/lxqt-copyq-autostart.desktop") + (("Exec=copyq") (string-append "Exec=" copyq "/bin/copyq"))) + (substitute* '("etc/xdg/autostart/albert.desktop") + (("Exec=albert") (string-append "Exec=" albert "/bin/albert"))) + (substitute* '("etc/xdg/autostart/px-first-login-welcome-screen.desktop") + (("Exec=px-first-login-welcome-screen") + (string-append "Exec=" px-first-login-welcome-screen "/bin/px-first-login-welcome-screen"))) + (copy-recursively "." %output) + (chmod (string-append %output "/etc/px-desktop/scripts/lxqt-switch-desktop.sh" ) #o755) + #t)))) + (native-inputs + `(("coreutils" ,coreutils) + ("tar" ,tar) + ("gzip" ,compression:gzip))) + (propagated-inputs + `(("albert-launcher" ,albert-launcher) + ("px-widget-style" ,px-widget-style) + ("px-icons" ,px-icons) + ("px-first-login-welcome-screen" ,px-first-login-welcome-screen) + ("px-openbox-theme" ,px-openbox-theme) + ("copyq" ,copyq))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Default Configuration Package") + (description "Default Configurations for PantherX Desktop") + (license license:expat))) + +;; +;; PantherX OS Desktop default Applications and Services +;; + +(define %common-desktop-applications + (list ; px-backup + ; px-contacts + px-first-login-welcome-screen + ;; Default applications and so on... + px-desktop-wiki + px-software + ; px-hub-gui + px-software-assets-meta + + ;; Browser + firefox + + ;; Connectivity + qbittorrent + + ;; Office + libreoffice + speedcrunch + aspell + aspell-dict-en + aspell-dict-de ;; :) + aspell-dict-uk + + ;; Look and Feel + paper-icon-theme + sddm-darkine-theme + px-sddm-theme + xcursor-themes + gnome-themes-standard + font-liberation + font-adobe-source-sans-pro + font-adobe-source-code-pro + breeze-gtk + font-cns11643-swjz ;; ? + font-wqy-zenhei ;; ? + font-ibm-plex + font-vazir + font-openmoji + + ;; WIP + ;; lxqt-arc-dark-theme + + ;; Multimedia + px-image-viewer + px-music-player + px-video-player + + ;; Utils + albert-launcher + ;; Userspace virtual file system for GIO + gvfs + lxmenu-data + flameshot + pinentry-qt + print-manager + ;; CLipboard manager + copyq + + ;; U2F + pam-u2f + libu2f-host + libu2f-server + + ;; Compression + compression:zip + compression:unzip + unrar + + ;; Command line utils + curl + neofetch + wget + xrandr + + ;; Secrets + ;; Displaying certificates and accessing key stores + gcr + gnome-keyring + ;; seahorse + + px-user-services + + ;; Bluetooth + blueman + + ;; Account Service Plugins + ;; px-accounts-service-plugin-etesync ;; TODO: uncomment whenever we had a working package for `px-contact-calendar` + ; px-accounts-service-plugin-activity-watch + ; px-accounts-service-plugin-claws-mail + ; px-accounts-service-plugin-github + ; px-accounts-service-plugin-gitlab + ; px-accounts-service-plugin-oauth2-github + ; px-accounts-service-plugin-oauth2-mastodon + ; px-accounts-service-plugin-oauth2-google + ; px-accounts-service-providers-mail + ; px-accounts-service-plugin-imap + ; px-accounts-service-plugin-maestral + ; px-accounts-service-plugin-smtp + ; px-accounts-service-plugin-carddav + ; px-accounts-service-plugin-s3 + ; px-accounts-service-plugin-backup-local + ; px-accounts-service-plugin-etherscan + ; px-accounts-service-plugin-blockio + ; px-accounts-service-plugin-cryptocurrency + ; px-accounts-service-plugin-discourse + + ;; Hub Service Plugins + ;; px-hub-service-plugin-claws-mail + ; px-hub-service-plugin-github + ; px-hub-service-plugin-gitlab + ; px-hub-service-plugin-discourse + ; px-hub-service-plugin-mastodon + + ;; Time Tracking Plugins + ; px-time-tracking-plugin-gitlab + + ;; Settings Service Plugins + ; px-settings-service-plugin-accounts + px-settings-service-plugin-backup + px-settings-service-plugin-desktop-search + px-settings-service-plugin-maintenance + px-settings-service-plugin-software + px-settings-service-plugin-theme + px-settings-service-plugin-theme-dark-bright)) + +(define %gtk-desktop-applications + (list )) + +(define %qt-desktop-applications + (list + px-about + px-file-archiver + px-settings-ui + px-network-manager-applet + featherpad + qpdfview)) + +; (define %pantherx-desktop-i3 +; (list i3-wm i3lock i3lock-fancy i3status +; dmenu i3blocks))
\ No newline at end of file diff --git a/px/packages/development.scm b/px/packages/development.scm new file mode 100644 index 0000000..86baa70 --- /dev/null +++ b/px/packages/development.scm @@ -0,0 +1,41 @@ +;;; Development Packages Module for PantherX +;;; Author: Hamzeh Nasajpour (h.nasajpour@pantherx.org) +;;; + +(define-module (px packages development) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (guix utils) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages guile-xyz) + #:use-module (gnu packages version-control) + #:use-module (gnu packages serialization) + #:use-module (gnu packages databases) + #:use-module (px packages library)) + + +(define-public px-dev-environments + (package + (name "px-dev-environments") + (version "v0.0.3") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-dev-environments_" + version + ".tgz")) + (sha256 + (base32 + "0nspkyb67x3m6l2xgig4i4xbkyx6spsmwvw5vcy56ylh4d2px9jx")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f)) + (inputs `(("libgit2", libgit2))) + (propagated-inputs `(("recutils", recutils))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Setup Assistant") + (description "This package provides command line application for creating development environments.") + (license license:expat))) diff --git a/px/packages/device.scm b/px/packages/device.scm new file mode 100644 index 0000000..abcd31a --- /dev/null +++ b/px/packages/device.scm @@ -0,0 +1,487 @@ +(define-module (px packages device) + #:use-module (guix build-system cmake) + #:use-module (guix download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (gnu packages lxqt) + #:use-module (gnu packages qt) + #:use-module (guix build-system cargo) + #:use-module (guix build-system trivial) + #:use-module (guix download) + #:use-module (gnu packages aidc) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages crates-io) + #:use-module (gnu packages compression) + #:use-module (gnu packages databases) + #:use-module (gnu packages hardware) + #:use-module (gnu packages image) + #:use-module (gnu packages kde-frameworks) + #:use-module (gnu packages linux) + #:use-module (gnu packages maths) + #:use-module (gnu packages pkg-config) + #:use-module (guix build-system python) + #:use-module (gnu packages python) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages python-web) + #:use-module (gnu packages python-crypto) + #:use-module (gnu packages curl) + #:use-module (gnu packages security-token) + #:use-module (gnu packages serialization) + #:use-module (gnu packages tls) + #:use-module (gnu packages xorg) + #:use-module (gnu packages web) + #:use-module (px packages crates-io) + #:use-module (px packages common) + #:use-module (px packages kde-frameworks) + #:use-module (px packages python-xyz) + #:use-module (px packages tpm) + #:use-module (px packages library)) + +(define-public px-device-identity + (package + (name "px-device-identity") + (version "0.10.9") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "10qpj1s1z5crcs6fxngp13lgn296m76x4fckgidaikr9i6mckkd1")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'wrap-for-openssl-tss2-conf + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (openssl (assoc-ref %build-inputs "openssl")) + (tpm2-tss (assoc-ref %build-inputs "tpm2-tss")) + (tpm2-tss-engine (assoc-ref %build-inputs "tpm2-tss-engine"))) + (wrap-program (string-append out "/bin/px-device-identity") + `("OPENSSL_CONF" ":" prefix (,(string-append tpm2-tss-engine "/etc/openssl-tss2.conf")))) + (wrap-program (string-append out "/bin/px-device-identity") + `("PATH" ":" prefix (,(string-append tpm2-tss-engine "/bin/")))) + (wrap-program (string-append out "/bin/px-device-identity") + `("PATH" ":" prefix (,(string-append openssl "/bin/")))) + (wrap-program (string-append out "/bin/px-device-identity") + `("TPM2TSSENGINE_TCTI" ":" prefix (,(string-append tpm2-tss "/lib/libtss2-tcti-device.so:/dev/tpm0")))) + (wrap-program (string-append out "/bin/px-device-identity") + `("TPM2TOOLS_TCTI" ":" prefix (,(string-append tpm2-tss "/lib/libtss2-tcti-device.so:/dev/tpm0")))) + #t))) + (delete 'sanity-check)))) + (inputs + `(("openssl" ,openssl) + ("python-idna" ,python-idna) + ("python-requests" ,python-requests) + ("python-authlib-0.14.3" ,python-authlib-0.14.3) + ("python-pycryptodomex" ,python-pycryptodomex) + ("python-jose" ,python-jose) + ("python-pyyaml" ,python-pyyaml) + ("python-shortuuid" ,python-shortuuid-v1) + ("python-appdirs" ,python-appdirs) + ("python-psutil" ,python-psutil) + ("tpm2-tss" ,tpm2-tss-openssl-1.1) + ("tpm2-tss-engine" ,tpm2-tss-engine) + ("bash-minimal" ,bash-minimal))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("python-requests" ,python-requests))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Device Identity Manager") + (description "Initiates device identity based on RSA or ECC key pair and optionally registers with Central Management.") + (license license:expat))) + + +(define-public px-device-identity-service + (package + (name "px-device-identity-service") + (version "0.11.0") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "1jhzg5jqhja8pbr47waxsfhlqqff84vvj8m8kipmy9jq1sn7s0i3")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'wrap-for-openssl-tss2-conf + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (openssl (assoc-ref %build-inputs "openssl")) + (tpm2-tss (assoc-ref %build-inputs "tpm2-tss")) + (tpm2-tss-engine (assoc-ref %build-inputs "tpm2-tss-engine"))) + (wrap-program (string-append out "/bin/px-device-identity-service") + `("OPENSSL_CONF" ":" prefix (,(string-append tpm2-tss-engine "/etc/openssl-tss2.conf")))) + (wrap-program (string-append out "/bin/px-device-identity-service") + `("PATH" ":" prefix (,(string-append tpm2-tss-engine "/bin/")))) + (wrap-program (string-append out "/bin/px-device-identity-service") + `("PATH" ":" prefix (,(string-append openssl "/bin/")))) + (wrap-program (string-append out "/bin/px-device-identity-service") + `("TPM2TSSENGINE_TCTI" ":" prefix (,(string-append tpm2-tss "/lib/libtss2-tcti-device.so:/dev/tpm0")))) + (wrap-program (string-append out "/bin/px-device-identity-service") + `("TPM2TOOLS_TCTI" ":" prefix (,(string-append tpm2-tss "/lib/libtss2-tcti-device.so:/dev/tpm0")))) + #t))) + (delete 'sanity-check)))) + (inputs + `(("python-waitress" ,python-waitress) + ("openssl" ,openssl) + ("python-idna" ,python-idna) + ("python-requests" ,python-requests) + ("python-flask" ,python-flask) + ("python-werkzeug" ,python-werkzeug) + ("python-authlib-0.14.3" ,python-authlib-0.14.3) + ("python-exitstatus-2.0.1" ,python-exitstatus-2.0.1) + ("python-pycryptodomex" ,python-pycryptodomex) + ("python-jose" ,python-jose) + ("python-pyyaml" ,python-pyyaml) + ("python-shortuuid" ,python-shortuuid-v1) + ("python-appdirs" ,python-appdirs) + ("python-psutil" ,python-psutil) + ("tpm2-tss" ,tpm2-tss-openssl-1.1) + ("tpm2-tss-engine" ,tpm2-tss-engine) + ("bash-minimal" ,bash-minimal))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("python-requests" ,python-requests))) + (propagated-inputs + `(("px-device-identity" ,px-device-identity))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Device Identity Service") + (description "Makes device signing capabilities available to other applications, without root priviliges.") + (license license:expat))) + + +(define-public px-device-runner + (package + (name "px-device-runner") + (version "0.0.14") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "0sdyz81z8l0q99r09fymw2v6r9ylc7rkxxdwkbnm6lgch5pib36r")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'wrap-for-openssl-tss2-conf + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (openssl (assoc-ref %build-inputs "openssl")) + (tpm2-tss (assoc-ref %build-inputs "tpm2-tss")) + (tpm2-tss-engine (assoc-ref %build-inputs "tpm2-tss-engine"))) + (wrap-program (string-append out "/bin/px-device-runner") + `("OPENSSL_CONF" ":" prefix (,(string-append tpm2-tss-engine "/etc/openssl-tss2.conf"))) + `("PATH" ":" prefix (,(string-append tpm2-tss-engine "/bin/") + ,(string-append openssl "/bin/"))) + `("TPM2TSSENGINE_TCTI" ":" prefix (,(string-append tpm2-tss "/lib/libtss2-tcti-device.so:/dev/tpm0"))) + `("TPM2TOOLS_TCTI" ":" prefix (,(string-append tpm2-tss "/lib/libtss2-tcti-device.so:/dev/tpm0")))) + #t))) + (delete 'sanity-check)))) + (inputs + `(("openssl" ,openssl) + ("python-idna" ,python-idna) + ("python-requests" ,python-requests) + ("python-authlib-0.14.3" ,python-authlib-0.14.3) + ("python-exitstatus-2.0.1" ,python-exitstatus-2.0.1) + ("python-pycryptodomex" ,python-pycryptodomex) + ("python-jose" ,python-jose) + ("python-pyyaml-v5.3.1" ,python-pyyaml-v5.3.1) + ("python-shortuuid" ,python-shortuuid-v1) + ("python-appdirs" ,python-appdirs) + ("python-psutil" ,python-psutil) + ("tpm2-tss" ,tpm2-tss-openssl-1.1) + ("tpm2-tss-engine" ,tpm2-tss-engine) + ("bash-minimal" ,bash-minimal))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("python-requests" ,python-requests))) + (propagated-inputs + `(("px-device-identity" ,px-device-identity))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Device Runner") + (description "Downloads administrative jobs from Central Management to run on local device.") + (license license:expat))) + + +(define-public px-user-identity-service + (package + (name "px-user-identity-service") + (version "0.1.0") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "0vhb5f4klvbdf802b3i4mli3926ny4pxcnbhif8mn56dnj8lgf84")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'wrap-for-openssl-tss2-conf + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (openssl (assoc-ref %build-inputs "openssl")) + (tpm2-tss (assoc-ref %build-inputs "tpm2-tss")) + (tpm2-tss-engine (assoc-ref %build-inputs "tpm2-tss-engine"))) + (wrap-program (string-append out "/bin/px-user-identity-service") + `("OPENSSL_CONF" ":" prefix (,(string-append tpm2-tss-engine "/etc/openssl-tss2.conf"))) + `("PATH" ":" prefix (,(string-append tpm2-tss-engine "/bin/") + ,(string-append openssl "/bin/"))) + `("TPM2TSSENGINE_TCTI" ":" prefix (,(string-append tpm2-tss "/lib/libtss2-tcti-device.so:/dev/tpm0"))) + `("TPM2TOOLS_TCTI" ":" prefix (,(string-append tpm2-tss "/lib/libtss2-tcti-device.so:/dev/tpm0")))) + #t))) + (delete 'sanity-check)))) + (inputs + `(("python-waitress" ,python-waitress) + ("openssl" ,openssl) + ("python-idna" ,python-idna) + ("python-requests" ,python-requests) + ("python-flask" ,python-flask) + ("python-werkzeug" ,python-werkzeug) + ("python-authlib-0.14.3" ,python-authlib-0.14.3) + ("python-exitstatus-2.0.1" ,python-exitstatus-2.0.1) + ("python-pycryptodomex" ,python-pycryptodomex) + ("python-jose" ,python-jose) + ("python-pyyaml-v5.3.1" ,python-pyyaml-v5.3.1) + ("python-shortuuid" ,python-shortuuid-v1) + ("python-appdirs" ,python-appdirs) + ("python-psutil" ,python-psutil) + ("tpm2-tss" ,tpm2-tss-openssl-1.1) + ("tpm2-tss-engine" ,tpm2-tss-engine) + ("bash-minimal" ,bash-minimal))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("python-requests" ,python-requests))) + (propagated-inputs + `(("px-device-identity" ,px-device-identity))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX User Identity Service REST API") + (description "User Identity API to support QR and BC login with device signature.") + (license license:expat))) + + +(define-public px-file-upload-cli + (package + (name "px-file-upload-cli") + (version "0.0.6") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "-" version ".crate")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 (base32 "10p0zxf576v28hgzbby45q9xlj3bd0314h9zaikallc1l30qb2l9")))) + (build-system cargo-build-system) + (arguments + `(#:tests? #f + #:cargo-inputs + (("rust-chrono" ,rust-chrono-0.4) + ("rust-clap" ,rust-clap-2) + ("rust-configparser" ,rust-configparser-2) + ("rust-fern" ,rust-fern-0.6) + ("rust-log" ,rust-log-0.4) + ("rust-mime-guess" ,rust-mime-guess-2) + ("rust-reqwest" ,rust-reqwest-0.11) + ("rust-serde" ,rust-serde-1) + ("rust-serde-json" ,rust-serde-json-1) + ("rust-serde-yaml" ,rust-serde-yaml-0.8) + ("rust-syslog" ,rust-syslog-4) + ;; TODO: restore back to upstream version once the following patch is merged upstream: + ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60174 + ("rust-tokio" ,rust-tokio-1-patched) + ("rust-tokio-util" ,rust-tokio-util-0.6) + ("rust-uuid" ,rust-uuid-0.8)) + #:phases + (modify-phases %standard-phases + (add-after 'install 'wrap-for-openssl-tss2-conf + (lambda* (#:key outputs inputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (openssl (assoc-ref inputs "openssl")) + (tpm2-tss (assoc-ref inputs "tpm2-tss")) + (tpm2-tss-engine (assoc-ref inputs "tpm2-tss-engine"))) + (wrap-program (string-append out "/bin/px-file-upload-cli") + `("OPENSSL_CONF" ":" prefix (,(string-append tpm2-tss-engine "/etc/openssl-tss2.conf"))) + `("PATH" ":" prefix (,(string-append tpm2-tss-engine "/bin/") + ,(string-append openssl "/bin/"))) + `("TPM2TSSENGINE_TCTI" ":" prefix (,(string-append tpm2-tss "/lib/libtss2-tcti-device.so:/dev/tpm0"))) + `("TPM2TOOLS_TCTI" ":" prefix (,(string-append tpm2-tss "/lib/libtss2-tcti-device.so:/dev/tpm0")))) + #t)))))) + (inputs + `(("openssl" ,openssl) + ("tpm2-tss" ,tpm2-tss-openssl-1.1) + ("tpm2-tss-engine" ,tpm2-tss-engine) + ("bash-minimal" ,bash-minimal))) + (native-inputs + `(("pkg-config" ,pkg-config))) + (propagated-inputs + `(("px-device-identity" ,px-device-identity))) + (home-page "https://pantherx.org") + (synopsis "PantherX Uploader Utility") + (description "Uploader cli application which reads a +configuration file from commandline args and upload results to the server") + (license license:expat))) + + +(define-public px-device-backup + (package + (name "px-device-backup") + (version "0.0.5") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "1wcqvwwcv5x98haj956gmwgv977h41pwh42qvhp6z0v3sfn21cby")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'wrap-for-openssl-tss2-conf + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (openssl (assoc-ref %build-inputs "openssl")) + (tpm2-tss (assoc-ref %build-inputs "tpm2-tss")) + (tpm2-tss-engine (assoc-ref %build-inputs "tpm2-tss-engine"))) + (wrap-program (string-append out "/bin/px-device-backup") + `("OPENSSL_CONF" ":" prefix (,(string-append tpm2-tss-engine "/etc/openssl-tss2.conf"))) + `("PATH" ":" prefix (,(string-append tpm2-tss-engine "/bin/") + ,(string-append openssl "/bin/"))) + `("TPM2TSSENGINE_TCTI" ":" prefix (,(string-append tpm2-tss "/lib/libtss2-tcti-device.so:/dev/tpm0"))) + `("TPM2TOOLS_TCTI" ":" prefix (,(string-append tpm2-tss "/lib/libtss2-tcti-device.so:/dev/tpm0")))) + #t))) + (delete 'sanity-check)))) + (inputs + `(("python-waitress" ,python-waitress) + ("openssl" ,openssl) + ("python-idna" ,python-idna) + ("python-requests" ,python-requests) + ("python-authlib-0.14.3" ,python-authlib-0.14.3) + ("python-exitstatus-2.0.1" ,python-exitstatus-2.0.1) + ("python-pycryptodomex" ,python-pycryptodomex) + ("python-jose" ,python-jose) + ("python-pyyaml-v5.3.1" ,python-pyyaml-v5.3.1) + ("python-shortuuid" ,python-shortuuid-v1) + ("python-appdirs" ,python-appdirs) + ("python-psutil" ,python-psutil) + ("tpm2-tss" ,tpm2-tss-openssl-1.1) + ("tpm2-tss-engine" ,tpm2-tss-engine) + ("python-boto3" ,python-boto3) + ("bash-minimal" ,bash-minimal))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("python-requests" ,python-requests))) + (propagated-inputs + `(("px-device-identity" ,px-device-identity))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Device Backup") + (description "Pulls device backup config from Central Management and runs the backup.") + (license license:expat))) + +; (define-public px-remote-access +; (package +; (name "px-remote-access") +; (version "0.0.4") +; (source +; (origin +; (method url-fetch) +; (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) +; (sha256 (base32 "05c01ir1yd0mxf0x4x35khfh805y03b7x4qrmcczkcwjf53mk9d3")))) +; (build-system python-build-system) +; (arguments +; `(#:tests? #f +; #:phases +; (modify-phases %standard-phases +; (add-after 'install 'wrap-for-openssl-tss2-conf +; (lambda* (#:key outputs #:allow-other-keys) +; (let ((out (assoc-ref outputs "out")) +; (openssl (assoc-ref %build-inputs "openssl")) +; (tpm2-tss (assoc-ref %build-inputs "tpm2-tss")) +; (tpm2-tss-engine (assoc-ref %build-inputs "tpm2-tss-engine"))) +; (wrap-program (string-append out "/bin/px-remote-access") +; `("OPENSSL_CONF" ":" prefix (,(string-append tpm2-tss-engine "/etc/openssl-tss2.conf"))) +; `("PATH" ":" prefix (,(string-append tpm2-tss-engine "/bin/") +; ,(string-append openssl "/bin/"))) +; `("TPM2TSSENGINE_TCTI" ":" prefix (,(string-append tpm2-tss "/lib/libtss2-tcti-device.so:/dev/tpm0"))) +; `("TPM2TOOLS_TCTI" ":" prefix (,(string-append tpm2-tss "/lib/libtss2-tcti-device.so:/dev/tpm0")))) +; #t))) +; (delete 'sanity-check)))) +; (inputs +; `(("openssl" ,openssl) +; ("python-idna" ,python-idna) +; ("python-requests" ,python-requests) +; ("python-falcon" ,python-falcon) +; ("gunicorn" ,gunicorn) +; ("python-sqlalchemy" ,python-sqlalchemy) +; ("python-authlib-0.14.3" ,python-authlib-0.14.3) +; ("python-exitstatus-2.0.1" ,python-exitstatus-2.0.1) +; ("python-pycryptodomex" ,python-pycryptodomex) +; ("python-pyyaml-v5.3.1" ,python-pyyaml-v5.3.1) +; ("python-shortuuid-v1.0.1" ,python-shortuuid-v1.0.1) +; ("python-appdirs" ,python-appdirs) +; ("python-psutil" ,python-psutil) +; ("tpm2-tss" ,tpm2-tss) +; ("tpm2-tss-engine" ,tpm2-tss-engine))) +; (native-inputs +; `(("python-setuptools" ,python-setuptools) +; ("pkg-config" ,pkg-config) +; ("python-requests" ,python-requests))) +; (propagated-inputs +; `(("px-device-identity" ,px-device-identity))) +; (home-page "https://www.pantherx.org/") +; (synopsis "PantherX Remote Access") +; (description "Enables SSH remote access via tunnel.") +; (license license:expat))) + + +;; (define-public px-org-activitywatch-service +;; (package +;; (name "px-org-activitywatch-service") +;; (version "0.0.2") +;; (source +;; (origin +;; (method url-fetch) +;; (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) +;; (sha256 (base32 "0wpnp9vkkr0a4wpmsn5al6ydd6pdvsx3jc7j7j1836c97jg78rw2")))) +;; (build-system python-build-system) +;; (native-inputs `(("python-setuptools", python-setuptools))) +;; (propagated-inputs +;; `(("python-pyyaml", python-pyyaml) +;; ("python-requests" ,python-requests) +;; ;; TODO: Should probably include activity watch +;; ("px-secret-library-python", px-secret-library-python) +;; ("px-accounts-library-python", px-accounts-library-python))) +;; (home-page "https://www.pantherx.org/") +;; (synopsis "Submit ActivityWatch events to Central Management") +;; (description "Queries local ActivityWatch server and submits events +;; to Central Management") +;; (license license:expat))) + + +(define-public bluetooth-client-manager-service + (package + (name "bluetooth-client-manager-service") + (version "0.1.9") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 + (base32 "03j5ipswkj32hda6wwpsj3f3z3sp4dgi0a5val7g5q98nnpcqgqr")))) + (build-system cmake-build-system) + (native-inputs `(("pkg-config" ,pkg-config))) + (inputs `(("bluez-qt" ,bluez-qt) + ("capnproto" ,capnproto-0.9) + ("openssl" ,openssl) + ("qtbase", qtbase-5) + ("util-linux" ,util-linux "lib") + ("yaml-cpp" ,yaml-cpp))) + (arguments `(#:tests? #f)) + (home-page "https://pantherx.org") + (synopsis "Bluetooth Client Manager Service") + (description "Background service for Bluetooth device discovery, data retrieval and submission") + (license license:expat))) diff --git a/px/packages/document.scm b/px/packages/document.scm new file mode 100644 index 0000000..4cbeb64 --- /dev/null +++ b/px/packages/document.scm @@ -0,0 +1,42 @@ +;;; Settings Packages Module for PantherX +;;; Author: Hamzeh Nasajpour (h.nasajpour@pantherx.org) +;;; + +(define-module (px packages document) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (guix build-system qt) + #:use-module (gnu packages hunspell) + #:use-module (gnu packages libreoffice) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages qt) + #:use-module (gnu packages base)) + +(define-public featherpad + (package + (name "featherpad") + (version "1.3.0") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/tsujan/FeatherPad/archive/V" version ".tar.gz")) + (sha256 + (base32 + "1406a1appj3qf5545wfgvpskxm4r1vwxchd71pbvghxnic61c506")))) + (build-system cmake-build-system) + (arguments + `( + #:tests? #f)) + (native-inputs `( + ("pkg-config" ,pkg-config) + ("hunspell" ,hunspell) + ("qtsvg" ,qtsvg-5) + ("qtx11extras" ,qtx11extras) + ("qtbase" ,qtbase-5))) + (home-page "https://github.com/tsujan/FeatherPad") + (synopsis "FeatherPad is a lightweight Qt5 plain-text editor for Linux") + (description "FeatherPad is a lightweight Qt5 plain-text editor for Linux") + (license license:expat))) diff --git a/px/packages/email.scm b/px/packages/email.scm new file mode 100644 index 0000000..b1986e7 --- /dev/null +++ b/px/packages/email.scm @@ -0,0 +1,109 @@ +(define-module (px packages email) + #:use-module (guix build-system qt) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (gnu packages cyrus-sasl) + #:use-module (gnu packages curl) + #:use-module (gnu packages qt) + #:use-module (gnu packages kde-frameworks) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages version-control) + #:use-module (gnu packages kde-pim) + #:use-module (gnu packages serialization) + #:use-module (gnu packages databases) + #:use-module (gnu packages search) + #:use-module (gnu packages gnupg) + #:use-module (guix git-download)) + + +(define-public kasync + (package + (name "kasync") + (version "0.3.0") + (home-page "https://kube-project.com/") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/KDE/kasync") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0k5jrmyqa0y4vfvg6sjr3mf12p62b1f7l3ryvy3wg1app63rssaf")))) + (build-system qt-build-system) + (native-inputs + (list extra-cmake-modules kdoctools pkg-config)) + (inputs + (list + qtbase-5)) + (arguments + `(#:tests? #f)) + (synopsis "Library for composable asynchronous code +using a continuation based approach") + (description "KAsync helps writing composable asynchronous code +using a continuation based approach.") + (license license:gpl2+))) + +(define-public kimap2 + (package + (name "kimap2") + (version "0.4.0") + (home-page "https://kube-project.com/") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/KDE/kimap2") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "16ax75xq0lqzjf72xr7gci5vv55kf8r5iyr3s27y0j32fjr25l25")))) + (build-system qt-build-system) + (native-inputs + (list extra-cmake-modules kdoctools pkg-config)) + (inputs + (list + qtbase-5 + kcoreaddons + kcodecs + kmime + cyrus-sasl)) + (arguments + `(#:tests? #f)) + (synopsis "This library provides a job-based API for interacting with an IMAP4rev1 server") + (description "This library provides a job-based API for interacting with an IMAP4rev1 server. +It manages connections, encryption and parameter quoting and encoding, +but otherwise provides quite a low-level interface to the protocol. +This library does not implement an IMAP client; it merely makes it easier to do so.") + (license license:gpl2+))) + +(define-public kdav2 + (package + (name "kdav2") + (version "0.4.0") + (home-page "https://kube-project.com/") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/KDE/kdav2") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1sy1kiwx8six711frpav7a3py7g66cv8ryy0my7rr7kdv8r82r7k")))) + (build-system qt-build-system) + (native-inputs + (list extra-cmake-modules kdoctools pkg-config)) + (inputs + (list + qtbase-5 + qtxmlpatterns + kcoreaddons)) + (arguments + `(#:tests? #f)) + (synopsis "This is an DAV protocol implemention with KJobs") + (description "This is an DAV protocol implemention with KJobs. +Calendars and todos are supported, using either GroupDAV +or CalDAV, and contacts are supported using GroupDAV or +CardDAV.") + (license license:gpl2+)))
\ No newline at end of file diff --git a/px/packages/etesync.scm b/px/packages/etesync.scm new file mode 100644 index 0000000..efea657 --- /dev/null +++ b/px/packages/etesync.scm @@ -0,0 +1,285 @@ +(define-module (px packages etesync) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (ice-9 match) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (guix build-system python) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages base) + #:use-module (gnu packages check) + #:use-module (gnu packages compression) + #:use-module (gnu packages databases) + #:use-module (gnu packages dav) + #:use-module (gnu packages libffi) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-crypto) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages python-web) + #:use-module (gnu packages python-check) + #:use-module (gnu packages time) + #:use-module (gnu packages xml) + #:use-module (guix git-download) + #:use-module (px packages python-xyz)) + +(define-public python-etebase + (package + (name "python-etebase") + (version "0.31.2") + (source + (origin + (method url-fetch) + (uri + (string-append + "https://github.com/etesync/etebase-py/releases/download/v" version + "/etebase-" version + ;; This fails because releases are only available up to python 3.9 + ;; "-cp" (string-replace-substring (version-major+minor (package-version python)) "." "") + ;; "-cp" (string-replace-substring (version-major+minor (package-version python)) "." "") "-manylinux2010_" + "-cp39-cp39-manylinux2010_" + (match (or (%current-system) (%current-target-system)) + ("x86_64-linux" "x86_64") + ("i686-linux" "i686") + ("aarch64-linux" "aarch64")) + ".whl")) + (sha256 + (base32 "19gf7zriarcac3l6hx4zw7gl175fxaz457gkl4kkjdfcq6g5pxas")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f + #:validate-runpath? #f + #:phases + (modify-phases %standard-phases + (delete 'unpack) + (delete 'configure) + (delete 'build) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((source (assoc-ref %build-inputs "source")) + (python (assoc-ref inputs "python")) + (out (assoc-ref outputs "out")) + (bin (string-append out "/bin/")) + (target (string-append + %output "/lib/python" + ,(version-major+minor + (package-version python)) + "/site-packages/"))) + (mkdir-p target) + (invoke "unzip" source "-d" target) + #t)) + )))) + (native-inputs `(("coreutils" ,coreutils) + ("python" ,python-3) + ("unzip" ,unzip))) + (propagated-inputs `(("python-msgpack" ,python-msgpack))) + (home-page "https://www.etesync.com/") + (synopsis "A Python library for Etebase") + (description + "This package is implemented in Rust and exposes a Python API for people to use.") + (license license:bsd-3))) + +(define-public python-etesync + (package + (name "python-etesync") + (version "0.12.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/etesync/pyetesync/archive/v" version ".tar.gz")) + (sha256 + (base32 "18z7fh8mg3h5zdp4zjshg29p495n03i6hh8nghpc9n79a6a4s8k3")))) + (build-system python-build-system) + (arguments + `(#:tests? #f)) + (native-inputs + `(("python" ,python) + ("python-appdirs" ,python-appdirs) + ("python-asn1crypto" ,python-asn1crypto) + ("python-attrs" ,python-attrs) + ("python-certifi" ,python-certifi) + ("python-cffi" ,python-cffi) + ("python-chardet" ,python-chardet) + ("python-idna" ,python-idna) + ("python-orderedmultidict" ,python-orderedmultidict) + ("python-packaging" ,python-packaging) + ("python-py" ,python-py) + ("python-pyasn1" ,python-pyasn1) + ("python-pycparser" ,python-pycparser) + ("python-pyparsing" ,python-pyparsing) + ("python-dateutil" ,python-dateutil) + ("python-pytz" ,python-pytz) + ("python-six" ,python-six) + ("python-urllib3" ,python-urllib3))) + (propagated-inputs `(("python-cryptography" ,python-cryptography) + ("python-furl" ,python-furl) + ("python-peewee" ,python-peewee) + ("python-requests" ,python-requests) + ("python-vobject" ,python-vobject))) + (home-page "https://github.com/etesync/pyetesync") + (synopsis "A python client library for EteSync.") + (description + "This module provides a python API to interact with an EteSync server. +It currently implements AddressBook and Calendar access, and supports two-way sync (both push and pull) to the server.") + (license license:gpl3))) + +(define-public python-speaklater + (package + (name "python-speaklater") + (version "1.3") + (source (origin + (method url-fetch) + (uri (pypi-uri "speaklater" version)) + (sha256 + (base32 + "1ab5dbfzzgz6cnz4xlwx79gz83id4bhiw67k1cgqrlzfs0va7zjr")))) + (build-system python-build-system) + (home-page "http://github.com/mitsuhiko/speaklater") + (synopsis "implements a lazy string for python useful for use with gettext") + (description + "implements a lazy string for python useful for use with gettext") + (license #f))) + +;; python-flask-wtf tests require python-flask-babelex +(define-public python-flask-babelex + (package + (name "python-flask-babelex") + (version "0.9.4") + (source (origin + (method url-fetch) + (uri (pypi-uri "Flask-BabelEx" version)) + (sha256 + (base32 + "09yfr8hlwvpgvq8kp1y7qbnnl0q28hi0348bv199ssiqx779r99r")))) + (build-system python-build-system) + (propagated-inputs (list python-babel python-flask python-jinja2 + python-speaklater)) + (home-page "http://github.com/mrjoes/flask-babelex") + (synopsis "Adds i18n/l10n support to Flask applications") + (description "Adds i18n/l10n support to Flask applications") + (license license:bsd-3))) + +;; etesync-dav: Requirement.parse('Flask-WTF<1.0.0,>=0.14.2'), {'etesync-dav'}) +(define-public python-flask-wtf-0.15.1 + (package + (name "python-flask-wtf") + (version "0.15.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "Flask-WTF" version)) + (sha256 + (base32 + "1p7jzxa3xckg13z1v9mck576m977h4qfczs3ag12sc4iz22p25zz")))) + (build-system python-build-system) + (arguments + '(#:phases + (modify-phases %standard-phases + (replace 'check + (lambda _ + (invoke "pytest" "-vv")))))) + (propagated-inputs + (list python-flask python-itsdangerous python-wtforms python-flask-babelex)) + (native-inputs + (list python-pytest)) + (home-page "https://github.com/lepture/flask-wtf") + (synopsis "Simple integration of Flask and WTForms") + (description "Flask-WTF integrates Flask and WTForms, including CSRF, file +upload, and reCAPTCHA.") + (license license:bsd-3))) + +;; etesync-dav: Requirement.parse('Radicale==3.0.3'), {'etesync-dav'}) +(define-public radicale-3.0.3 + (package + (name "radicale") + (version "3.0.3") + (source (origin + (method url-fetch) + (uri (pypi-uri "Radicale" version)) + (sha256 + (base32 + "08m2lg4z0gr5n8qj54sblld5pqwcqccx1whw2mi74zx4zanrb69x")))) + (build-system python-build-system) + (arguments + '(#:tests? #f)) ; The tests are not distributed in the PyPi release. + (native-inputs + `(("python-dateutil" ,python-dateutil) + ("python-defusedxml" ,python-defusedxml) + ("python-passlib" ,python-passlib) + ("python-vobject" ,python-vobject))) + (propagated-inputs + ;; TODO: Add python-pam + `(("python-requests" ,python-requests))) + (synopsis "Basic CalDAV and CardDAV server") + (description "Radicale is a CalDAV and CardDAV server for UNIX-like +platforms. Calendars and address books are available for both local and remote +access, possibly limited through authentication policies. They can be viewed +and edited by calendar and contact clients on mobile phones or computers. + +Radicale intentionally does not fully comply with the CalDAV and CardDAV RFCs. +Instead, it supports the CalDAV and CardDAV implementations of popular +clients.") + (home-page "https://radicale.org/") + (license license:gpl3+))) + +(define-public etesync-dav + (package + (name "etesync-dav") + (version "0.32.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri name version)) + (sha256 + (base32 + "086pjji6897y157idlnls87qi2f2bq0787lwqfdd4m97jf1yxqm4")))) + (build-system python-build-system) + (arguments + '(#:tests? #f)) ; The tests are not distributed in the PyPi release. + (propagated-inputs + `(("python-appdirs" ,python-appdirs) + ("python-asn1crypto" ,python-asn1crypto) + ("python-certifi" ,python-certifi) + ("python-cffi" ,python-cffi) + ("python-chardet" ,python-chardet) + ("python-click" ,python-click) + ("python-cryptography" ,python-cryptography) + ("python-defusedxml" ,python-defusedxml) + ("python-etebase" ,python-etebase) + ("python-etesync" ,python-etesync) + ("python-exitstatus" ,python-exitstatus-2.0.1) + ("python-flask" ,python-flask) + ("python-furl" ,python-furl) + ("python-idna" ,python-idna) + ("python-itsdangerous" ,python-itsdangerous) + ("python-flask-wtf" ,python-flask-wtf-0.15.1) + ("python-jinja2" ,python-jinja2) + ("python-markupsafe" ,python-markupsafe) + ("python-msgpack" ,python-msgpack) + ("python-orderedmultidict" ,python-orderedmultidict) + ("python-packaging" ,python-packaging) + ("python-passlib" ,python-passlib) + ("python-peewee" ,python-peewee) + ("python-py" ,python-py) + ("python-pyasn1" ,python-pyasn1) + ("python-pycparser" ,python-pycparser) + ("python-pyparsing" ,python-pyparsing) + ("python-dateutil" ,python-dateutil) + ("python-pysocks" ,python-pysocks) + ("python-pytz" ,python-pytz) + ("python-requests" ,python-requests) + ("python-six" ,python-six) + ("python-urllib3" ,python-urllib3) + ("python-vobject" ,python-vobject) + ("python-werkzeug" ,python-werkzeug) + ("python-wtforms" ,python-wtforms) + ("radicale" ,radicale-3.0.3))) + (home-page "https://github.com/etesync/etesync-dav") + (synopsis "CalDAV and CardDAV adapter for EteSync") + (description + "This package provides a local CalDAV and CardDAV server that acts as an EteSync compatibility layer (adapter). + It's meant for letting desktop CalDAV and CardDAV clients such as Thunderbird, Outlook and Apple Contacts connect with EteSync.") + (license license:gpl3))) + diff --git a/px/packages/events.scm b/px/packages/events.scm new file mode 100644 index 0000000..621f80a --- /dev/null +++ b/px/packages/events.scm @@ -0,0 +1,43 @@ +;;; Central Event Management Service Packages Module for PantherX +;;; Author: Reza Alizadeh Majd (r.majd@pantherx.org) +;;; Last Change: 2019-02-13 + + +(define-module (px packages events) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (gnu packages networking) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages serialization) + #:use-module (px packages common) + #:use-module (px packages networking)) + + +(define-public px-events-service + (package + (name "px-events-service") + (version "0.1.0") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-events-service_v" + version ".tgz")) + (sha256 + (base32 "06030lzzpkw13q7ggr6iw4ywdra57cwc7kn870asd73n3gszyc6r")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f)) + (inputs `( + ("capnproto", capnproto-0.9) + ("nng", nng-1.5) + ("yaml-cpp" ,yaml-cpp))) + (native-inputs `( + ("pkg-config", pkg-config))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Central Event Management Service") + (description "This package provides background services to manage +event routing in PantherX") + (license license:expat))) diff --git a/px/packages/gstreamer.scm b/px/packages/gstreamer.scm new file mode 100644 index 0000000..c29ef3b --- /dev/null +++ b/px/packages/gstreamer.scm @@ -0,0 +1,85 @@ +(define-module (px packages gstreamer) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix gexp) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix build-system cmake) + #:use-module (guix build-system gnu) + #:use-module (guix build-system meson) + #:use-module (guix build-system trivial) + #:use-module (guix utils) + #:use-module (gnu packages) + #:use-module (gnu packages aidc) + #:use-module (gnu packages audio) + #:use-module (gnu packages autotools) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages bison) + #:use-module (gnu packages cdrom) + #:use-module (gnu packages curl) + #:use-module (gnu packages compression) + #:use-module (gnu packages documentation) + #:use-module (gnu packages elf) + #:use-module (gnu packages flex) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages gettext) + #:use-module (gnu packages ghostscript) + #:use-module (gnu packages gl) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages gnupg) + #:use-module (gnu packages graphics) + #:use-module (gnu packages graphviz) + #:use-module (gnu packages gstreamer) + #:use-module (gnu packages gtk) + #:use-module (gnu packages image) + #:use-module (gnu packages image-processing) + #:use-module (gnu packages iso-codes) + #:use-module (gnu packages java) + #:use-module (gnu packages libunwind) + #:use-module (gnu packages libusb) + #:use-module (gnu packages linux) + #:use-module (gnu packages maths) + #:use-module (gnu packages mp3) + #:use-module (gnu packages multiprecision) + #:use-module (gnu packages music) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages nettle) + #:use-module (gnu packages networking) + #:use-module (gnu packages ocr) + #:use-module (gnu packages perl) + #:use-module (gnu packages photo) + #:use-module (gnu packages pulseaudio) + #:use-module (gnu packages qt) + #:use-module (gnu packages rdf) + #:use-module (gnu packages sdl) + #:use-module (gnu packages shells) + #:use-module (gnu packages video) + #:use-module (gnu packages xorg) + #:use-module (gnu packages xdisorg) + #:use-module (gnu packages xiph) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages ruby) + #:use-module (gnu packages speech) + #:use-module (gnu packages python) + #:use-module (gnu packages ssh) + #:use-module (gnu packages telephony) + #:use-module (gnu packages tls) + #:use-module (gnu packages version-control) + #:use-module (gnu packages vulkan) + #:use-module (gnu packages webkit) + #:use-module (gnu packages assembly) + #:use-module (gnu packages xml)) + +(define-public gst-plugins-good-qmlgl + (package + (inherit gst-plugins-good) + (name "gst-plugins-good-qmlgl") + (inputs + `(("qtbase" ,qtbase-5) + ("qtdeclarative" ,qtdeclarative-5) + ("qtquickcontrols2" ,qtquickcontrols2-5) + ("qtx11extras" ,qtx11extras) + ("qtwayland" ,qtwayland) + ,@(package-inputs gst-plugins-good))))) diff --git a/px/packages/hub.scm b/px/packages/hub.scm new file mode 100644 index 0000000..39521b8 --- /dev/null +++ b/px/packages/hub.scm @@ -0,0 +1,493 @@ +;;; Hub Packages Module for PantherX +;;; Author: Fakhri Sajadi (f.sajadi@pantherx.org) +;;; + +(define-module (px packages hub) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (guix build-system python) + #:use-module (guix utils) + #:use-module (gnu packages compression) + #:use-module (gnu packages sqlite) + #:use-module (gnu packages networking) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages serialization) + #:use-module (gnu packages qt) + #:use-module (px packages common) + #:use-module (px packages networking) + #:use-module (px packages dav) + #:use-module (px packages databases) + #:use-module (px packages library) + #:use-module (px packages python-xyz) + #:use-module (guix gexp)) + +(define-public px-hub-gui + (package + (name "px-hub-gui") + (version "0.0.7") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 + (base32 + "0dy2hlgqgjgifn2lyv5rjmvfl56wiwpqn9lszh3m6jdg9jjj31rl")))) + (build-system cmake-build-system) + (arguments + `( + #:tests? #f)) + (native-inputs `( + ("pkg-config" ,pkg-config) + ("qt" ,qtbase-5) + ("yaml-cpp" ,yaml-cpp) + ("zlib" ,zlib) + ("capnproto" ,capnproto-0.9) + ("px-gui-library" ,px-gui-library))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX HUB Desktop Application") + (description "PantherX HUB Desktop Application") + (license license:expat))) + +(define-public px-hub-service + (package + (name "px-hub-service") + (version "v0.4.12") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-hub-service_" version ".tgz")) + (sha256 + (base32 + "0wi2d5cq318jd4igc3b5mknwg93ip14x16lgkghawxwdwgkx5nhk")))) + (build-system cmake-build-system) + (arguments + `( + #:tests? #f)) + (inputs `( + ("sqlite" ,sqlite) + ("sqlitecpp" ,sqlitecpp) + ("zlib" ,zlib) + ("yaml-cpp" ,yaml-cpp) + ("capnproto" ,capnproto-0.9) + ("px-cal-card-dav-lib" ,px-cal-card-dav-lib) + ("qtbase" ,qtbase-5))) + (native-inputs `( + ("pkg-config" ,pkg-config) + ("nng" ,nng-1.5) + ("python" ,python) + ("pybind11" ,pybind11))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Hub Management Service") + (description "This package provides background services to show status of accounts in PantherX") + (license license:expat))) + + +(define-public px-hub-service-plugin-common + (package + (name "px-hub-service-plugin-common") + (version "0.0.5") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "1vg6cjgav53s23xv4ymh11n2r7yg1wpp7pjajmwsg0mkcnv5ij2k")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'sanity-check)))) + (propagated-inputs + `(("python-pycapnp" ,python-pycapnp))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Hub Service Plugin Commons") + (description "Python classes required for all Hub Service plugins.") + (license license:expat))) + + +(define-public px-hub-service-plugin-claws-mail + (package + (name "px-hub-service-plugin-claws-mail") + (version "0.2.3") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "18n9v8cnp9fdl29h1ms9n05b9rs3fsgnzkmpk7yh8cdbvgpam7ps")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/hub/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ + (format #t regdata)))))) + (delete 'sanity-check)))) + (propagated-inputs + `(("px-claws-mail-parser", px-claws-mail-parser) + ("px-hub-service-plugin-common", px-hub-service-plugin-common))) + (home-page "https://www.pantherx.org/") + (synopsis "claws-mail plugin for HUB Service") + (description "Claws-Mail plugin for HUB Service") + (license license:expat))) + + +(define-public px-hub-service-plugin-github + (package + (name "px-hub-service-plugin-github") + (version "0.2.3") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "01jfdfkmag4lgr3wfh9fvhh9bvc0k81m41mh7akdafylbcqliqd2")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/hub/plugins")) + (regdata (string-append "plugin:" + "\n name: " ,name + "\n version: " ,version + "\n type: " type + "\n path: " out + "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ (format #t regdata)))))) + (delete 'sanity-check)))) + (propagated-inputs + `(("px-hub-service-plugin-common", px-hub-service-plugin-common) + ("px-online-sources-library", px-online-sources-library))) + (home-page "https://www.pantherx.org/") + (synopsis "GitHub OAUTH2 plugin for PantherX Hub Service") + (description "Adds support to retrieve data from GitHub API.") + (license license:expat))) + + +(define-public px-hub-service-plugin-gitlab + (package + (name "px-hub-service-plugin-gitlab") + (version "0.2.2") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "0zajd6wr523hchslx47czgss1gw6m633ga5ybrxh6khhccfp38vj")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/hub/plugins")) + (regdata (string-append "plugin:" + "\n name: " ,name + "\n version: " ,version + "\n type: " type + "\n path: " out + "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ (format #t regdata)))))) + (delete 'sanity-check)))) + (propagated-inputs + `(("px-hub-service-plugin-common", px-hub-service-plugin-common) + ("px-online-sources-library", px-online-sources-library))) + (home-page "https://www.pantherx.org/") + (synopsis "GitLab plugin for PantherX Hub Service") + (description "Adds support to retrieve data from GitLab API.") + (license license:expat))) + +(define-public px-hub-service-plugin-discourse + (package + (name "px-hub-service-plugin-discourse") + (version "0.0.3") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 (base32 "1hz9sqlc2ldnx0jh4sglprzqs0q57h1q6gj5wk3hynb0l0dfh4nb")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/hub/plugins")) + (regdata (string-append "plugin:" + "\n name: " ,name + "\n version: " ,version + "\n type: " type + "\n path: " out + "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ (format #t regdata)))))) + (delete 'sanity-check)))) + (propagated-inputs + `(("px-hub-service-plugin-common", px-hub-service-plugin-common) + ("px-online-sources-library", px-online-sources-library))) + (home-page "https://www.pantherx.org/") + (synopsis "GitLab plugin for PantherX Hub Service") + (description "Adds support to retrieve data from GitLab API.") + (license license:expat))) + + + + +(define-public px-hub-service-plugin-cpp-test + (package + (name "px-hub-service-plugin-cpp-test") + (version "v0.0.8") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 + (base32 + "0y1jpcbc75774ghv34sjsf2qx6b25fjg9h8q0lzyb4q41aaj9j8d")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "cpp") + (regpath (string-append out "/etc/px/hub/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "/lib/lib" ,name ".so\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ + (format #t regdata))) + ))) + ))) + (inputs `( + ("zlib", zlib) + ("yaml-cpp", yaml-cpp))) + (home-page "https://www.pantherx.org/") + (synopsis "CPP Test Plugin For Hub service") + (description "Test Plugin for Hub service, this plugin needs + to be installed in order to tests run properly.") + (license license:expat))) + +(define-public px-hub-service-plugin-python-single-service + (package + (name "px-hub-service-plugin-python-single-service") + (version "v0.0.15") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" + version + ".tgz")) + (sha256 + (base32 + "057ph59r79j0cnfv1qy9vpi7lm53zikf8kbbxf4vxpw5wqpswrzd")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/hub/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ + (format #t regdata))) + ))) + ))) + (home-page "https://www.pantherx.org/") + (synopsis "Test Plugin For Hub service") + (description "Test Plugin (single service to multiple plugin mode) for hub service, this plugin needs + to be installed in order to tests run properly.") + (license license:expat))) + + +(define-public px-hub-service-plugin-python-multi-service + (package + (name "px-hub-service-plugin-python-multi-service") + (version "v0.0.6") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" + version + ".tgz")) + (sha256 + (base32 + "1vzgf5f6s34v5942nv5ssb8w21l3r4g9hc3yv8iycvpj54ma182l")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/hub/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ + (format #t regdata))) + ))) + ))) + (home-page "https://www.pantherx.org/") + (synopsis "Test Plugin-1 For Hub service") + (description "Test Plugin (multiple service to single plugin mode) for hub service, this plugin needs + to be installed in order to tests run properly.") + (license license:expat))) + + +(define-public px-hub-service-plugin-data-service + (package + (name "px-hub-service-plugin-data-service") + (version "v0.0.5") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-hub-service-plugin-data-service_" + version + ".tgz")) + (sha256 + (base32 + "0b17q21pqp45s79qwqfnjhrra2dg9xipgypdd5j8gwb1j0r0ifks")))) + (build-system python-build-system) + + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/hub/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ + (format #t regdata))) + ))) + ))) + + (home-page "https://www.pantherx.org/") + (synopsis "Data service Plugin For hub service") + (description "Provides data support to hub service") + (license license:expat))) + + +(define-public px-hub-service-plugin-mastodon + (package + (name "px-hub-service-plugin-mastodon") + (version "v0.1.1") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 + (base32 + "0gm5if2a73s30mp7n7nj6r4rnidnaahyrzi7mxqy8zsissagn94c")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "cpp") + (regpath (string-append out "/etc/px/hub/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "/lib/lib" ,name ".so\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ + (format #t regdata))) + ))) + ))) + (inputs `( + ("zlib", zlib) + ("yaml-cpp", yaml-cpp) + ("capnproto", capnproto-0.9))) + (native-inputs `( + ("pkg-config", pkg-config))) + (home-page "https://www.pantherx.org/") + (synopsis "CPP Test Plugin For Hub service") + (description "Test Plugin for Hub service, this plugin needs + to be installed in order to tests run properly.") + (license license:expat))) + + diff --git a/px/packages/images.scm b/px/packages/images.scm new file mode 100644 index 0000000..944464b --- /dev/null +++ b/px/packages/images.scm @@ -0,0 +1,41 @@ +;;; Imaging Packages Module for PantherX +;;; Author: Reza Alizadeh Majd (r.majd@pantherx.org) + +(define-module (px packages images) + #:use-module (guix build-system cmake) + #:use-module (guix download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (gnu packages) + #:use-module (gnu packages gcc) + #:use-module (gnu packages image) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages qt) + #:use-module (gnu packages image-processing) + #:use-module (gnu packages video)) + +(define-public qimgv + (package + (name "qimgv") + (version "1.0.3-alpha") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/easymodo/" + name "/archive/v" version ".tar.gz")) + (sha256 (base32 "1jcr2f6b2hjss4qiih9nvla1xryf9c4dnp3f1cfqkccxszikxh4l")))) + (build-system cmake-build-system) + (arguments `(#:tests? #f)) + (native-inputs + (list exiv2 + gcc + mpv + opencv + pkg-config + qtbase + qtsvg + qttools)) + (home-page "https://github.com/easymodo/qimgv") + (synopsis "Qt5 image viewer with optional video support") + (description "Qt5 image viewer. Fast, configurable, easy to use. Optional video support.") + (license license:gpl3+))) diff --git a/px/packages/inspection.scm b/px/packages/inspection.scm new file mode 100644 index 0000000..22c7847 --- /dev/null +++ b/px/packages/inspection.scm @@ -0,0 +1,57 @@ +;;; Netwrok Inspection tool packages. +;;; Copyright © 2020 Sina Mahmoodi Khorandi <s.mahmoodi@pantherx.org> + +(define-module (px packages inspection) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (gnu packages glib) + #:use-module (gnu packages web) + #:use-module (gnu packages linux) + #:use-module (gnu packages curl) + #:use-module (gnu packages networking) + #:use-module (guix utils) + #:use-module (gnu packages pkg-config)) + + +(define-public px-network-inspection + (package + (name "px-network-inspection") + (version "0.0.15") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-network-inspection_" + version + ".tgz")) + (sha256 + (base32 + "0fzcy9f61qz0zi8chb6y86qfsjyn510fkxkxcw66rgxji76b1qx1")))) + (build-system cmake-build-system) + (arguments + `( + #:tests? #f)) + ; #:phases + ; (modify-phases %standard-phases + ; (add-after 'unpack 'fix-source + ; (lambda _ + ; (chdir "../") + ; ))))) + (inputs `( + ("glib" ,glib) + ("curl" ,curl) + ("fping" ,fping) + ("json-c" ,json-c) + ("libnl" ,libnl))) + (native-inputs `( + ("pkg-config" ,pkg-config) + )) + ;(propagated-inputs `( + ; ("fping" ,fping))) + + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Netwrok Inspection") + (description "This package provides network inspection utility tool") + (license license:expat))) diff --git a/px/packages/kde-frameworks.scm b/px/packages/kde-frameworks.scm new file mode 100644 index 0000000..2185dac --- /dev/null +++ b/px/packages/kde-frameworks.scm @@ -0,0 +1,39 @@ +(define-module (px packages kde-frameworks) + #:use-module (guix build-system cmake) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (gnu packages) + #:use-module (gnu packages admin) + #:use-module (gnu packages glib) + #:use-module (gnu packages kde-frameworks) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages qt) + #:use-module (gnu packages xml) + #:use-module (srfi srfi-1)) + +(define-public px-icons + (package + (name "px-icons") + (version "5.70.0-21") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_v" + version + ".tgz")) + (sha256 (base32 "1arkvx0n1gcihm74wx045xrvz75r0zcgcvg13gy69wznzq7p98b9")))) + (build-system cmake-build-system) + (native-inputs + `(("extra-cmake-modules" ,extra-cmake-modules) + ("fdupes" ,fdupes) + ("libxml2" ,libxml2))) + (inputs + `(("qtbase" ,qtbase-5))) + (home-page "https://community.kde.org/Frameworks") + (synopsis "Default PantherX icon theme") + (description "PantherX icons are a fork of KDE Breeze icon theme.") + (license license:lgpl3+))) diff --git a/px/packages/library.scm b/px/packages/library.scm new file mode 100644 index 0000000..5cc08be --- /dev/null +++ b/px/packages/library.scm @@ -0,0 +1,170 @@ +;;; Library Packages Module for PantherX +;;; Author: Hamzeh Nasajpour (h.nasajpour@pantherx.org) +;;; + +(define-module (px packages library) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (guix build-system qt) + #:use-module (guix build-system python) + #:use-module (guix utils) + #:use-module (gnu packages gcc) + #:use-module (gnu packages guile-xyz) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python-science) + #:use-module (gnu packages python-web) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-crypto) + #:use-module (gnu packages qt) + #:use-module (gnu packages web) + #:use-module (px packages common) + #:use-module (px packages python-xyz) + #:use-module ((guix licenses) #:prefix license:)) + +(define-public px-auth-library-cpp + (package + (name "px-auth-library-cpp") + (version "0.0.28") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 (base32 "1q4ll8zdg7hrj0r1spdspp3zl40n69473qjib8c87a69yrr0j0id")))) + (build-system qt-build-system) + (arguments (list #:tests? #f)) + (inputs (list qtbase-5)) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX GUI Library") + (description "GUI Framework for PantherX applications as shared library") + (license license:expat))) + +(define-public px-gui-library + (package + (name "px-gui-library") + (version "0.1.9") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "0205bbj1kz0fpgy93xyq2nvzwh3knvrj89akbwidsgik8dn5w3if")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f)) + (native-inputs + (list qtbase-5 qttools-5)) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX GUI Library") + (description "GUI Framework for PantherX applications as shared library") + (license license:expat))) + +(define-public px-claws-mail-parser + (package + (name "px-claws-mail-parser") + (version "0.2.3") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "0pn74mgbbz4v15dw9bmyb8lcxzknmwqnfy73m6b3vr70n52a528b")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'sanity-check)))) + (inputs + `(("python-pandas" ,python-pandas) + ("python-pylint" ,python-pylint-2.5.3) + ("python-toml" ,python-toml) + ("python-lazy-object-proxy-1.4.0" ,python-lazy-object-proxy-1.4.0) + ("python-ipaddress" ,python-ipaddress) + ("python-wrapt" ,python-wrapt-1.12.1))) + (propagated-inputs + `(("python-simplejson" ,python-simplejson-3.17.0) + ("python-mail-parser" ,python-mail-parser-3.14.0))) + (home-page "https://www.pantherx.org/") + (synopsis "Easy access to various APIs with unified return format.") + (description "This python library provides easy, uniform access to various API ressources, +returning a unified HubMessage array.") + (license license:expat))) + +(define-public px-secret-library-python + (package + (name "px-secret-library-python") + (version "0.0.7") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "0iahzdbwps49bn9pnkiydp0gc8gry82bm8kjyj51mqjrnzr5pvsv")))) + (build-system python-build-system) + (arguments `(#:tests? #f)) + (propagated-inputs + `(("python-secretstorage" ,python-secretstorage))) + (home-page "https://www.pantherx.org/") + (synopsis "Easy access to secret service") + (description "This python library provides easy, uniform access to secret service.") + (license license:expat))) + +(define-public px-lib-rw-guix-config + (package + (name "px-lib-rw-guix-config") + (version "v0.0.8") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-lib-rw-guix-config_" + version + ".tgz")) + (sha256 + (base32 + "1ij68sks9qphr12zpbp3skiqy2nw6jb4sazqmlcqlha7n953dql2")))) + (build-system cmake-build-system) + (arguments + `( + #:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-source + (lambda _ + (chdir "../") + ))))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX config.scm parser/builder library") + (description "This library provides a series of methods for add/remove/get users, service, ... in +config.scm") + (license license:expat))) + +(define-public px-online-sources-library + (package + (name "px-online-sources-library") + (version "0.0.17") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 (base32 "0v5rj1gdq8gi42qpdq0lpgqydqiyx1zj3vfazkvb11mvp94ad3dd")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'sanity-check)))) + (inputs + `(("python-idna" ,python-idna))) + (propagated-inputs + `(("python-etherscan" ,python-etherscan) + ("python-requests" ,python-requests) + ("python-block-io", python-block-io))) + (home-page "https://www.pantherx.org/") + (synopsis "Easy access to various APIs with unified return format.") + (description "This python library provides easy, uniform access to various API ressources, +returning a unified HubMessage array.") + (license license:expat))) + diff --git a/px/packages/linux.scm b/px/packages/linux.scm new file mode 100644 index 0000000..bbb8f09 --- /dev/null +++ b/px/packages/linux.scm @@ -0,0 +1,355 @@ +(define-module (px packages linux) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix build-system copy) + #:use-module (guix build-system gnu) + #:use-module (guix build-system linux-module) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix platform) + #:use-module (guix utils) + #:use-module (gnu packages base) + #:use-module (gnu packages bootloaders) + #:use-module (gnu packages compression) + #:use-module (gnu packages linux) + #:use-module (gnu system) + #:use-module (ice-9 match) + #:use-module (nongnu packages linux) + #:use-module (nonguix licenses) + #:export (%reterminal-kernel-modules)) + + +(define-public brcm80211-firmware + (package + (name "brcm80211-firmware") + (version "20210818-1") + (source (origin + (method url-fetch) + (uri (string-append + "http://ftp.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-brcm80211_" + version "_all.deb")) + (sha256 (base32 "04wg9fqay6rpg80b7s4h4g2kwq8msbh81lb3nd0jj45nnxrdxy7p")))) + (build-system copy-build-system) + (native-inputs (list tar bzip2)) + (arguments + '(#:phases + (modify-phases %standard-phases + (replace 'unpack + (lambda* (#:key inputs #:allow-other-keys) + (let ((source (assoc-ref inputs "source"))) + (invoke "ar" "x" source) + (invoke "ls") + (invoke "tar" "-xvf" "data.tar.xz")))) + (add-after 'install 'make-symlinks + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (symlink (string-append out "/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt") + (string-append out "/lib/firmware/brcm/brcmfmac43455-sdio.txt")) + (symlink (string-append out "/lib/firmware/brcm/brcmfmac43455-sdio.bin") + (string-append out "/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.bin")))))) + #:install-plan + '(("lib/firmware/" "lib/firmware")))) + (home-page "https://packages.debian.org/sid/firmware-brcm80211") + (synopsis "Binary firmware for Broadcom/Cypress 802.11 wireless cards") + (description "This package contains the binary firmware for wireless +network cards supported by the brcmsmac or brcmfmac driver.") + (license license:expat))) + + +(define-public bluez-firmware + (let ((commit "31ad68831357d2019624004f1f0846475671088f") + (revision "1")) + (package + (name "bluez-firmware") + (version (git-version "0.0.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/RPi-Distro/bluez-firmware.git") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "083s9n7kgyqjpr8jk6xw97fszzqpp3ndss3wjxn7c3snl47m9cy2")))) + (build-system copy-build-system) + (arguments + '(#:install-plan + '(("broadcom/BCM4345C0.hcd" "lib/firmware/brcm/BCM4345C0.hcd")))) + (home-page "https://github.com/RPi-Distro/bluez-firmware") + (synopsis "Bluetooth firmware") + (description "BlueZ - Bluetooth protocol stack for Linux") + (license license:expat)))) + + +(define-public linux-px + (corrupt-linux linux-libre-5.15)) + +(define-public linux-firmware-px + (package + (inherit linux-firmware) + (name "linux-firmware") + (version "20210919"))) + + +(define (config->string options) + (string-join (map (match-lambda + ((option . 'm) + (string-append option "=m")) + ((option . #t) + (string-append option "=y")) + ((option . #f) + (string-append option "=n"))) + options) + "\n")) + +(define %default-extra-linux-options + `(;; Some very mild hardening. + ("CONFIG_SECURITY_DMESG_RESTRICT" . #t) + ;; All kernels should have NAMESPACES options enabled + ("CONFIG_NAMESPACES" . #t) + ("CONFIG_UTS_NS" . #t) + ("CONFIG_IPC_NS" . #t) + ("CONFIG_USER_NS" . #t) + ("CONFIG_PID_NS" . #t) + ("CONFIG_NET_NS" . #t) + ;; Various options needed for elogind service: + ;; https://issues.guix.gnu.org/43078 + ("CONFIG_CGROUP_FREEZER" . #t) + ("CONFIG_BLK_CGROUP" . #t) + ("CONFIG_CGROUP_WRITEBACK" . #t) + ("CONFIG_CGROUP_SCHED" . #t) + ("CONFIG_CGROUP_PIDS" . #t) + ("CONFIG_CGROUP_FREEZER" . #t) + ("CONFIG_CGROUP_DEVICE" . #t) + ("CONFIG_CGROUP_CPUACCT" . #t) + ("CONFIG_CGROUP_PERF" . #t) + ("CONFIG_SOCK_CGROUP_DATA" . #t) + ("CONFIG_BLK_CGROUP_IOCOST" . #t) + ("CONFIG_CGROUP_NET_PRIO" . #t) + ("CONFIG_CGROUP_NET_CLASSID" . #t) + ("CONFIG_MEMCG" . #t) + ("CONFIG_MEMCG_SWAP" . #t) + ("CONFIG_MEMCG_KMEM" . #t) + ("CONFIG_CPUSETS" . #t) + ("CONFIG_PROC_PID_CPUSET" . #t) + ;; Allow disk encryption by default + ("CONFIG_DM_CRYPT" . m) + ;; Modules required for initrd: + ("CONFIG_NET_9P" . m) + ("CONFIG_NET_9P_VIRTIO" . m) + ("CONFIG_VIRTIO_BLK" . m) + ("CONFIG_VIRTIO_NET" . m) + ("CONFIG_VIRTIO_PCI" . m) + ("CONFIG_VIRTIO_BALLOON" . m) + ("CONFIG_VIRTIO_MMIO" . m) + ("CONFIG_FUSE_FS" . m) + ("CONFIG_CIFS" . m) + ("CONFIG_9P_FS" . m))) + +(define-public linux-raspberry-5.15 + (package + (inherit linux-libre-5.15) + (name "linux-raspberry") + (version "5.15.32") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/raspberrypi/linux") + (commit "1.20220331"))) + (file-name (string-append "linux-" version)) + (sha256 + (base32 + "1k18cwnsqdy5ckymy92kp8czckzwgn8wn2zdibzrrg9jxrflx6vl")))) + (supported-systems '("aarch64-linux")) + (arguments + (substitute-keyword-arguments (package-arguments linux-libre-5.15) + ((#:phases phases) + #~(modify-phases #$phases + + (replace 'configure + (lambda* (#:key inputs target #:allow-other-keys) + ;; Avoid introducing timestamps + (setenv "KCONFIG_NOTIMESTAMP" "1") + (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH")) + + ;; Other variables useful for reproducibility. + (setenv "KBUILD_BUILD_USER" "guix") + (setenv "KBUILD_BUILD_HOST" "guix") + + ;; Set ARCH and CROSS_COMPILE. + (let ((arch #$(platform-linux-architecture + (lookup-platform-by-target-or-system + (or (%current-target-system) + (%current-system)))))) + (setenv "ARCH" arch) + (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")) + + (when target + (setenv "C_INCLUDE_PATH" (string-join + (cdr (string-split (getenv "C_INCLUDE_PATH") #\:)) + ":")) + + (setenv "CPLUS_INCLUDE_PATH" (string-join + (cdr (string-split (getenv "CPLUS_INCLUDE_PATH") #\:)) + ":")) + + (setenv "LIBRARY_PATH" (string-join + (cdr (string-split (getenv "LIBRARY_PATH") #\:)) + ":")) + (setenv "CROSS_COMPILE" (string-append target "-")) + (format #t "`CROSS_COMPILE' set to `~a'~%" + (getenv "CROSS_COMPILE")))) + (setenv "KERNEL" "kernel8") + (invoke "make" "bcm2711_defconfig") + (let ((port (open-file ".config" "a")) + (extra-configuration #$(config->string %default-extra-linux-options))) + (display extra-configuration port) + (close-port port)) + + )))))))) + +;;; +;;; reTerminal related modules +;;; + +(define-public bq24179-charger-linux-module + (package + (name "bq24179-charger-linux-module") + (version "0.1") + (source + (file-append + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Seeed-Studio/seeed-linux-dtoverlays.git") + (commit "589dab165f7a55eec0cc5fa25cc0bf892f4aa52c"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "002y8x0dmglhfgm60az6059jjnfm5q1zxdfp0b4s8dqybhjbdhb5"))) + "/modules/bq24179_charger")) + (build-system linux-module-build-system) + (arguments + (list #:tests? #f #:linux linux-raspberry-5.15)) ; no test suite, RPI Linux + (home-page "https://github.com/Seeed-Studio/seeed-linux-dtoverlays/tree/master/modules/bq24179_charger") + (synopsis "Linux kernel module for bq24179_charger found in Seeed Studio ReTerminal") + (description "This is the Linux kernel bq24179_charger driver") + (license license:gpl2))) + +(define-public lis3lv02d-linux-module + (package + (name "lis3lv02d-linux-module") + (version "0.1") + (source + (file-append + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Seeed-Studio/seeed-linux-dtoverlays.git") + (commit "589dab165f7a55eec0cc5fa25cc0bf892f4aa52c"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "002y8x0dmglhfgm60az6059jjnfm5q1zxdfp0b4s8dqybhjbdhb5"))) + "/modules/lis3lv02d")) + (build-system linux-module-build-system) + (arguments + (list #:tests? #f #:linux linux-raspberry-5.15)) ; no test suite, RPI Linux + (home-page "https://github.com/Seeed-Studio/seeed-linux-dtoverlays/tree/master/modules/lis3lv02d") + (synopsis "Linux kernel module for GROVE 3-Axis Digital Accelerometer found in Seed Studio ReTerminal") + (description "This is the Linux kernel GROVE 3-Axis Digital Accelerometer driver") + (license license:gpl2))) + +(define-public ltr30x-linux-module + (package + (name "ltr30x-linux-module") + (version "0.1") + (source + (file-append + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Seeed-Studio/seeed-linux-dtoverlays.git") + (commit "589dab165f7a55eec0cc5fa25cc0bf892f4aa52c"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "002y8x0dmglhfgm60az6059jjnfm5q1zxdfp0b4s8dqybhjbdhb5"))) + "/modules/ltr30x")) + (build-system linux-module-build-system) + (arguments + (list #:tests? #f #:linux linux-raspberry-5.15)) ; no test suite, RPI Linux + (home-page "https://github.com/Seeed-Studio/seeed-linux-dtoverlays/tree/master/modules/ltr30x") + (synopsis "Linux kernel module for ltr30x ambient light and proximity sensor found in Seed Studio ReTerminal") + (description "This is the Linux kernel ltr30x ambient light and proximity sensor driver") + (license license:gpl2))) + +(define-public mipi_dsi-linux-module + (package + (name "mipi_dsi-linux-module") + (version "0.1") + (source + (file-append + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Seeed-Studio/seeed-linux-dtoverlays.git") + (commit "589dab165f7a55eec0cc5fa25cc0bf892f4aa52c"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "002y8x0dmglhfgm60az6059jjnfm5q1zxdfp0b4s8dqybhjbdhb5"))) + "/modules/mipi_dsi")) + (build-system linux-module-build-system) + (arguments + (list #:tests? #f #:linux linux-raspberry-5.15)) ; no test suite, RPI Linux + (home-page "https://github.com/Seeed-Studio/seeed-linux-dtoverlays/tree/master/modules/mipi_dsi") + (synopsis "Linux kernel module for MIPI-DSI panel with touch panel attached to I2C bus found in Seed Studio ReTerminal") + (description "This is a linux kernel driver for MIPI-DSI panel with touch panel attached to I2C bus.") + (license license:gpl2))) + +(define-public seeed-reterminal-dtoverlays + (package + (name "seeed-reterminal-dtoverlays") + (version "1.9") + (license license:gpl2) + (source + (file-append + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Seeed-Studio/seeed-linux-dtoverlays.git") + (commit "589dab165f7a55eec0cc5fa25cc0bf892f4aa52c"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "002y8x0dmglhfgm60az6059jjnfm5q1zxdfp0b4s8dqybhjbdhb5"))) + "/overlays/rpi")) + (build-system gnu-build-system) + (arguments + '(#:phases (modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'set-prefix-in-makefile + (lambda* (#:key outputs #:allow-other-keys) + ;; Modify the makefile so that its + ;; 'DEST' variable points to "out". + (let ((out (assoc-ref outputs "out"))) + (substitute* "Makefile" + (("DEST :=.*") + (string-append "DEST := " + out "\n"))) + #true)) + ) + (add-before 'install 'create-dir + (lambda* (#:key outputs #:allow-other-keys) + (mkdir-p (assoc-ref outputs "out"))) + ) + ) #:tests? #f)) + (native-inputs `(("dtc" ,dtc))) + (synopsis "Device Tree overlays for Seed Studio ReTerminal") + (description + "Device Tree overlays for Seed Studio ReTerminal") + (home-page "https://github.com/Seeed-Studio/seeed-linux-dtoverlays/"))) + + +(define %reterminal-kernel-modules + (list bq24179-charger-linux-module + lis3lv02d-linux-module + ltr30x-linux-module + mipi_dsi-linux-module)) diff --git a/px/packages/log.scm b/px/packages/log.scm new file mode 100644 index 0000000..67719d3 --- /dev/null +++ b/px/packages/log.scm @@ -0,0 +1,65 @@ +(define-module (px packages log) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix build-system cargo) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix git-download) + #:use-module (guix build-system go) + #:use-module (gnu packages) + #:use-module (gnu packages crates-io) + #:use-module (gnu packages tls) + #:use-module (px packages crates-io)) + + +(define-public remote_syslog2 + (package + (name "remote_syslog2") + (version "0.20") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/papertrail/remote_syslog2/archive/refs/tags/v" version ".tar.gz")) + (sha256 + (base32 + "09mrg6kxxrghhqg3ci8ryad9qixrdifiynffcxn01pgb0hkf3lg8")))) + (build-system go-build-system) + (arguments + '(#:tests? #f + #:import-path "github.com/papertrail/remote_syslog2")) + (home-page "https://www.papertrailapps.com/") + (synopsis "Remote_syslog tails") + (description "Remote_syslog tails one or more log files and sends syslog messages to a remote central syslog server. +It generates packets itself, ignoring the system syslog daemon, so its configuration doesn't affect system-wide logging.") + (license license:expat))) + + +(define-public loggily + (package + (name "loggily") + (version "0.0.2") + (source (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" + name "-" version ".crate")) + (file-name + (string-append name "-" version ".tar.gz")) + (sha256 (base32 "1z0008ydim1x9z7gbn87zrng8ykyh0hpasvzfxyx4r48a6mw98ra")))) + (build-system cargo-build-system) + (arguments + `(#:tests? #f + #:cargo-inputs + (("rust-chrono" ,rust-chrono-0.4) + ("rust-clap" ,rust-clap-3) + ("rust-openssl" ,rust-openssl-0.10) + ("rust-postgres" ,rust-postgres-0.19) + ("rust-regex" ,rust-regex-1) + ("rust-xmlrpc" ,rust-xmlrpc-0.15) + ("rust-serde" ,rust-serde-1) + ("rust-serde-json" ,rust-serde-json-1) + ("rust-serde-yaml" ,rust-serde-yaml-0.8)))) + (inputs (list openssl)) + (home-page "https://pantherx.org") + (synopsis "A simple logging library for Rust") + (description "A simple logging library for Rust") + (license license:expat))) diff --git a/px/packages/lxqt-dev.scm b/px/packages/lxqt-dev.scm new file mode 100644 index 0000000..0dc70ae --- /dev/null +++ b/px/packages/lxqt-dev.scm @@ -0,0 +1,117 @@ +(define-module (px packages lxqt-dev) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (guix build-system cmake) + #:use-module (guix build-system gnu) + #:use-module (guix build-system trivial) + #:use-module (gnu packages) + #:use-module (gnu packages admin) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) + #:use-module (gnu packages documentation) + #:use-module (gnu packages compton) + #:use-module (gnu packages fonts) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages gtk) + #:use-module (gnu packages image) + #:use-module (gnu packages kde-frameworks) + #:use-module (gnu packages kde-plasma) + #:use-module (gnu packages linux) + #:use-module (gnu packages lxqt) + #:use-module (gnu packages perl) + #:use-module (gnu packages lxde) + #:use-module (gnu packages lxqt) + #:use-module (gnu packages maths) + #:use-module (gnu packages openbox) + #:use-module (gnu packages pcre) + #:use-module (gnu packages perl) + #:use-module (gnu packages photo) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages polkit) + #:use-module (gnu packages pulseaudio) + #:use-module (gnu packages qt) + #:use-module (gnu packages textutils) + #:use-module (gnu packages xdisorg) + #:use-module (gnu packages xml) + #:use-module (gnu packages xorg) + #:use-module (px packages themes) + #:use-module (srfi srfi-1)) + +(define-public lxqt-config-dev + (let ((rep_name "lxqt-config") + (commit "5365be813f9c43e8fa6ed6a42f30744cf043980a") + (revision "0")) + (package + (inherit lxqt-config) + (name "lxqt-config-dev") + (version (git-version "1.1.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url (string-append "https://github.com/lxqt/" rep_name ".git")) + (commit commit))) + (file-name (git-file-name name version)) + (sha256 (base32 "1wx186nq7hihywm7dn3w4p31zyplg3kr11aav4maivv14dw9k17k")))) + (inputs + `(("eudev" ,eudev) + ("kwindowsystem" ,kwindowsystem) + ("libkscreen" ,libkscreen) + ("liblxqt" ,liblxqt) + ("libqtxdg" ,libqtxdg) + ("libxcursor" ,libxcursor) + ("libxi" ,libxi) + ("perl" ,perl) + ("qtbase" ,qtbase-5) + ("qtsvg" ,qtsvg-5) + ("qtx11extras" ,qtx11extras) + ("solid" ,solid) + ("xf86-input-libinput" ,xf86-input-libinput) + ("xkeyboard-config" ,xkeyboard-config) + ("zlib" ,zlib))) + (native-inputs + (list pkg-config lxqt-build-tools qttools-5)) + (propagated-inputs + `( + ;; temporary workaround for lxqt-config-monitor segmentation fault + ;; more in https://git.pantherx.org/development/guix-pantherx/-/issues/67 + ("libkscreen" ,libkscreen) + ("setxkbmap" ,setxkbmap))) + (arguments + '(#:tests? #f ; no tests + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-source + (lambda _ + (substitute* '("src/translations/lxqt-config.desktop.yaml") + (("LXQt Configuration Center") + "All Settings")) + (substitute* '("src/lxqt-config.menu") + (("<Name>System settings</Name>") + (string-append "<Name>PantherX settings</Name>" + "\n\t<Directory>lxqt-settings-pantherx.directory</Directory>" + "\n\t<Include>" + "\n\t\t<And>" + "\n\t\t\t<Category>Settings</Category>" + "\n\t\t\t<Category>PantherX</Category>" + "\n\t\t</And>" + "\n\t</Include>" + "\n</Menu>" + "\n\n<Menu>" + "\n\t<Name>System settings</Name>"))) + #t)) + (add-after 'unpack 'set-xkeyboard-config-file-name + (lambda* (#:key inputs #:allow-other-keys) + ;; Set the file name to xkeyboard-config. + (let ((xkb (assoc-ref inputs "xkeyboard-config"))) + (substitute* "lxqt-config-input/keyboardlayoutconfig.h" + (("/usr/share/X11/xkb/rules/base.lst") + (string-append xkb "/share/X11/xkb/rules/base.lst"))) + #t))) + ))) + ))) diff --git a/px/packages/machine-learning.scm b/px/packages/machine-learning.scm new file mode 100644 index 0000000..0d104a6 --- /dev/null +++ b/px/packages/machine-learning.scm @@ -0,0 +1,133 @@ +(define-module (px packages machine-learning) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (guix download) + #:use-module (guix svn-download) + #:use-module (guix build-system cmake) + #:use-module (guix build-system gnu) + #:use-module (guix build-system ocaml) + #:use-module (guix build-system python) + #:use-module (guix build-system r) + #:use-module (guix git-download) + #:use-module (gnu packages) + #:use-module (gnu packages adns) + #:use-module (gnu packages algebra) + #:use-module (gnu packages audio) + #:use-module (gnu packages autotools) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages boost) + #:use-module (gnu packages check) + #:use-module (gnu packages compression) + #:use-module (gnu packages cran) + #:use-module (gnu packages databases) + #:use-module (gnu packages dejagnu) + #:use-module (gnu packages gcc) + #:use-module (gnu packages glib) + #:use-module (gnu packages graphviz) + #:use-module (gnu packages gstreamer) + #:use-module (gnu packages image) + #:use-module (gnu packages linux) + #:use-module (gnu packages maths) + #:use-module (gnu packages mpi) + #:use-module (gnu packages ocaml) + #:use-module (gnu packages onc-rpc) + #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages protobuf) + #:use-module (gnu packages python) + #:use-module (gnu packages python-science) + #:use-module (gnu packages python-web) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages rpc) + #:use-module (gnu packages serialization) + #:use-module (gnu packages sphinx) + #:use-module (gnu packages statistics) + #:use-module (gnu packages sqlite) + #:use-module (gnu packages swig) + #:use-module (gnu packages web) + #:use-module (gnu packages xml) + #:use-module (gnu packages xorg) + #:use-module (ice-9 match)) + +(define-public dlib + (package + (name "dlib") + (version "19.21") + (source (origin + (method url-fetch) + (uri (string-append + "http://dlib.net/files/dlib-" version ".tar.bz2")) + (sha256 + (base32 + "0g7mgm6l6nw9hlw2zckf59jcd2y2lf907n88hjschkccmq1qlwmy")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Delete ~13MB of bundled dependencies. + (delete-file-recursively "dlib/external") + (delete-file-recursively "docs/dlib/external") + #t)))) + (build-system cmake-build-system) + (arguments + `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'disable-asserts + (lambda _ + ;; config.h recommends explicitly enabling or disabling asserts + ;; when building as a shared library. By default neither is set. + (substitute* "dlib/config.h" + (("^//#define DLIB_DISABLE_ASSERTS") "#define DLIB_DISABLE_ASSERTS")) + #t)) + (add-after 'disable-asserts 'disable-failing-tests + (lambda _ + ;; One test times out on MIPS, so we need to disable it. + ;; Others are flaky on some platforms. + (let* ((system ,(or (%current-target-system) + (%current-system))) + (disabled-tests (cond + ((string-prefix? "mips64" system) + '("object_detector" ; timeout + "data_io")) + ((string-prefix? "armhf" system) + '("learning_to_track")) + ((string-prefix? "i686" system) + '("optimization")) + (else '())))) + (for-each + (lambda (test) + (substitute* "dlib/test/makefile" + (((string-append "SRC \\+= " test "\\.cpp")) ""))) + disabled-tests) + #t))) + (replace 'check + (lambda _ + ;; No test target, so we build and run the unit tests here. + (let ((test-dir (string-append "../dlib-" ,version "/dlib/test"))) + (with-directory-excursion test-dir + (invoke "make" "-j" (number->string (parallel-job-count))) + (invoke "./dtest" "--runall")) + #t)))))) + (native-inputs + `(("pkg-config" ,pkg-config) + ;; For tests. + ("libnsl" ,libnsl))) + (inputs + `(("giflib" ,giflib) + ("lapack" ,lapack) + ("libjpeg" ,libjpeg-turbo) + ("libpng" ,libpng) + ("libx11" ,libx11) + ("openblas" ,openblas) + ("zlib" ,zlib))) + (synopsis + "Toolkit for making machine learning and data analysis applications in C++") + (description + "Dlib is a modern C++ toolkit containing machine learning algorithms and +tools. It is used in both industry and academia in a wide range of domains +including robotics, embedded devices, mobile phones, and large high performance +computing environments.") + (home-page "http://dlib.net") + (license license:boost1.0))) diff --git a/px/packages/mastodon.scm b/px/packages/mastodon.scm new file mode 100644 index 0000000..d53bb7a --- /dev/null +++ b/px/packages/mastodon.scm @@ -0,0 +1,82 @@ +;;; Mastodon Packages Module for PantherX +;;; Author: Fakhri Sajadi (f.sajadi@pantherx.org) +;;; + +(define-module (px packages mastodon) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (guix build-system trivial) + #:use-module (guix utils) + #:use-module (gnu packages compression) + #:use-module (guix git-download) + #:use-module (px packages common) + #:use-module (gnu packages networking) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages curl) + #:use-module (gnu packages web) + #:use-module (gnu packages documentation) + #:use-module (gnu packages tls) + #:use-module (gnu packages serialization) + #:use-module (px packages common) + #:use-module (px packages networking)) + +(define-public mastodonpp + (package + (name "mastodonpp") + (version "0.5.7") + (source + (origin + (method url-fetch) + (uri (string-append + "https://schlomp.space/tastytea/mastodonpp/archive/" version ".tar.gz")) + (sha256 + (base32 + "1vga22c85r86hidvfqysfj01d2y6w69m9rkmc1nsr8ffglcw83qy")))) + (build-system cmake-build-system) + (arguments + `( + #:tests? #f)) + (inputs `( + ("curl" ,curl))) + (native-inputs `( + ("pkg-config" ,pkg-config))) + (home-page "https://schlomp.space/tastytea/mastodonpp") + (synopsis "C++ library for working with Mastodon REST API") + (description "Mastodonpp is a C++ wrapper for the Mastodon API. +You submit an API call and get the raw JSON that you can then transform into easy to use abstractions.") + (license license:expat))) + +(define-public px-mastodon-service + (package + (name "px-mastodon-service") + (version "0.3.6") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-mastodon-service_v" version ".tgz")) + (sha256 + (base32 + "0v7qmimrxqk4d3c4x3f7lmxf976bb099xyrqn1wg6ypsm6myf04d")))) + (build-system cmake-build-system) + (arguments + `( + #:tests? #f)) + (inputs `( + ("mastodonpp" ,mastodonpp) + ("rapidjson" ,rapidjson) + ("yaml-cpp", yaml-cpp) + ("openssl" ,openssl) + ("curl" ,curl) + ("nng" ,nng-1.5) + ("zlib", zlib) + ("capnproto", capnproto-0.9))) + (native-inputs `( + ("pkg-config" ,pkg-config) + )) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Mastodon Management Service") + (description "A Mastodon API.") + (license license:expat))) diff --git a/px/packages/matrix-client.scm b/px/packages/matrix-client.scm new file mode 100644 index 0000000..f6cd57f --- /dev/null +++ b/px/packages/matrix-client.scm @@ -0,0 +1,263 @@ +(define-module (px packages matrix-client) + #:use-module (gnu packages) + #:use-module (gnu packages audio) + #:use-module (gnu packages autotools) + #:use-module (gnu packages base) + #:use-module (gnu packages boost) + #:use-module (gnu packages build-tools) + #:use-module (gnu packages check) + #:use-module (gnu packages cmake) + #:use-module (gnu packages compression) + #:use-module (gnu packages cpp) + #:use-module (gnu packages crypto) + #:use-module (gnu packages curl) + #:use-module (gnu packages databases) + #:use-module (gnu packages documentation) + #:use-module (gnu packages enchant) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages gcc) + #:use-module (gnu packages gstreamer) + #:use-module (gnu packages graphviz) + #:use-module (gnu packages image) + #:use-module (gnu packages libevent) + #:use-module (gnu packages logging) + #:use-module (gnu packages markup) + #:use-module (gnu packages messaging) + #:use-module (gnu packages networking) + #:use-module (gnu packages ninja) + #:use-module (gnu packages pulseaudio) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages serialization) + #:use-module (gnu packages qt) + #:use-module (gnu packages tls) + #:use-module (gnu packages xorg) + #:use-module (px packages aidc) + #:use-module (px packages accounts) + #:use-module (px packages gstreamer) + #:use-module (px packages common) + #:use-module (guix build-system cmake) + #:use-module (guix build-system gnu) + #:use-module (guix build-system meson) + #:use-module (guix build-system qt) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (px packages library) + #:use-module (srfi srfi-1)) + +(define-public qmtxclient + (package + (name "qmtxclient") + (version "0.8.2-4") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 + (base32 + "07fc46a4nqs509i8biqb6ys74sgj0rdzwpvn7kfk6xf4gv172csn")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f)) + (inputs + (list boost + qtbase-5 + json-modern-cxx + libevent + libolm + libsodium + openssl + spdlog + zlib)) + (native-inputs + (list pkg-config)) + (home-page "https://git.pantherx.org/development/libraries/qmtxclient") + (synopsis "Client API library for Matrix forked from mtxclient, replacing the network layer with Qt") + (description "Client API library for Matrix forked from mtxclient, replacing the network layer with Qt.") + (license license:expat))) + +(define-public matrix-client-library + (package + (name "matrix-client-library") + (version "0.1.36") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 + (base32 + "1x5788zky49cw981gvlsyxypm7vc74950p7n2bf66l4mby8cgp0q")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-source + (lambda* (#:key inputs #:allow-other-keys) + (let ((pulseaudio (assoc-ref inputs "pulseaudio"))) + (substitute* "src/voip/AudioDevices.cpp" (("pactl") (string-append pulseaudio "/bin/pactl"))) + (substitute* "src/voip/AudioDeviceControl.cpp" (("pacmd") (string-append pulseaudio "/bin/pacmd"))) + #t)))))) + (inputs + `(("cmark" ,cmark) + ("gst-plugins-base" ,gst-plugins-base) + ("gst-plugins-bad" ,gst-plugins-bad) ; sdp & webrtc for voip + ("gst-plugins-good-qmlgl" ,gst-plugins-good-qmlgl) ; rtpmanager for voip (using good plugins with qmlgl) + ("json-modern-cxx" ,json-modern-cxx) + ("libevent" ,libevent) + ("libnice" ,libnice) ; for voip + ("libolm" ,libolm) + ("lmdb" ,lmdb) + ("lmdbxx" ,lmdbxx) + ("qmtxclient" ,qmtxclient) + ("openssl" ,openssl) + ("pulseaudio" ,pulseaudio) + ("qtbase" ,qtbase-5) + ("qtdeclarative" ,qtdeclarative-5) + ("qtmultimedia" ,qtmultimedia-5) + ("qtquickcontrols2" ,qtquickcontrols2-5) + ("qtsvg" ,qtsvg-5) + ("spdlog" ,spdlog) + ("zlib" ,zlib) + )) + (native-inputs + `( + ("pkg-config" ,pkg-config) + )) + (home-page "https://git.pantherx.org/development/libraries/matrix-client-library") + (synopsis "Client library for Matrix using Qt and C++17") + (description "Provide a library for using the Matrix protocol that +feels more like a mainstream chat app and less like an IRC client. +Many matrix features are supported, including user registration, rooms, typing +notification, emojis, E2E encryption, and voip calls.") + (license license:gpl3+))) + +(define-public matrix-client-library-with-ciba + (package + (inherit matrix-client-library) + (name "matrix-client-library-with-ciba") + (arguments + `(#:configure-flags '("-DCIBA_AUTHENTICATION=ON") + ,@(package-arguments matrix-client-library))) + (inputs + `(("px-auth-library-cpp" ,px-auth-library-cpp) + ,@(package-inputs matrix-client-library))))) + +(define-public px-matrix-client-library-with-ciba + (package + (inherit matrix-client-library-with-ciba) + (name "px-matrix-client-library-with-ciba") + (arguments + `(#:configure-flags '("-DCIBA_AUTHENTICATION=ON" "-DPX_ACCOUNTS_INTEGRATION=ON") + ,@(package-arguments matrix-client-library))) + (inputs + `(("capnproto" ,capnproto-0.9) + ("px-accounts-matrix-bridge" ,px-accounts-matrix-bridge) + ,@(package-inputs matrix-client-library-with-ciba))))) + +(define-public matrix-client-gui-library + (package + (name "matrix-client-gui-library") + (version "0.1.47") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/matrix-client_" version ".tgz")) + (sha256 + (base32 "0jih113f8flbkfcy46v1jymgc87xik4w16marl5vsyyca0r57zm0")))) + (arguments + `(#:tests? #f ; no tests + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "MatrixClientLib.pro" + (("/usr") (assoc-ref outputs "out"))) + (invoke "qmake" "MatrixClientLib.pro" )))))) + (build-system qt-build-system) + (inputs + (list blurhash + json-modern-cxx + libevent + libolm + lmdb + lmdbxx + matrix-client-library-with-ciba + px-auth-library-cpp + qmtxclient + openssl + pulseaudio + qtbase-5 + qtdeclarative-5 + qtgraphicaleffects + qtlocation + qtmultimedia-5 + qtquickcontrols-5 + qtquickcontrols2-5 + qtsvg-5 + scodes + spdlog + xcb-util-wm + zlib + zxing-cpp-08978e2)) + (propagated-inputs (list + libnice ; for voip + gst-plugins-good-qmlgl ; rtpmanager for voip + gst-plugins-base + gst-plugins-bad ; sdp & webrtc for voip + )) + (native-inputs + (list pkg-config qttools-5)) + (home-page "") + (synopsis "") + (description "") + (license license:gpl3+))) + +(define-public matrix-client-gui + (package + (inherit matrix-client-gui-library) + (name "matrix-client-gui") + (arguments + `(#:tests? #f ; no tests + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "MatrixClientApp.pro" + (("/usr") (assoc-ref outputs "out"))) + (substitute* "configurations/configurations.pri" + (("/usr") (assoc-ref outputs "out"))) + (invoke "qmake" "MatrixClientApp.pro" )))))) + (inputs + `(("px-matrix-client-library-with-ciba" ,px-matrix-client-library-with-ciba) + ("px-auth-library-cpp" ,px-auth-library-cpp) + ("px-accounts-matrix-bridge" ,px-accounts-matrix-bridge) + ("capnproto" ,capnproto-0.9) + ,@(fold alist-delete (package-inputs matrix-client-gui-library) + '("matrix-client-library")))))) + +(define-public matrix-client-call-auto-accept + (package + (inherit matrix-client-gui-library) + (name "matrix-client-call-auto-accept") + (version "0.0.6") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 + (base32 "1akp97llxg0hb6f6jpjhx8sbwpcl17zpsqvxalwaaa8c69ygr9ss")))) + (build-system qt-build-system) + (arguments + `(#:tests? #f)) + (inputs + `(("matrix-client-gui-library" ,matrix-client-gui-library) + ,@(package-inputs matrix-client-gui-library))) + )) diff --git a/px/packages/matrix.scm b/px/packages/matrix.scm new file mode 100644 index 0000000..fdcb530 --- /dev/null +++ b/px/packages/matrix.scm @@ -0,0 +1,81 @@ +(define-module (px packages matrix) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages check) + #:use-module (gnu packages databases) + #:use-module (gnu packages matrix) + #:use-module (gnu packages monitoring) + #:use-module (gnu packages python-crypto) + #:use-module (gnu packages python-web) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages python-build) + #:use-module (gnu packages xml) + #:use-module (guix build-system python) + #:use-module (guix download) + #:use-module (guix packages)) + +(define-public synapse + (package + (name "synapse") + (version "1.45.1") + (source (origin + (method url-fetch) + (uri (pypi-uri "matrix-synapse" version)) + (sha256 + (base32 + "0dmps93cy4b2g73kxvbnsnci1vxj38m2jcaqyxrb9ind0rsik5zi")))) + (build-system python-build-system) + ;; TODO Run tests with ‘PYTHONPATH=. trial3 tests’. + (propagated-inputs + `(("python-simplejson" ,python-simplejson) ; not attested but required + ;; requirements (synapse/python_dependencies.py) + ("python-jsonschema" ,python-jsonschema) + ("python-frozendict" ,python-frozendict) + ("python-unpaddedbase64" ,python-unpaddedbase64) + ("python-canonicaljson" ,python-canonicaljson) + ("python-signedjson" ,python-signedjson) + ("python-pynacl" ,python-pynacl) + ("python-idna" ,python-idna) + ("python-service-identity" ,python-service-identity) + ("python-twisted" ,python-twisted) + ("python-treq" ,python-treq) + ("python-pyopenssl" ,python-pyopenssl) + ("python-pyyaml" ,python-pyyaml) + ("python-pyasn1" ,python-pyasn1) + ("python-pyasn1-modules" ,python-pyasn1-modules) + ("python-daemonize" ,python-daemonize) + ("python-bcrypt" ,python-bcrypt) + ("python-pillow" ,python-pillow) + ("python-sortedcontainers" ,python-sortedcontainers) + ("python-pymacaroons" ,python-pymacaroons) + ("python-msgpack" ,python-msgpack) + ("python-phonenumbers" ,python-phonenumbers) + ("python-six" ,python-six) + ("python-prometheus-client" ,python-prometheus-client) + ("python-attrs" ,python-attrs) + ("python-netaddr" ,python-netaddr) + ("python-jinja2" ,python-jinja2) + ("python-bleach" ,python-bleach) + ("python-typing-extensions" ,python-typing-extensions) + ;; conditional requirements (synapse/python_dependencies.py) + ;;("python-hiredis" ,python-hiredis) + ("python-matrix-synapse-ldap3" ,python-matrix-synapse-ldap3) + ("python-psycopg2" ,python-psycopg2) + ("python-jinja2" ,python-jinja2) + ("python-txacme" ,python-txacme) + ("python-pysaml2" ,python-pysaml2) + ("python-lxml" ,python-lxml) + ("python-packaging" ,python-packaging) + ;; sentry-sdk, jaeger-client, and opentracing could be included, but + ;; all are monitoring aids and not essential. + ("python-pyjwt" ,python-pyjwt))) + (native-inputs + `(("python-mock" ,python-mock) + ("python-parameterized" ,python-parameterized))) + (home-page "https://github.com/matrix-org/synapse") + (synopsis "Matrix reference homeserver") + (description "Synapse is a reference \"homeserver\" implementation of +Matrix from the core development team at matrix.org, written in +Python/Twisted. It is intended to showcase the concept of Matrix and let +folks see the spec in the context of a codebase and let you run your own +homeserver and generally help bootstrap the ecosystem.") + (license license:asl2.0))) diff --git a/px/packages/monitoring.scm b/px/packages/monitoring.scm new file mode 100644 index 0000000..cd71373 --- /dev/null +++ b/px/packages/monitoring.scm @@ -0,0 +1,108 @@ +;;; Author: Fakhri Sajadi (f.sajadi@pantherx.org) +;;; + +(define-module (px packages monitoring) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system gnu) + #:use-module (guix build-system cmake) + #:use-module (guix build-system python) + #:use-module (guix utils) + #:use-module (gnu packages autotools) + #:use-module (gnu packages gnome) + #:use-module (gnu packages base) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages compression) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages compression) + #:use-module (gnu packages sqlite) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages qt) + #:use-module (gnu packages serialization) + #:use-module (gnu packages curl) + #:use-module (gnu packages linux) + #:use-module (px packages common) + #:use-module (px packages device) + #:use-module (px packages library)) + +(define-public monit + (package + (name "monit") + (version "5.25.3") + (source + (origin + (method url-fetch) + (uri (string-append + "https://mmonit.com/monit/dist/monit-" + version + ".tar.gz")) + (sha256 + (base32 + "0s8577ixcmx45b081yx6cw54iq7m5yzpq3ir616qc84xhg45h0n1")))) + (build-system gnu-build-system) + (arguments + `( + #:configure-flags '("--without-pam" "--without-ssl") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-source + (lambda _ + (invoke "ls" "-la") + ))))) + (inputs `( + ("zlib", zlib))) + + (native-inputs `( + ("autoconf", autoconf) + ("automake", automake) + ("libtool" ,libtool) + ("pkg-config", pkg-config) + )) + (home-page "https://mmonit.com") + (synopsis "Pro-active Monitoring") + (description "M/Monit can monitor and manage distributed computer systems, conduct automatic maintenance and repair and execute meaningful causal actions in error situations.") + (license license:expat))) + +(define-public px-org-remote-status-service + (package + (name "px-org-remote-status-service") + (version "0.3.3") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-org-remote-status-service_v" + version ".tgz" + )) + (sha256 + (base32 + "005n1vvsq25bm1axkhs1vvyzclgabqlkymzlsvjkci2bvv0iya89")))) + (build-system cmake-build-system) + (arguments + `( + #:tests? #f)) + (inputs + `(("sqlite", sqlite) + ("curl", curl) + ("restclient-cpp", restclient-cpp) + ("zlib", zlib) + ("yaml-cpp", yaml-cpp) + ("qtbase" ,qtbase-5) + ("capnproto", capnproto) + ("px-auth-library-cpp" ,px-auth-library-cpp))) + (native-inputs + `(("pkg-config", pkg-config))) + (propagated-inputs + `(("monit", monit) + ("sysstat", sysstat) + ("lshw", lshw) + ("coreutils", coreutils) + ("curl", curl) + ("util-linux+udev", util-linux+udev) + ("px-device-identity" ,px-device-identity))) + + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Remote Status Monitoring Service") + (description "This package provides background services to show status ") + (license license:expat))) diff --git a/px/packages/multimedia.scm b/px/packages/multimedia.scm new file mode 100644 index 0000000..e43f50e --- /dev/null +++ b/px/packages/multimedia.scm @@ -0,0 +1,36 @@ +(define-module (px packages multimedia) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (gnu packages music) + #:use-module (gnu packages video)) + +(define-public px-music-player + (package + (inherit strawberry) + (name "px-music-player") + (arguments + (substitute-keyword-arguments (package-arguments strawberry) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'patch-app-name + (lambda _ + (substitute* '("dist/unix/org.strawberrymusicplayer.strawberry.desktop") + (("Name=Strawberry\n") "Name=Music\n")) + #t)))))))) + + +(define-public px-video-player + (package + (inherit mpv) + (name "px-video-player") + (arguments + (substitute-keyword-arguments (package-arguments mpv) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'patch-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "etc/mpv.desktop" + (("mpv Media Player") "Px Video Player")))))))) + )) + + diff --git a/px/packages/networking.scm b/px/packages/networking.scm new file mode 100644 index 0000000..ee9b413 --- /dev/null +++ b/px/packages/networking.scm @@ -0,0 +1,156 @@ +(define-module (px packages networking) + #:use-module (nonguix build-system binary) + #:use-module ((guix licenses) :prefix license:) + #:use-module (guix build-system cmake) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix gexp) + #:use-module (gnu packages shells) + #:use-module (gnu packages tls) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) + #:use-module (gnu packages xml)) + +(define-public nebula + (package + (name "nebula") + (version "1.6.1") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/slackhq/nebula/releases/download/v" + version "/nebula-linux-amd64.tar.gz")) + (sha256 + (base32 "09rrxxrz0rppw2681w18czphp77jshw1niqkvgrxy0pq2yln7lr0")))) + (build-system binary-build-system) + (arguments + `(#:phases (modify-phases %standard-phases + (add-after 'unpack 'adjust-paths + (lambda* (#:key outputs #:allow-other-keys) + (let ((bin (string-append (assoc-ref outputs "out") "/bin"))) + (mkdir-p bin) + (install-file "nebula" bin) + (install-file "nebula-cert" bin))))))) + (inputs + `(("expat" ,expat))) + (home-page "https://github.com/slackhq/nebula") + (synopsis "A scalable overlay networking tool with a focus on performance, simplicity and security") + (description "Nebula is a scalable overlay networking tool with a focus on performance, simplicity +and security.It lets you seamlessly connect computers anywhere in the world. Nebula is portable, +and runs on Linux, OSX, Windows, iOS, and Android. It can be used to connect a small number of computers, +but is also able to connect tens of thousands of computers.") + (license license:expat))) + + +(define-public v2ray + (package + (name "v2ray") + (version "5.4.1") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/v2fly/v2ray-core/releases/download/v" + version "/v2ray-linux-64.zip")) + (sha256 (base32 + "05mmzk6b2f9ivyb749b70s8l91q9n5h38zbzmzn3hzj0hf4pzhrc")))) + (build-system binary-build-system) + (arguments + `(#:install-plan + '(("v2ray" "/bin/") + ("geoip.dat" "/bin/") + ("geosite.dat" "/bin/") + ("config.json" "/bin/")) + #:phases + (modify-phases %standard-phases + (replace 'unpack + (lambda* (#:key source #:allow-other-keys) + (invoke "unzip" source)))))) + (native-inputs + (list unzip)) + (home-page "https://tricks.aseman.io") + (synopsis " A platform for building proxies to bypass network restrictions.") + (description "Project V is a set of network tools that help you to build your +own computer network. It secures your network connections and thus protects your +privacy. See our website for more information.") + (license license:expat))) + +(define-public xray-core + (package + (name "xray-core") + (version "1.7.5") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/XTLS/Xray-core/releases/download/v" + version "/Xray-linux-64.zip")) + (file-name (string-append "Xray-linux-64-" version ".zip")) + (sha256 (base32 + "0lrl6wj15wagyky5zy1ihh6ilvxf80yn7p83gdqp5m44zdplf8fn")))) + (build-system binary-build-system) + (arguments + `(#:install-plan + '(("xray" "/bin/") + ("geoip.dat" "/bin/") + ("geosite.dat" "/bin/")) + #:phases + (modify-phases %standard-phases + (replace 'unpack + (lambda* (#:key source #:allow-other-keys) + (invoke "unzip" source)))))) + (native-inputs + (list unzip)) + (home-page "https://tricks.aseman.io") + (synopsis " A platform for building proxies to bypass network restrictions.") + (description "Project V is a set of network tools that help you to build your +own computer network. It secures your network connections and thus protects your +privacy. See our website for more information.") + (license license:expat))) + +(define-public nng-1.5 + (package + (name "nng") + (version "1.5.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanomsg/nng") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1sap0iny3z9lhmaiassv8jc399md1307y32xxx3mrr74jcpcrf59")))) + (build-system cmake-build-system) + (arguments + `(#:configure-flags + (list "-DNNG_ENABLE_COVERAGE=ON" + "-DNNG_ENABLE_TLS=ON" + "-DBUILD_SHARED_LIBS=ON") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'disable-failing-tests + (lambda _ + ;; These tests require network access. + (substitute* "tests/CMakeLists.txt" + (("add_nng_test1\\(httpclient 60 NNG_SUPP_HTTP\\)") "") + (("add_nng_test\\(multistress 60\\)") "") + (("add_nng_test\\(tls 60\\)") "") + ) + (substitute* "src/supplemental/websocket/CMakeLists.txt" + (("nng_test\\(wssfile_test\\)") "")) + (substitute* "src/sp/transport/ws/CMakeLists.txt" + (("nng_test_if\\(WS_ON ws_test\\)") "")) + (substitute* "src/sp/transport/tcp/CMakeLists.txt" + (("nng_test\\(tcp_test\\)") "")) + (substitute* "src/platform/CMakeLists.txt" + (("nng_test\\(resolver_test\\)") "")) + #t))))) + (native-inputs + `(("ksh" ,oksh))) + (inputs + `(("mbedtls" ,mbedtls-apache))) + (synopsis "Lightweight messaging library") + (description "NNG project is a rewrite of the scalability protocols library +known as libnanomsg, and adds significant new capabilities, while retaining +compatibility with the original. It is a lightweight, broker-less library, +offering a simple API to solve common recurring messaging problems, such as +publish/subscribe, RPC-style request/reply, or service discovery.") + (home-page "https://nng.nanomsg.org/") + (license license:expat)))
\ No newline at end of file diff --git a/px/packages/node.scm b/px/packages/node.scm new file mode 100644 index 0000000..1028a5c --- /dev/null +++ b/px/packages/node.scm @@ -0,0 +1,58 @@ +(define-module (px packages node) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (ice-9 match) + #:use-module (guix download) + #:use-module (guix build-system trivial) + #:use-module (guix packages)) + +(define-public pnpm + (package + (name "pnpm") + (version "8.4.0") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/pnpm/pnpm/releases/download/v" + version "/pnpm-linuxstatic-" + (match (or (%current-system) (%current-target-system)) + ("x86_64-linux" "x64") + ("aarch64-linux" "arm64")))) + (sha256 + (base32 + "0r7x1zamcznv3d4s0y410xg99qa3j8fh3gygqp5gaiikhwfln7kh")))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules ((guix build utils))) + (let* ((source (assoc-ref %build-inputs "source")) + (bin (string-append %output "/bin")) + (exe (string-append bin "/pnpm"))) + (mkdir-p bin) + (copy-file source exe) + (chmod exe #o755))))) + (home-page "https://pnpm.io") + (synopsis "Fast, disk space efficient package manager for nodejs") + (description "PNPM uses a content-addressable filesystem to +store all files from all module directories on a disk") + (license license:expat))) + +(define-public pnpm-7 + (package + (inherit pnpm) + (name "pnpm") + (version "7.32.2") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/pnpm/pnpm/releases/download/v" + version "/pnpm-linuxstatic-" + (match (or (%current-system) (%current-target-system)) + ("x86_64-linux" "x64") + ("aarch64-linux" "arm64")))) + (sha256 + (base32 + "1k3n24ink74ajs8nd0p6y6238vi41n5bvrk8clnydgwg11ax1zx0"))))))
\ No newline at end of file diff --git a/px/packages/package-management.scm b/px/packages/package-management.scm new file mode 100644 index 0000000..666947f --- /dev/null +++ b/px/packages/package-management.scm @@ -0,0 +1,56 @@ +(define-module (px packages package-management) + #:use-module (gnu packages) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-xyz) + #:use-module (guix build-system python) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module ((guix licenses) #:prefix license:)) + +(define-public px + (package + (name "px") + (version "0.0.17") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "1xyvdykcs0hsmcji19aivw5ir2153wjbh75ni12sbdjwm994r5wp")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'sanity-check)))) + (inputs + `(("python-appdirs" ,python-appdirs))) + (home-page "https://www.pantherx.org/") + (synopsis "px is a guix overlay that aims to automate certain steps") + (description "This package provides a number of helpers that combine repetitive +guix commands into one-liners; for ex. px update apply.") + (license license:gpl3))) + +(define-public px-unattended-upgrades + (package + (name "px-unattended-upgrades") + (version "0.0.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "0qzkx32wyfy8i12zcfx761kbd8nmxlw6ihcgqpycjkb3f2qgfs05")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'sanity-check)))) + (inputs + `(("px" ,px) + ("python-appdirs" ,python-appdirs) + ("python-psutil" ,python-psutil))) + (home-page "https://www.pantherx.org/") + (synopsis "Unattended upgrades limited to run once per boot") + (description "Unattended upgrades are to be run as root system service or via cron +and simply prevent running the upgrade twice before rebooting.") + (license license:expat))) diff --git a/px/packages/pantherx-panel.scm b/px/packages/pantherx-panel.scm new file mode 100644 index 0000000..a01da84 --- /dev/null +++ b/px/packages/pantherx-panel.scm @@ -0,0 +1,92 @@ +;;; Settings Packages Module for PantherX +;;; Author: Hamzeh Nasajpour (h.nasajpour@pantherx.org) +;;; + +(define-module (px packages pantherx-panel) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (guix build-system python) + #:use-module (guix utils) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages serialization) + #:use-module (gnu packages xorg) + #:use-module (px packages common) + #:use-module (guix build-system trivial) + #:use-module (gnu packages base) + #:use-module (gnu packages compton) + #:use-module (gnu packages fonts) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages gnome) + #:use-module (gnu packages gnuzilla) + #:use-module (gnu packages kde-frameworks) + #:use-module (gnu packages lxqt) + #:use-module (gnu packages networking) + #:use-module (gnu packages openbox) + #:use-module (gnu packages qt) + #:use-module (gnu packages compression) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix build-system trivial) + #:use-module (gnu packages) + #:use-module (gnu packages admin) + #:use-module (gnu packages compression) + #:use-module (gnu packages documentation) + #:use-module (gnu packages compton) + #:use-module (gnu packages fonts) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages gtk) + #:use-module (gnu packages image) + #:use-module (gnu packages kde-frameworks) + #:use-module (gnu packages kde-plasma) + #:use-module (gnu packages linux) + #:use-module (gnu packages perl) + #:use-module (gnu packages lxqt) + #:use-module (gnu packages maths) + #:use-module (gnu packages openbox) + #:use-module (gnu packages pcre) + #:use-module (gnu packages photo) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages polkit) + #:use-module (gnu packages pulseaudio) + #:use-module (gnu packages qt) + #:use-module (gnu packages textutils) + #:use-module (gnu packages xdisorg) + #:use-module (gnu packages xml) + #:use-module (gnu packages xorg) + #:use-module (gnu packages web) + #:use-module (px packages common) + #:use-module (px packages inspection) + #:use-module (px packages desktop-tools) + #:use-module (srfi srfi-1) + #:use-module (px packages networking)) + +(define-public pantherx-panel + (package + (inherit lxqt-panel) + (name "pantherx-panel") + (version "1.3.0-u1") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/lxqt-panel_"version ".tgz")) + (sha256 + (base32 "149k9s47wvb9v49b4hzsz2g1yrisr03n4pbr9ignm5s2j5z8z9if")))) + (build-system cmake-build-system) + (inputs + `( ("zlib" ,zlib) + ("nng" ,nng-1.5) + ("rapidjson" ,rapidjson) + ("capnproto" ,capnproto-0.9) + ,@(package-inputs lxqt-panel))) + (native-inputs + `(("nng" ,nng-1.5) + ,@(package-native-inputs lxqt-panel))) + (propagated-inputs + `(("px-network-inspection" ,px-network-inspection) + ("px-recoll" ,px-recoll) + ,@(package-propagated-inputs lxqt-panel))))) diff --git a/px/packages/password.scm b/px/packages/password.scm new file mode 100644 index 0000000..dc27716 --- /dev/null +++ b/px/packages/password.scm @@ -0,0 +1,44 @@ +(define-module (px packages password) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (guix licenses) + #:use-module (gnu packages autotools) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages serialization) + #:use-module (px packages common)) + +(define-public px-pass-service + (package + (name "px-pass-service") + (version "0.0.94") + (source (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/px_pass_service_" version + ".tgz")) + (sha256 + (base32 + "08qx0dg2igibx0ifr55x5vcdac3giwln0grk86bkki1n0fykkfq3")))) + (build-system gnu-build-system) + (arguments + `( + #:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-source + (lambda _ + (chdir "../") ;; - guix automatically change cwd to first sub-directory, which is not desired. + (delete-file "configure") ;; - we need to delete old cofigure file inside package and allow autotools to + #t)) ;; recreate that. + (add-before 'install-license-files 'cleanup-license + (lambda _ + (delete-file "COPYING")))))) + (inputs `(("capnproto", capnproto-0.9))) + (native-inputs `( + ("autoconf", autoconf) + ("automake", automake) + ("pkg-config", pkg-config))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Password Management Service") + (description "Password manager service for pantherx operating system.") + (license gpl3+))) diff --git a/px/packages/programming.scm b/px/packages/programming.scm new file mode 100644 index 0000000..c4e8f4e --- /dev/null +++ b/px/packages/programming.scm @@ -0,0 +1,289 @@ +(define-module (px packages programming) + #:use-module (nonguix build-system binary) + #:use-module ((guix licenses) :prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (ice-9 match) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages compression) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages nss) + #:use-module (gnu packages gtk) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages xorg) + #:use-module (gnu packages xml) + #:use-module (gnu packages xdisorg) + #:use-module (gnu packages gl) + #:use-module (gnu packages linux) + #:use-module (gnu packages cups) + #:use-module (gnu packages gcc)) + +(define* (make-vscodium-release-asset version asset hash) + (origin + (method url-fetch) + (uri + (string-append + "https://github.com/VSCodium/vscodium/releases/download/" version "/" + asset "-" + (match (or (%current-system) (%current-target-system)) + ("x86_64-linux" "linux-x64") + ("i686-linux" "linux-ia32") + ("aarch64-linux" "linux-arm64") + ("armhf-linux" "linux-armv7l")) + "-" version ".tar.gz")) + (sha256 + (base32 hash)))) + +(define-public vscodium + (package + (name "vscodium") + (version "1.77.3.23102") + (source #f) + (build-system binary-build-system) + (arguments + `(#:patchelf-plan + `(("opt/vscodium/codium" + ("glib" "atk" "libx11" "dbus" "gdk-pixbuf" "gtk+" "pango" "fontconfig" + "cairo" "libxcomposite" "libxdamage" "libxext" "libxfixes" "libxshmfence" + "libxkbfile" "libxrandr" "expat" "libdrm" "libxkbcommon" "mesa" "alsa-lib" + "cups" "at-spi2-core" "libxcb" "at-spi2-atk" "nspr" "gcc" "zlib" "gcc:lib" + "libsecret"))) + #:phases + (modify-phases %standard-phases + (replace 'unpack + (lambda* (#:key inputs outputs #:allow-other-keys) + (mkdir-p "opt/vscodium") + (invoke "tar" "-xvf" (assoc-ref inputs "vscodium") "-C" "opt/vscodium") + #t)) + + (add-after 'install 'add-desktop-file + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (iconpath (string-append out "/share/icons/hicolor/512x512/apps/")) + (desktoppath (string-append out "/share/applications/")) + (desktopdata (string-append "[Desktop Entry]\n" + "Name=VSCodium\n" + "Comment=Code Editing. Redefined.\n" + "GenericName=Text Editor\n" + "Exec=" out "/opt/vscodium/bin/codium\n" + "Icon=code\n" + "Type=Application\n" + "StartupNotify=true\n" + "StartupWMClass=Code\n" + "Categories=TextEditor;Development;IDE;\n" + "Actions=new-empty-window;\n" + "Keywords=vscode;\n\n"))) + (mkdir-p iconpath) + (invoke "cp" "opt/vscodium/resources/app/resources/linux/code.png" (string-append iconpath "code.png")) + (mkdir-p desktoppath) + (with-output-to-file (string-append desktoppath ,name ".desktop") + (lambda _ (format #t desktopdata)))) + (invoke "rm" (string-append %output "/environment-variables")) + (mkdir-p (string-append %output "/bin")) + (invoke "ln" "-s" (string-append %output "/opt/vscodium/codium") (string-append %output "/bin/")) + #t)) + (add-after 'install 'wrap-where-patchelf-does-not-work + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (wrap-program (string-append out "/opt/vscodium/codium") + `("FONTCONFIG_PATH" ":" + prefix + (,(string-join + (list + (string-append (assoc-ref inputs "fontconfig") "/etc/fonts") + out) + ":")))) + (wrap-program (string-append out "/opt/vscodium/codium") + `("LD_LIBRARY_PATH" ":" + prefix + (,(string-join + (list + (string-append (assoc-ref inputs "nss") "/lib/nss") + (string-append (assoc-ref inputs "eudev") "/lib") + (string-append (assoc-ref inputs "gcc") "/lib") + (string-append (assoc-ref inputs "libxkbfile") "/lib") + (string-append (assoc-ref inputs "zlib") "/lib") + (string-append (assoc-ref inputs "libsecret") "/lib") + (string-append out "/opt/vscodium") + out) + ":"))))) + #t))))) + (native-inputs + `(("tar" ,tar))) + (inputs + `(("vscodium" + ,(make-vscodium-release-asset + version "VSCodium" + "049vn3gwwl0sxf8hvd8raaamy9f0x2z9p3sz8xzafa1h129iiybr")) + ("gcc:lib" ,gcc "lib") + ("gcc" ,gcc "lib") + ("glib" ,glib) + ("nss" ,nss) + ("nspr" ,nspr) + ("atk" ,atk) + ("libx11" ,libx11) + ("dbus" ,dbus) + ("librsvg" ,librsvg) + ("gtk+" ,gtk+) + ("pango" ,pango) + ("cairo" ,cairo) + ("libxcomposite" ,libxcomposite) + ("libxdamage" ,libxdamage) + ("libxext" ,libxext) + ("libxfixes" ,libxfixes) + ("libxrandr" ,libxrandr) + ("libxkbfile" ,libxkbfile) + ("libxshmfence" ,libxshmfence) + ("libsecret" ,libsecret) + ("expat" ,expat) + ("libdrm" ,libdrm) + ("libxkbcommon" ,libxkbcommon) + ("mesa" ,mesa) + ("alsa-lib" ,alsa-lib) + ("cups" ,cups) + ("at-spi2-core" ,at-spi2-core) + ("libxcb" ,libxcb) + ("at-spi2-atk" ,at-spi2-atk) + ("eudev" ,eudev) + ("fontconfig" ,fontconfig) + ("zlib" ,zlib) + ("bash-minimal" ,bash-minimal))) + (home-page "https://vscodium.com/") + (synopsis "VSCodium is a community-driven, freely-licensed binary distribution of Microsoft’s editor VSCode.") + (description "VSCodium is a community-driven, freely-licensed binary distribution of Microsoft’s editor VSCode.") + (license license:expat))) + +(define* (make-vscode-release-asset version asset hash) + (origin + (method url-fetch) + (uri + (string-append + "https://update.code.visualstudio.com/" version "/" + (match (or (%current-system) (%current-target-system)) + ("x86_64-linux" "linux-x64") + ("aarch64-linux" "linux-arm64") + ("armhf-linux" "linux-armhf")) + "/stable")) + (sha256 + (base32 hash)))) + +(define-public vscode + (package + (name "vscode") + (version "1.78.0") + (source #f) + (build-system binary-build-system) + (arguments + `(#:patchelf-plan + `(("opt/vscode/code" + ("glib" "atk" "libx11" "dbus" "gdk-pixbuf" "gtk+" "pango" "fontconfig" + "cairo" "libxcomposite" "libxdamage" "libxext" "libxfixes" "libxshmfence" + "libxkbfile" "libxrandr" "expat" "libdrm" "libxkbcommon" "mesa" "alsa-lib" + "cups" "at-spi2-core" "libxcb" "at-spi2-atk" "nspr" "gcc" "zlib" "gcc:lib" + "libsecret"))) + #:phases + (modify-phases %standard-phases + (replace 'unpack + (lambda* (#:key inputs outputs #:allow-other-keys) + (mkdir-p "opt/vscode") + (invoke "tar" "--strip-components=1" "-xvf" (assoc-ref inputs "vscode") "-C" "opt/vscode") + #t)) + (add-after 'install 'add-desktop-file + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (iconpath (string-append out "/share/icons/hicolor/512x512/apps/")) + (desktoppath (string-append out "/share/applications/")) + (desktopdata (string-append "[Desktop Entry]\n" + "Name=Visual Studio Code\n" + "Comment=Code Editing. Redefined.\n" + "GenericName=Text Editor\n" + "Exec=" out "/opt/vscode/bin/code\n" + "Icon=vscode\n" + "Type=Application\n" + "StartupNotify=true\n" + "StartupWMClass=Code\n" + "Categories=TextEditor;Development;IDE;\n" + "Actions=new-empty-window;\n" + "Keywords=vscode;\n\n"))) + (mkdir-p iconpath) + (invoke "cp" "opt/vscode/resources/app/resources/linux/code.png" (string-append iconpath "vscode.png")) + (mkdir-p desktoppath) + (with-output-to-file (string-append desktoppath ,name ".desktop") + (lambda _ (format #t desktopdata)))) + (invoke "rm" (string-append %output "/environment-variables")) + (mkdir-p (string-append %output "/bin")) + (invoke "ln" "-s" (string-append %output "/opt/vscode/bin/code") (string-append %output "/bin/")) + #t)) + (add-after 'install 'wrap-where-patchelf-does-not-work + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (wrap-program (string-append out "/opt/vscode/code") + `("FONTCONFIG_PATH" ":" + prefix + (,(string-join + (list + (string-append (assoc-ref inputs "fontconfig") "/etc/fonts") + out) + ":")))) + (wrap-program (string-append out "/opt/vscode/code") + `("LD_LIBRARY_PATH" ":" + prefix + (,(string-join + (list + (string-append (assoc-ref inputs "nss") "/lib/nss") + (string-append (assoc-ref inputs "eudev") "/lib") + (string-append (assoc-ref inputs "gcc") "/lib") + (string-append (assoc-ref inputs "libxkbfile") "/lib") + (string-append (assoc-ref inputs "zlib") "/lib") + (string-append (assoc-ref inputs "libsecret") "/lib") + (string-append out "/opt/vscode") + out) + ":"))))) + #t))))) + (native-inputs + `(("tar" ,tar))) + (inputs + `(("vscode" + ,(make-vscode-release-asset + version "vscode" + "11ibgnpcs0qvirgjnk799zkb63zp0nbc8y636l5g9nay6jm8lr8s")) + ("gcc:lib" ,gcc "lib") + ("gcc" ,gcc "lib") + ("glib" ,glib) + ("nss" ,nss) + ("nspr" ,nspr) + ("atk" ,atk) + ("libx11" ,libx11) + ("dbus" ,dbus) + ("librsvg" ,librsvg) + ("gtk+" ,gtk+) + ("pango" ,pango) + ("cairo" ,cairo) + ("libxcomposite" ,libxcomposite) + ("libxdamage" ,libxdamage) + ("libxext" ,libxext) + ("libxfixes" ,libxfixes) + ("libxrandr" ,libxrandr) + ("libxkbfile" ,libxkbfile) + ("libxshmfence" ,libxshmfence) + ("libsecret" ,libsecret) + ("expat" ,expat) + ("libdrm" ,libdrm) + ("libxkbcommon" ,libxkbcommon) + ("mesa" ,mesa) + ("alsa-lib" ,alsa-lib) + ("cups" ,cups) + ("at-spi2-core" ,at-spi2-core) + ("libxcb" ,libxcb) + ("at-spi2-atk" ,at-spi2-atk) + ("eudev" ,eudev) + ("fontconfig" ,fontconfig) + ("zlib" ,zlib) + ("bash-minimal" ,bash-minimal))) + (home-page "https://code.visualstudio.com/") + (synopsis "Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.") + (description "Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.") + (license license:expat))) diff --git a/px/packages/px-themes.scm b/px/packages/px-themes.scm new file mode 100644 index 0000000..d08622e --- /dev/null +++ b/px/packages/px-themes.scm @@ -0,0 +1,56 @@ +;;; Theme Packages Module for PantherX +;;; Author: Hamzeh Nasajpour (h.nasajpour@pantherx.org) +;;; + +(define-module (px packages px-themes) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (guix build-system cmake) + #:use-module (guix build-system meson) + #:use-module (guix build-system trivial) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) + #:use-module (gnu packages gnupg) + #:use-module (gnu packages gtk) + #:use-module (gnu packages kde-frameworks) + #:use-module (gnu packages kde-plasma) + #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages qt) + #:use-module (gnu packages web)) + +(define-public px-settings-service-plugin-theme-dark-bright + (package + (name "px-settings-service-plugin-theme-dark-bright") + (version "0.2.1") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version + ".tgz")) + (sha256 + (base32 "0svx2z0ws4ck5p1bzw57y4rasmjshna4wx2pqlmak621ghrrnfvn")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-screenshot-path + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (substitute* "dark/theme.conf" + (("dark.jpg") (string-append out "/share/px/themes/dark/dark.jpg"))) + (substitute* "bright/theme.conf" + (("bright.jpg") (string-append out "/share/px/themes/bright/bright.jpg"))) + #t))) + ))) + (synopsis "PantherX Dark and Bright theme") + (home-page "https://git.pantherx.org/development/plugins/px-settings-service-plugin-theme-dark-bright") + (description "PantherX Dark and Bright theme") + (license license:gpl3+))) diff --git a/px/packages/python-xyz.scm b/px/packages/python-xyz.scm new file mode 100644 index 0000000..93b46ee --- /dev/null +++ b/px/packages/python-xyz.scm @@ -0,0 +1,911 @@ +(define-module (px packages python-xyz) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix build-system gnu) + #:use-module (guix build-system cmake) + #:use-module (guix build-system python) + #:use-module (gnu packages python) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages python-web) + #:use-module (gnu packages time) + #:use-module (guix utils) + #:use-module (gnu packages algebra) + #:use-module (gnu packages autotools) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages version-control) + #:use-module (gnu packages check) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-check) + #:use-module (gnu packages python-crypto) + #:use-module (gnu packages python-web) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages django) + #:use-module (gnu packages qt) + #:use-module (gnu packages check) + #:use-module (gnu packages web) + #:use-module (gnu packages security-token) + #:use-module (gnu packages serialization) + #:use-module (gnu packages swig) + #:use-module (gnu packages file-systems) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages ghostscript) + #:use-module (gnu packages image) + #:use-module (gnu packages libffi) + #:use-module (gnu packages tls) + #:use-module (gnu packages compression)) + + +(define-public pybind11-2.6.2 + (package + (name "pybind11") + (version "2.6.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/pybind/pybind11") + (commit (string-append "v" version)))) + (sha256 + (base32 + "1lsacpawl2gb5qlh0cawj9swsyfbwhzhwiv6553a7lsigdbadqpy")) + (file-name (git-file-name name version)))) + (build-system cmake-build-system) + (native-inputs + `(("python" ,python-wrapper) + + ;; The following dependencies are used for tests. + ("python-pytest" ,python-pytest) + ("catch" ,catch2-1) + ("eigen" ,eigen))) + (arguments + `(#:configure-flags + (list (string-append "-DCATCH_INCLUDE_DIR=" + (assoc-ref %build-inputs "catch") + "/include/catch")) + + #:phases (modify-phases %standard-phases + (add-after 'install 'install-python + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (with-directory-excursion "../source" + (setenv "PYBIND11_USE_CMAKE" "yes") + (invoke "python" "setup.py" "install" + "--single-version-externally-managed" + "--root=/" + (string-append "--prefix=" out))))))) + + #:test-target "check")) + (home-page "https://github.com/pybind/pybind11/") + (synopsis "Seamless operability between C++11 and Python") + (description + "@code{pybind11} is a lightweight header-only library that exposes C++ +types in Python and vice versa, mainly to create Python bindings of existing +C++ code. Its goals and syntax are similar to the @code{Boost.Python} +library: to minimize boilerplate code in traditional extension modules by +inferring type information using compile-time introspection.") + (license license:bsd-3))) + +(define-public python-maestral-qt + (package + (name "python-maestral-qt") + (version "1.4.8") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/SamSchott/maestral-qt/archive/refs/tags/v" version ".tar.gz")) + (sha256 + (base32 + "1m5lvgjyad8lvkvx0fx9xnjakg6ljxp3kbfhhw9fsk7cbkc1l70k")))) + (build-system python-build-system) + (native-inputs + `(("python-click" ,python-click-8) + ("python-pyqt" ,python-pyqt) + ("python-markdown2" ,python-markdown2) + ("python-wheel" ,python-wheel) + ("python-packaging" ,python-packaging) + ("python-importlib-resources" ,python-importlib-resources) + ("python-maestral" ,python-maestral))) + (home-page "https://github.com/SamSchott/maestral-qt") + (synopsis "A Qt user interface for the Maestral Daemon.") + (description "A Qt user interface for the Maestral Daemon.") + (license license:asl2.0))) + +(define-public python-markdown2 + (package + (name "python-markdown2") + (version "2.4.1") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/trentm/python-markdown2/archive/refs/tags/" version ".tar.gz")) + (sha256 + (base32 + "0259g4wq124fxzrqs50frkc03zldy916g68xn7n9vpw1z0iznva5")))) + (build-system python-build-system) + (home-page "https://github.com/trentm/python-markdown2") + (synopsis "Markdown is a light text markup format and a processor to convert that to HTML.") + (description "Markdown is a light text markup format and a processor to convert that to HTML.") + (license license:asl2.0))) + +(define-public python-maestral + (package + (name "python-maestral") + (version "1.6.4") ;;1.7.2 fails with no setup.py found + (source + (origin + (method url-fetch) + (uri (pypi-uri "maestral" version)) + (sha256 + (base32 + "1ik6hff1vc8swmpwzlv6bhzca4yha4mjk9j78jbyf7nnc5mnl0xs")))) + (build-system python-build-system) + (propagated-inputs + `(("python-click" ,python-click-8) + ("python-desktop-notifier" ,python-desktop-notifier) + ("python-dropbox" ,python-dropbox) + ("python-fasteners" ,python-fasteners) + ("python-importlib-metadata" ,python-importlib-metadata) + ("python-keyring" ,python-keyring) + ("python-keyrings.alt" ,python-keyrings.alt) + ("python-packaging" ,python-packaging) + ("python-pathspec" ,python-pathspec) + ("python-pyro5" ,python-pyro5) + ("python-requests" ,python-requests) + ("python-sdnotify" ,python-sdnotify) + ("python-survey" ,python-survey) + ("python-watchdog" ,python-watchdog))) + (native-inputs + `(("python-black" ,python-black) + ("python-bump2version" ,python-bump2version) + ("python-flake8" ,python-flake8) + ("python-mypy" ,python-mypy) + ("python-pre-commit" ,python-pre-commit) + ("python-pytest" ,python-pytest) + ("python-wheel" ,python-wheel) + ("python-pytest-benchmark" ,python-pytest-benchmark) + ("python-pytest-cov" ,python-pytest-cov) + ("python-pytest-rerunfailures" ,python-pytest-rerunfailures) + ("python-types-requests" ,python-types-requests))) + (home-page "https://maestral.app") + (synopsis + "Open-source Dropbox client for macOS and Linux.") + (description + "Open-source Dropbox client for macOS and Linux.") + (license license:expat))) + +(define-public python-dbus-next + (package + (name "python-dbus-next") + (version "0.2.3") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/altdesktop/python-dbus-next/archive/refs/tags/v" version ".tar.gz")) + (sha256 + (base32 + "0nggps85gq1f2lp9gf8kv1am3zihdk65zdg8hy2xs3p51ndnh6fv")))) + (build-system python-build-system) + (arguments + `( + #:tests? #f)) + (home-page + "https://github.com/altdesktop/python-dbus-next") + (synopsis + "A zero-dependency DBus library for Python with asyncio support") + (description + "A zero-dependency DBus library for Python with asyncio support") + (license license:expat))) + + + + +(define-public python-desktop-notifier + (package + (name "python-desktop-notifier") + (version "3.3.2") + (source + (origin + (method url-fetch) + (uri (pypi-uri "desktop-notifier" version)) + (sha256 + (base32 + "0wrqgbvhi0implwqzy5as0hk3lh7cc83h9942rz1jrdw797vvmhd")))) + (build-system python-build-system) + (propagated-inputs + `(("python-dbus-next" ,python-dbus-next) + ("python-importlib-resources" + ,python-importlib-resources) + ("python-packaging" ,python-packaging) +; ("python-rubicon-objc" ,python-rubicon-objc) + )) + (native-inputs + `(("python-black" ,python-black) + ("python-bump2version" ,python-bump2version) + ("python-wheel" ,python-wheel) + ("python-flake8" ,python-flake8) + ("python-mypy" ,python-mypy) + ("python-pre-commit" ,python-pre-commit) + ("python-pytest" ,python-pytest) + ("python-pytest-cov" ,python-pytest-cov))) + (home-page + "https://github.com/samschott/desktop-notifier") + (synopsis + "Python library for cross-platform desktop notifications") + (description + "Python library for cross-platform desktop notifications") + (license license:expat))) + + +(define-public python2-pymongo + (package-with-python2 python-pymongo)) + + +(define-public python-pyro5 + (package + (name "python-pyro5") + (version "5.12") + (source + (origin + (method url-fetch) + (uri (pypi-uri "Pyro5" version)) + (sha256 + (base32 + "1qpjyh7l5l9p6mhsb77m84ch6hkvr74hay4ldyi0rnj1qdbnjvk1")))) + (build-system python-build-system) + (propagated-inputs + `(("python-serpent" ,python-serpent))) + (home-page "https://github.com/irmen/Pyro5") + (synopsis + "Remote object communication library, fifth major version") + (description + "Remote object communication library, fifth major version") + (license license:expat))) + + + +(define-public python-sdnotify + (package + (name "python-sdnotify") + (version "0.3.2") + (source + (origin + (method url-fetch) + (uri (pypi-uri "sdnotify" version)) + (sha256 + (base32 + "1wdrdg2j16pmqhk0ify20s5pngijh7zc6hyxhh8w8v5k8v3pz5vk")))) + (build-system python-build-system) + (home-page "https://github.com/bb4242/sdnotify") + (synopsis + "A pure Python implementation of systemd's service notification protocol (sd_notify)") + (description + "A pure Python implementation of systemd's service notification protocol (sd_notify)") + (license #f))) + + +(define-public python-survey + (package + (name "python-survey") + (version "3.4.3") + (source + (origin + (method url-fetch) + (uri (pypi-uri "survey" version)) + (sha256 + (base32 + "1qpg5alg6m9kfj5y90chgr66g0f33r3xqrrx2d496vipwsm3vbsc")))) + (build-system python-build-system) + (propagated-inputs + `(("python-wrapio" ,python-wrapio))) + (home-page + "https://github.com/Exahilosys/survey") + (synopsis + "A simple library for creating beautiful interactive prompts.") + (description + "A simple library for creating beautiful interactive prompts.") + (license license:expat))) + + + +(define-public python-wrapio + (package + (name "python-wrapio") + (version "2.0.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "wrapio" version)) + (sha256 + (base32 + "1s696hblap6qz8pc6zspg75bnvh7d48ww1qh1d8d5zjrnwhiqjh9")))) + (build-system python-build-system) + (home-page + "https://github.com/Exahilosys/wrapio") + (synopsis "Handling event-based streams.") + (description "Handling event-based streams.") + (license license:expat))) + + +(define-public python-pytest-rerunfailures + (package + (name "python-pytest-rerunfailures") + (version "10.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pytest-rerunfailures" version)) + (sha256 + (base32 + "0ws2hbgh00nd6xchyi9ymyxfpg5jpxsy5mxdz4nxvriyw5nw05vn")))) + (build-system python-build-system) + (propagated-inputs + `(("python-pytest" ,python-pytest))) + (home-page + "https://github.com/pytest-dev/pytest-rerunfailures") + (synopsis + "pytest plugin to re-run tests to eliminate flaky failures") + (description + "pytest plugin to re-run tests to eliminate flaky failures") + (license #f))) + + +(define-public python-types-requests + (package + (name "python-types-requests") + (version "2.25.6") + (source + (origin + (method url-fetch) + (uri (pypi-uri "types-requests" version)) + (sha256 + (base32 + "1vh203dppi6457lwv7z46dc8rpanjlahk4v3394nq1jwyp0425g2")))) + (build-system python-build-system) + (home-page "https://github.com/python/typeshed") + (synopsis "Typing stubs for requests") + (description "Typing stubs for requests") + (license #f))) + +(define-public python-mail-parser + (package + (name "python-mail-parser") + (version "3.14.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "mail-parser" version)) + (sha256 + (base32 + "11q384z2pa3i4w0d07mnqd25r16sdgvgd8m75ysff6w0kr3vhxvm")))) + (build-system python-build-system) + (inputs + `(("python-simplejson" ,python-simplejson) + ("python-six" ,python-six))) + (home-page "https://github.com/SpamScope/mail-parser") + (synopsis "mail-parser is not only a wrapper for email Python Standard Library.") + (description + "mail-parser is not only a wrapper for email Python Standard Library. +It give you an easy way to pass from raw mail to Python object that you can +use in your code.") + (license license:asl2.0))) + +(define-public python-mail-parser-3.14.0 + (package + (inherit python-mail-parser) + (name "python-mail-parser-3.14.0") + (version "3.14.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "mail-parser" version)) + (sha256 + (base32 + "11q384z2pa3i4w0d07mnqd25r16sdgvgd8m75ysff6w0kr3vhxvm")))))) + +(define-public python-mail-parser-3.12.0 + (package + (inherit python-mail-parser) + (name "python-mail-parser-3.12.0") + (version "3.12.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "mail-parser" version)) + (sha256 + (base32 + "052j6iwsfjg472wb74c9n9i9cgqjm6lsrkb9zs3hljkxnb24mzz8")))))) + +(define-public python-pylint-2.5.3 + (package + (inherit python-pylint) + (name "python-pylint") + (version "2.5.3") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/PyCQA/pylint") + (commit (string-append "pylint-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "04cgbh2z1mygar63plzziyz34yg6bdr4i0g63jp256fgnqwb1bi3")))) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'sanity-check)))))) + +(define-public python-simplejson-3.17.0 + (package + (inherit python-simplejson) + (name "python-simplejson-3.17.0") + (version "3.17.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "simplejson" version)) + (sha256 + (base32 + "108yf3252fy4ndqab7h46raksxfhcn113bzy2yd8369vidrjnjrb")))))) + +(define-public python-wrapt-1.12.1 + (package + (inherit python-wrapt) + (name "python-wrapt-1.12.1") + (version "1.12.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "wrapt" version)) + (sha256 + (base32 + "1mwpkdnqxf0yxj1a0hsnl06lf287qi5ap7309wm37x45zf0zlbxn")))))) + +(define-public python-pyscard-1.9.9 + (package + (inherit python-pyscard) + (name "python-pyscard-1.9.9") + (version "1.9.9") + (source (origin + (method url-fetch) + ;; The maintainer publishes releases on various sites, but + ;; SourceForge is apparently the only one with a signed release. + (uri (string-append + "mirror://sourceforge/pyscard/pyscard/pyscard%20" + version "/pyscard-" version ".tar.gz")) + (sha256 + (base32 + "082cjkbxadaz2jb4rbhr0mkrirzlqyqhcf3r823qb0q1k50ybgg6")))))) + +(define-public python-shortuuid-v1 + (package + (inherit python-shortuuid) + (name "python-shortuuid") + (version "1.0.11") + (source + (origin + (method url-fetch) + (uri (pypi-uri "shortuuid" version)) + (sha256 + (base32 + "12gph4sgmhzqp5pzrm8gxxkcni9pa4x1nl5i9j75m08lb5hz4xgw")))) + (build-system python-build-system) + (native-inputs + (list python-pep8 + python-django)) + (home-page "https://github.com/skorokithakis/shortuuid") + (synopsis "Generator library for concise, unambiguous and URL-safe UUIDs") + (description + "@code{shortuuid} is a Python library for generating concise, unambiguous +and URL-safe UUIDs. UUIDs are generated using the built-in Python @code{uuid} +module and then similar looking characters are removed.") + (license license:bsd-3))) + +(define-public python-pyyaml-v5.3.1 + (package + (name "python-pyyaml-v5.3.1") + (version "5.3.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "PyYAML" version)) + (sha256 + (base32 + "0pb4zvkfxfijkpgd1b86xjsqql97ssf1knbd1v53wkg1qm9cgsmq")))) + (build-system python-build-system) + (inputs + `(("libyaml" ,libyaml))) + (home-page "https://pyyaml.org") + (synopsis "YAML parser and emitter for Python") + (description + "PyYAML is a YAML parser and emitter for Python. PyYAML features a +complete YAML 1.1 parser, Unicode support, pickle support, capable extension +API, and sensible error messages. PyYAML supports standard YAML tags and +provides Python-specific tags that represent an arbitrary Python object.") + (license license:expat))) + +(define-public python-jose-3.1.0 + (package + (name "python-jose-3.1.0") + (version "3.1.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "python-jose" version)) + (sha256 + (base32 + "1kmz7bzwvjk0nnzcpfqhbnlvv4ngkr380xnf5hj9sblnnvyvg144")))) + (build-system python-build-system) + (arguments `( + #:tests? #f)) + + (inputs `( + ("python-pytest-runner" ,python-pytest-runner) + ("python-pyasn1" ,python-pyasn1) + ("python-rsa" ,python-rsa) + ("python-ecdsa" ,python-ecdsa) + )) + (propagated-inputs + `(("python-pyasn1" ,python-pyasn1) + ("python-rsa" ,python-rsa) + ("python-ecdsa" ,python-ecdsa) + ;("python-urllib3" ,python-urllib3) + )) + + (home-page "") + (synopsis "") + (description + "todo.") + (license license:psfl))) + + + +(define-public python-exitstatus-2.0.1 + (package + (name "python-exitstatus-2.0.1") + (version "2.0.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "exitstatus" version)) + (sha256 + (base32 + "193x2775ffy9qkaz267g2qjagd132xprh5nv4iq7a4kq61a26yjf")))) + (build-system python-build-system) + (arguments `( + #:tests? #f)) + + ;(native-inputs `( + ; ("python-cryptography" ,python-cryptography))) + + (home-page "") + (synopsis "") + (description + "todo.") + (license license:psfl))) + + + +(define-public python-authlib-0.14.3 + (package + (name "python-authlib-0.14.3") + (version "0.14.3") + (source + (origin + (method url-fetch) + (uri (pypi-uri "Authlib" version)) + (sha256 + (base32 + "1xljzkzhhc27rbr9zj37iv7cbwf6wqgbyq9gmki3svwrks790lnc")))) + (build-system python-build-system) + (arguments `( + #:tests? #f)) + + (native-inputs `( + ("python-cryptography" ,python-cryptography))) + + (home-page "") + (synopsis "") + (description + "todo.") + (license license:psfl))) + + +(define-public python-requests-2.23 + (package + (name "python-requests") + (version "2.23") + (source (origin + (method url-fetch) + (uri (pypi-uri "requests" version)) + (sha256 + (base32 + "1rhpg0jb08v0gd7f19jjiwlcdnxpmqi1fhvw7r4s9avddi4kvx5k")))) + (build-system python-build-system) + (propagated-inputs + `(("python-certifi" ,python-certifi) + ("python-chardet" ,python-chardet) + ("python-idna" ,python-idna) + ("python-urllib3" ,python-urllib3))) + (arguments + ;; FIXME: Some tests require network access. + '(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'sanity-check)))) + (home-page "http://python-requests.org/") + (synopsis "Python HTTP library") + (description + "Requests is a Python HTTP client library. It aims to be easier to use +than Python’s urllib2 library.") + (license license:asl2.0))) + +(define-public python-requests-cache + (package + (name "python-requests-cache") + (version "0.5.0") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/reclosedev/requests-cache/archive/v" version ".tar.gz")) + (sha256 (base32 "05r26hb1ck0q4ffm334x078nq97hz6cg0nr8nlw1vvh9rl4g0ikq")))) + (build-system python-build-system) + (arguments `( + #:tests? #f)) + (propagated-inputs `( + ("python-requests" ,python-requests))) + (home-page "https://github.com/reclosedev/requests-cache") + (synopsis "Python-requests-cache is a transparent persistent cache for python-requests (version >= 1.1.0) library.") + (description "Python-requests-cache uses python-requests, so it needs an available installation of python-requests.") + (license license:expat))) + +(define-public python-etherscan + (package + (name "python-etherscan") + (version "0.2.3") + (source (origin + (method url-fetch) + (uri (string-append + "https://files.pythonhosted.org/packages/d0/7a/d2c0cc7ce6c54854931f0e069997f1b82dafeff1bdd302e34153ccca9f59/etherscan-" version ".tar.gz")) + (sha256 (base32 "1qqgiy6q8kdsl3gvclgvbnzni8wm3yccsxsq85dlc7mw2dfzhapp")))) + (build-system python-build-system) + (arguments `( + #:tests? #f)) + (propagated-inputs `( + ("python-requests-cache" ,python-requests-cache))) + (home-page "https://github.com/neoctobers/etherscan") + (synopsis "Python-etherscan provides a wrapper for Etherscan.io API.") + (description "Python-etherscan uses python-requests-cache, so it needs an available installation of python-requests-cache.") + (license license:expat))) + + +(define-public python-block-io + (package + (name "python-block-io") + (version "1.1.15") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/BlockIo/block_io-python/archive/" version ".tar.gz")) + (sha256 (base32 "15n8qapdlx8n9f27vj9qr34wgfahwgnqwh039plc6abs4flqjjrb")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'sanity-check)))) + (propagated-inputs `( + ("python-requests" ,python-requests) + ("python-pycryptodome" ,python-pycryptodome) + ("python-ecdsa" ,python-ecdsa) + ("python-six" ,python-six) + ("python-base58" ,python-base58))) + (home-page "https://github.com/BlockIo/block_io-python") + (synopsis "This Python package is the official reference client for the Block.io payments API.") + (description "Please use Python2.7+. Also compatible with Python 3.0+.") + (license license:expat))) + +(define-public python-appdirs-1.4.3 + (package + (inherit python-appdirs) + (name "python-appdirs") + (version "1.4.3") + (source (origin + (method url-fetch) + (uri (pypi-uri "appdirs" version)) + (sha256 (base32 "14id6wxi12lgyw0mg3bcfnf888ad07jz9yj46gfzhn186z8rcn4y")))) + )) + +(define-public python-pyrsistent-0.14.11 + (package + (inherit python-pyrsistent) + (name "python-pyrsistent") + (version "0.14.11") + (source (origin + (method url-fetch) + (uri (pypi-uri "pyrsistent" version)) + (sha256 (base32 "1qkh74bm296mp5g3r11lgsksr6bh4w1bf8pji4nmxdlfj542ga1w")))) + )) + +(define-public python-click-8 + (package + (inherit python-click) + (name "python-click") + (version "8.0.1") + (source (origin + (method url-fetch) + (uri (pypi-uri "click" version)) + (sha256 (base32 "0ymdyf37acq4qxh038q0xx44qgj6y2kf0jd0ivvix6qij88w214c")))) + )) + +(define-public python-itsdangerous-1.1.0 + (package + (inherit python-itsdangerous) + (name "python-itsdangerous") + (version "1.1.0") + (source (origin + (method url-fetch) + (uri (pypi-uri "itsdangerous" version)) + (sha256 (base32 "068zpbksq5q2z4dckh2k1zbcq43ay74ylqn77rni797j0wyh66rj")))) + )) + +(define-public python-markupsafe-1.1.1 + (package + (inherit python-markupsafe) + (name "python-markupsafe") + (version "1.1.1") + (source (origin + (method url-fetch) + (uri (pypi-uri "MarkupSafe" version)) + (sha256 (base32 "0sqipg4fk7xbixqd8kq6rlkxj664d157bdwbh93farcphf92x1r9")))) + )) + +(define-public python-pytz-2018.9 + (package + (inherit python-pytz) + (name "python-pytz") + (version "2018.9") + (source (origin + (method url-fetch) + (uri (pypi-uri "pytz" version)) + (sha256 (base32 "0k1pqnq3c4gvcspjxf3fschdjn71fk89i4wz801rxqh7f145xw6m")))) + )) + +(define-public python-mypy + (package + (name "python-mypy") + (version "0.701") + (source (origin + (method url-fetch) + (uri (pypi-uri "mypy" version)) + (sha256 (base32 "05479r3gbq17r22hyhxjg49smx5q864pgx8ayy23rsdj4w6z2r2p")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'sanity-check)))) + (inputs + `(("python-typed-ast" , python-typed-ast) + ("python-mypy-extensions" , python-mypy-extensions))) + (home-page "http://www.mypy-lang.org/") + (synopsis "Optional static typing for Python (mypyc-compiled version)") + (description + "Add type annotations to your Python programs, and use mypy to type check them. + Mypy is essentially a Python linter on steroids, and it can catch many programming errors by analyzing your program, + without actually having to run it. Mypy has a powerful type system with features such as type inference, + gradual typing, generics and union types.") + (license license:expat))) + +(define-public python-persist-queue + (package + (name "python-persist-queue") + (version "0.4.2") + (source (origin + (method url-fetch) + (uri (pypi-uri "persist-queue" version)) + (sha256 (base32 "0xhvj26jkc4fk0yjzn47is6wh8figyp5cralj8d56r4bidn78wp2")))) + (build-system python-build-system) + (arguments + `(#:tests? #f)) + (home-page "https://github.com/peter-wangxu/persist-queue") + (synopsis "A thread-safe disk based persistent queue in Python.") + (description + "persist-queue implements a file-based queue and a serial of sqlite3-based queues") + (license license:bsd-2))) + +(define-public python-persist-queue-0.3.5 + (package + (inherit python-persist-queue) + (name "python-persist-queue") + (version "0.3.5") + (source (origin + (method url-fetch) + (uri (pypi-uri "persist-queue" version)) + (sha256 (base32 "1bdz04ybjqczlp3x4wc4jq2dbr6r6zqbxak0l27av82irg91m2wn")))) + )) + +(define-public strict-rfc3339 + (package + (name "strict-rfc3339") + (version "0.7") + (source (origin + (method url-fetch) + (uri (pypi-uri "strict-rfc3339" version)) + (sha256 (base32 "0xqjbsn0g1h88rayh5yrpdagq60zfwrfs3yvk6rmgby3vyz1gbaw")))) + (build-system python-build-system) + (arguments + `( + #:tests? #f + )) + (home-page "https://github.com/danielrichman/strict-rfc3339") + (synopsis "Strict, simple, lightweight RFC3339 functions.") + (description "Strict, simple, lightweight RFC3339 functions.") + (license license:gpl3+))) + +(define-public python-json-logger-0.1.10 + (package + (inherit python-json-logger) + (name "python-json-logger") + (version "0.1.10") + (source (origin + (method url-fetch) + (uri (pypi-uri "python-json-logger" version)) + (sha256 (base32 "1plcfi4z3rpch29l64hpjxwxwi829pg44qjvj6ag7vyj9grslb6g")))) + )) + +(define-public python-supervisor + (package + (name "python-supervisor") + (version "4.2.5") + (source (origin + (method url-fetch) + (uri (pypi-uri "supervisor" version)) + (sha256 + (base32 + "04mw7vnhzizzprk83h1k06djrwpv0zxial8s52983i933ap1nxil")))) + (build-system python-build-system) + (arguments + `(#:tests? #f)) + (propagated-inputs (list python-setuptools)) + (native-inputs (list python-pytest python-pytest-cov)) + (home-page "http://supervisord.org/") + (synopsis "A system for controlling process state under UNIX") + (description + "This package provides a system for controlling process state under UNIX") + (license #f))) + +(define-public python-takethetime + (package + (name "python-takethetime") + (version "0.3.1") + (source (origin + (method url-fetch) + (uri (pypi-uri "TakeTheTime" version)) + (sha256 (base32 "1y9gzqb9l1f2smx8783ccjzjvby5mphshgrfks7s75mml59h9qyv")))) + (build-system python-build-system) + (arguments + `( + #:tests? #f + )) + (home-page "https://github.com/ErikBjare/TakeTheTime") + (synopsis "Take The Time, a time-taking library for Python") + (description "Take The Time, a time-taking library for Python.") + (license license:expat))) + +(define-public python-lazy-object-proxy-1.4.0 + (package + (inherit python-lazy-object-proxy) + (name "python-lazy-object-proxy-1.4.0") + (version "1.4.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "lazy-object-proxy" version)) + (sha256 + (base32 + "1znridhk878rpgn92jvyra2gg70bi4l03ciz1i5lwdwsv4rivcbz")))))) diff --git a/px/packages/qt.scm b/px/packages/qt.scm new file mode 100644 index 0000000..39cdf75 --- /dev/null +++ b/px/packages/qt.scm @@ -0,0 +1,194 @@ +(define-module (px packages qt) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (gnu packages documentation) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (guix utils) + #:use-module (guix git-download) + #:use-module (guix build-system gnu) + #:use-module (guix build-system qt) + #:use-module (guix build-system trivial) + #:use-module (gnu packages compression) + #:use-module (gnu packages sqlite) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages qt) + #:use-module (gnu packages) + #:use-module (gnu packages bison) + #:use-module (gnu packages build-tools) + #:use-module (gnu packages cups) + #:use-module (gnu packages curl) + #:use-module (gnu packages databases) + #:use-module (gnu packages documentation) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages flex) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages ghostscript) + #:use-module (gnu packages gl) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages gnupg) + #:use-module (gnu packages gperf) + #:use-module (gnu packages gstreamer) + #:use-module (gnu packages gtk) + #:use-module (gnu packages icu4c) + #:use-module (gnu packages image) + #:use-module (gnu packages libevent) + #:use-module (gnu packages linux) + #:use-module (gnu packages maths) + #:use-module (gnu packages ninja) + #:use-module (gnu packages nss) + #:use-module (gnu packages pciutils) + #:use-module (gnu packages pcre) + #:use-module (gnu packages perl) + #:use-module (gnu packages protobuf) + #:use-module (gnu packages pulseaudio) + #:use-module (gnu packages python) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages qt) + #:use-module (gnu packages regex) + #:use-module (gnu packages ruby) + #:use-module (gnu packages sdl) + #:use-module (gnu packages serialization) + #:use-module (gnu packages telephony) + #:use-module (gnu packages tls) + #:use-module (gnu packages valgrind) + #:use-module (gnu packages video) + #:use-module (gnu packages vulkan) + #:use-module (gnu packages xdisorg) + #:use-module (gnu packages xiph) + #:use-module (gnu packages xorg) + #:use-module (gnu packages xml) + #:use-module (srfi srfi-1)) + +(define (qt5-urls component version) + "Return a list of URLs for VERSION of the Qt5 COMPONENT." + ;; We can't use a mirror:// scheme because these URLs are not exact copies: + ;; the layout differs between them. + (list (string-append "https://download.qt.io/official_releases/qt/" + (version-major+minor version) "/" version + "/submodules/" component "-everywhere-src-" + version ".tar.xz") + (string-append "https://download.qt.io/archive/qt/" + (version-major+minor version) "/" version + "/submodules/" component "-everywhere-src-" + version ".tar.xz") + (let ((directory (string-append "qt5" (string-drop component 2)))) + (string-append "http://sources.buildroot.net/" directory "/" + component "-everywhere-src-" version ".tar.xz")) + (string-append "https://distfiles.macports.org/qt5/" + component "-everywhere-src-" version ".tar.xz"))) + +(define-public qtbase-with-bundled-sqlite + (package (inherit qtbase-5) + (name "qtbase-with-bundled-sqlite") + (source (origin + (inherit (package-source qtbase-5)) + (snippet + ;; corelib uses bundled harfbuzz, md4, md5, sha3 + '(begin + (with-directory-excursion "src/3rdparty" + (for-each delete-file-recursively + (list "double-conversion" "freetype" "harfbuzz-ng" + "libpng" "libjpeg" "pcre2" "xcb" "zlib")) + #t))))) + (arguments (substitute-keyword-arguments (package-arguments qtbase-5) + ((#:phases phases '%standard-phases) + `(modify-phases ,phases + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (substitute* "configure" + (("/bin/pwd") (which "pwd"))) + (substitute* "src/corelib/global/global.pri" + (("/bin/ls") (which "ls"))) + ;; The configuration files for other Qt5 packages are searched + ;; through a call to "find_package" in Qt5Config.cmake, which + ;; disables the use of CMAKE_PREFIX_PATH via the parameter + ;; "NO_DEFAULT_PATH". Re-enable it so that the different + ;; components can be installed in different places. + (substitute* (find-files "." ".*\\.cmake") + (("NO_DEFAULT_PATH") "")) + ;; do not pass "--enable-fast-install", which makes the + ;; configure process fail + (invoke + "./configure" + "-verbose" + "-prefix" out + "-docdir" (string-append out "/share/doc/qt5") + "-headerdir" (string-append out "/include/qt5") + "-archdatadir" (string-append out "/lib/qt5") + "-datadir" (string-append out "/share/qt5") + "-examplesdir" (string-append + out "/share/doc/qt5/examples") + "-opensource" + "-confirm-license" + + ;; These features require higher versions of Linux than the + ;; minimum version of the glibc. See + ;; src/corelib/global/minimum-linux_p.h. By disabling these + ;; features Qt5 applications can be used on the oldest + ;; kernels that the glibc supports, including the RHEL6 + ;; (2.6.32) and RHEL7 (3.10) kernels. + "-no-feature-getentropy" ; requires Linux 3.17 + "-no-feature-renameat2" ; requires Linux 3.16 + + ;; Do not build examples; if desired, these could go + ;; into a separate output, but for the time being, we + ;; prefer to save the space and build time. + "-no-compile-examples" + ;; Most "-system-..." are automatic, but some use + ;; the bundled copy by default. + ; "-system-sqlite" + "-system-harfbuzz" + "-system-pcre" + ;; explicitly link with openssl instead of dlopening it + "-openssl-linked" + ;; explicitly link with dbus instead of dlopening it + "-dbus-linked" + ;; don't use the precompiled headers + "-no-pch" + ;; drop special machine instructions that do not have + ;; runtime detection + ,@(if (string-prefix? "x86_64" + (or (%current-target-system) + (%current-system))) + '() + '("-no-sse2")) + "-no-mips_dsp" + "-no-mips_dspr2")))) + )))) + )) + +(define-public qt-location-plugin-googlemap + (package + (name "qt-location-plugin-googlemap") + (version "0.0.0.2") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/vladest/googlemaps/archive/refs/tags/v." version ".tar.gz")) + (sha256 + (base32 "1w2vgall1alc2mw5vd4c0wfxa75vri4q1qqwhvrdyxbyj6azkhma")))) + (arguments + `(#:tests? #f ; no tests)) + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "googlemaps.pro" + (("\\$\\$\\[QT_INSTALL_PLUGINS\\]") + (string-append (assoc-ref outputs "out") "/lib/qt5/plugins"))) + (invoke "qmake" "googlemaps.pro" )))))) + (build-system qt-build-system) + (inputs + (list qtbase-5 + qtlocation + qtdeclarative-5)) + (native-inputs + (list pkg-config qttools-5)) + (home-page "https://github.com/vladest/googlemaps") + (synopsis "Google Maps plugin for QtLocation") + (description "GoogleMaps plugin for QtLocation module") + (license license:gpl3+)))
\ No newline at end of file diff --git a/px/packages/secret.scm b/px/packages/secret.scm new file mode 100644 index 0000000..618fc90 --- /dev/null +++ b/px/packages/secret.scm @@ -0,0 +1,68 @@ +;;; Settings Packages Module for PantherX +;;; Author: Hamzeh Nasajpour (h.nasajpour@pantherx.org) +;;; + +(define-module (px packages secret) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (guix build-system python) + #:use-module (guix utils) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages serialization) + #:use-module (gnu packages gnome) + #:use-module (gnu packages gnupg) + #:use-module (gnu packages web) + #:use-module (px packages common) + #:use-module (gnu packages image) + #:use-module (gnu packages python) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-xyz)) + + +(define-public px-secret-service + (package + (name "px-secret-service") + (version "v0.3.4") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-secret-service_" + version + ".tgz")) + (sha256 + (base32 + "0jc3mcmq2232nfm52fp3ag1v7gj5yh7a432v4mxv5jkqm2h71nm1")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f)) + (inputs `(("capnproto" ,capnproto-0.9) + ("libsecret" ,libsecret) + ("rapidjson" ,rapidjson))) + (native-inputs + `(("pkg-config", pkg-config))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Secret Service") + (description "This package provides secret service to store confidential information on PantherX") + (license license:gpl3))) + +(define-public px-secret-sharing + (package + (name "px-secret-sharing") + (version "0.0.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "1w3lsi4km3xlwb1a4w5nb26pn7rkzmdvfh7isbpmhv6qfq9fim1a")))) + (build-system python-build-system) + (propagated-inputs + `(("steghide", steghide) + ("python-appdirs", python-appdirs))) + (home-page "https://git.pantherx.org/development/applications/px-secret-sharing") + (synopsis "Automated, secure secrets sharing and reconstruction.") + (description "CLI application that automates secret sharing and +reconstruction (Shamir's secret sharing scheme)") + (license license:expat)))
\ No newline at end of file diff --git a/px/packages/security-token.scm b/px/packages/security-token.scm new file mode 100644 index 0000000..b2e9a59 --- /dev/null +++ b/px/packages/security-token.scm @@ -0,0 +1,104 @@ +(define-module (px packages security-token) + #:use-module (gnu packages) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix build-system gnu) + #:use-module (guix build-system glib-or-gtk) + #:use-module (guix build-system python) + #:use-module (gnu packages autotools) + #:use-module (gnu packages base) + #:use-module (gnu packages curl) + #:use-module (gnu packages check) + #:use-module (gnu packages docbook) + #:use-module (gnu packages documentation) + #:use-module (gnu packages dns) + #:use-module (gnu packages flex) + #:use-module (gnu packages gettext) + #:use-module (gnu packages graphviz) + #:use-module (gnu packages gtk) + #:use-module (gnu packages libusb) + #:use-module (gnu packages linux) + #:use-module (gnu packages man) + #:use-module (gnu packages networking) + #:use-module (gnu packages cyrus-sasl) + #:use-module (gnu packages popt) + #:use-module (gnu packages readline) + #:use-module (gnu packages tls) + #:use-module (gnu packages tex) + #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages python-crypto) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages security-token) + #:use-module (gnu packages swig) + #:use-module (gnu packages web) + #:use-module (gnu packages xml) + #:use-module (px packages python-xyz) + #:use-module (px packages sentry)) + +(define-public acsccid + (package + (name "acsccid") + (version "1.1.8") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/acshk/acsccid/archive/v" version ".tar.gz")) + (sha256 + (base32 + "1ip7lrhnrnag96x29lfpb663i2y6y0631p7i14sialkz1sr5xlb8")))) + (build-system gnu-build-system) + (arguments + `(#:configure-flags (list (string-append "--enable-usbdropdir=" + %output "/pcsc/drivers")) + #:phases + (modify-phases %standard-phases + (add-after 'configure 'patch-Makefile + (lambda _ + (substitute* "src/Makefile.in" + (("/bin/echo") (which "echo"))) + #t))))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("flex" ,flex) + ("gettext" ,gettext-minimal) + ("libtool" ,libtool) + ("pcsc-lite" ,pcsc-lite) ; only required for headers + ("perl" ,perl) + ("pkg-config" ,pkg-config))) + (inputs + `(("libusb" ,libusb))) + (home-page "https://github.com/acshk/acsccid") + (synopsis "ACS CCID PC/SC Driver for Linux/Mac OS X") + (description + "acsccid is a PC/SC driver for Linux/Mac OS X and it supports ACS CCID smart card +readers. This library provides a PC/SC IFD handler implementation and +communicates with the readers through the PC/SC Lite resource manager (pcscd).") + (license license:lgpl2.1+))) + +(define-public id-card-reader + (package + (name "id-card-reader") + (version "0.1.26") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "1irmxkgcjd61c36r25fydjpaw9sgvg4phbg6gcrwc71wcpl7ap9x")))) + (build-system python-build-system) + (arguments + `(#:tests? #f)) + (inputs + `(("python-pillow" ,python-pillow) + ("python-pyscard" ,python-pyscard))) + (home-page "https://www.pantherx.org/") + (synopsis " ") + (description " ") + (license license:expat))) + + diff --git a/px/packages/sentry.scm b/px/packages/sentry.scm new file mode 100644 index 0000000..1c75ea3 --- /dev/null +++ b/px/packages/sentry.scm @@ -0,0 +1,38 @@ +;;; Settings Packages Module for PantherX +;;; Author: Hamzeh Nasajpour (h.nasajpour@pantherx.org) +;;; + +(define-module (px packages sentry) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (guix utils) + #:use-module (gnu packages curl) + #:use-module (gnu packages pkg-config)) + +(define-public sentry + (package + (name "sentry") + (version "0.6.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/getsentry/sentry-native") + (commit version) + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 (base32 "1rd069j2jrqaj67l32p005jmlfah6blcxrca7h2kqgc8nv33pd6j")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f)) + (inputs `(("curl" ,curl))) + (native-inputs `( + ("pkg-config" ,pkg-config))) + (home-page "https://github.com/getsentry/sentry-native") + (synopsis "Official Sentry SDK for C/C++") + (description "The Sentry Native SDK is an error and crash reporting client +for native applications, optimized for C and C++.") + (license license:expat)))
\ No newline at end of file diff --git a/px/packages/settings.scm b/px/packages/settings.scm new file mode 100644 index 0000000..2e4f4c6 --- /dev/null +++ b/px/packages/settings.scm @@ -0,0 +1,420 @@ +;;; Settings Packages Module for PantherX +;;; +;;; Hamzeh Nasajpour <h.nasajpour@pantherx.org> +;;; Reza Alizadeh Majd <r.majd@pantherx.org> +;;; Franz Geffke <franz@pantherx.org> +;;; + +(define-module (px packages settings) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (guix build-system gnu) + #:use-module (guix build-system trivial) + #:use-module (guix build-system python) + #:use-module (guix utils) + #:use-module (gnu packages aidc) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages guile-xyz) + #:use-module (gnu packages lxqt) + #:use-module (gnu packages python) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages serialization) + #:use-module (gnu packages xorg) + #:use-module (gnu packages qt) + #:use-module (px packages accounts) + #:use-module (px packages backup) + #:use-module (px packages clawsmail) + #:use-module (px packages common) + #:use-module (px packages library) + #:use-module (px packages common)) + +(define-public px-settings-ui + (package + (name "px-settings-ui") + (version "v0.7.3") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 + (base32 + "04qd4vwjmz06idrbcfi4npwf442mvwvzyq1adkqzbd9qxc3dcnvc")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f)) + (inputs `(("qrencode" ,qrencode) + ("yaml-cpp" ,yaml-cpp) + ("capnproto" ,capnproto-0.9))) + (native-inputs `( + ("pkg-config" ,pkg-config) + ("qtbase" ,qtbase-5) + ("qtcharts" ,qtcharts) + ("libqtxdg" ,libqtxdg) + ("liblxqt" ,liblxqt) + ("python" ,python) + ("px-gui-library" ,px-gui-library) + ("pybind11" ,pybind11))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Settings GUI Application") + (description "This package provides a QT-GUI to manage change +various settings around PantherX OS") + (license license:gpl3))) + + +(define-public px-settings-service + (package + (name "px-settings-service") + (version "v0.2.5") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 + (base32 + "0r16z52mc01vr04a2qa2irmxxxf1dhi4nmsrhvldc788qc7nxclc")))) + (build-system cmake-build-system) + (arguments + `( + #:tests? #f)) + (inputs `( + ("yaml-cpp", yaml-cpp) + ("capnproto", capnproto-0.9))) + (native-inputs `( + ("pkg-config", pkg-config) + ("python", python) + ("pybind11", pybind11))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Settings Service") + (description "This package provides background services to manage +Configuration in PantherX") + (license license:expat))) + +(define-public px-settings-service-plugin-accounts + (package + (name "px-settings-service-plugin-accounts") + (version "v0.1.11") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 + (base32 + "18w3zmf3vgb8vpa66g4ggph7r4h2yxw0vf6v3md83yz9hq51p74c")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "cpp") + (regpath (string-append out "/etc/px/settings/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "/lib/lib" ,name ".so\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ + (format #t regdata))) + ))) + ))) + (inputs `( + ("yaml-cpp", yaml-cpp) + ("capnproto", capnproto-0.9))) + (native-inputs `( + ("pkg-config", pkg-config))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Accounts Plugin For Settings service") + (description "Accounts Plugin for Settings service, this plugin used for add/remove/edit accounts in PantherX.") + (license license:expat))) + + +(define-public px-settings-service-plugin-cpp-test + (package + (name "px-settings-service-plugin-cpp-test") + (version "v0.0.3") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 + (base32 + "0dlg9wh5g86r4f0000wyd3fraqjqdj32v7ri75rzsg31n8kbfcsr")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "cpp") + (regpath (string-append out "/etc/px/settings/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "/lib/lib" ,name ".so\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ + (format #t regdata))) + ))) + ))) + (home-page "https://www.pantherx.org/") + (synopsis "CPP Test Plugin For Settings service") + (description "Test Plugin for Settings service, this plugin needs + to be installed in order to tests run properly.") + (license license:expat))) + +(define-public px-settings-service-plugin-python-test + (package + (name "px-settings-service-plugin-python-test") + (version "v0.1.2") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 + (base32 + "0cl6g5qcnf1ysvqjhnfcckahvpxl1rvjy5ld95vanvbmvys6pxqr")))) + (build-system python-build-system) + (inputs `(("python-pycapnp", python-pycapnp))) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/settings/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ + (format #t regdata))) + ))) + ))) + (home-page "https://www.pantherx.org/") + (synopsis "Python Test Plugin For Settings service") + (description "Test Plugin for Settings service, this plugin needs + to be installed in order to tests run properly.") + (license license:expat))) + +(define-public px-settings-service-plugin-software + (package + (name "px-settings-service-plugin-software") + (version "v0.0.15") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 + (base32 + "0n518ip7psc6h0a2dqwhljychqyx0x9zss3l4hdisl7jfrzgzar1")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/settings/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ + (format #t regdata))) + ))) + ))) + (home-page "https://www.pantherx.org/") + (synopsis "Software Plugin For Settings service") + (description "Software/ update check preferences plugin.") + (license license:expat))) + +(define-public px-settings-service-plugin-theme + (package + (name "px-settings-service-plugin-theme") + (version "0.0.22") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 + (base32 + "1xxw0r7idjrpnlyndrqdn6637a58zqbw8qv8k0yf3sq2yrb18k22")))) + (build-system python-build-system) + (propagated-inputs `( + ("python-pyxdg" ,python-pyxdg) + ("python-configobj", python-configobj) + ("claws-mail-theme-breeze", claws-mail-theme-breeze))) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/settings/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ + (format #t regdata))) + ))) + ))) + (home-page "https://www.pantherx.org/") + (synopsis "Desktop Theme Plugin For Settings service") + (description "Desktop Theme/Appereance plugin.") + (license license:expat))) + +(define-public px-settings-service-plugin-desktop-search + (package + (name "px-settings-service-plugin-desktop-search") + (version "0.0.20") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 + (base32 + "1mxq6avh826aln0x4x7i78i8zzsn84sak754wbjd7n3ba28qq1kr")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/settings/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ + (format #t regdata))) + ))) + ))) + (home-page "https://www.pantherx.org/") + (synopsis "Desktop Search Plugin For Settings service") + (description "Desktop Search Settings plugin.") + (license license:expat))) + +(define-public px-settings-service-plugin-backup + (package + (name "px-settings-service-plugin-backup") + (version "0.1.0") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 + (base32 + "1nix2hn8acipdysyz9vgz2akd9j2hpjnilbdwgxvsw80bxxd8b68")))) + (build-system python-build-system) + (propagated-inputs `( + ("px-accounts-library-python", px-accounts-library-python) + ("px-backup", px-backup))) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/settings/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ + (format #t regdata))) + ))) + ))) + (home-page "https://www.pantherx.org/") + (synopsis "Backup Plugin For Settings service") + (description "Backup Settings plugin.") + (license license:expat))) + +(define-public px-settings-service-plugin-maintenance + (package + (name "px-settings-service-plugin-maintenance") + (version "v0.0.1") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 + (base32 + "0rvnhv2lw3n9wchp61lfw2g1z31whizmd6n74cih2ncafcb0bdbf")))) + (build-system python-build-system) + (propagated-inputs `( + ("python-pyxdg" ,python-pyxdg))) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/settings/plugins")) + (regdata (string-append "plugin:\n" + " name: " ,name "\n" + " version: " ,version "\n" + " type: " type "\n" + " path: " out "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ + (format #t regdata))) + ))) + ))) + (home-page "https://www.pantherx.org/") + (synopsis "Maintenance Plugin For Settings service") + (description "Maintenance Plugin For Settings service.") + (license license:expat))) diff --git a/px/packages/setup.scm b/px/packages/setup.scm new file mode 100644 index 0000000..307f0f1 --- /dev/null +++ b/px/packages/setup.scm @@ -0,0 +1,271 @@ +;;; Setup Packages Module for PantherX +;;; Author: Hamzeh Nasajpour (h.nasajpour@pantherx.org) +;;; + +(define-module (px packages setup) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (guix build-system python) + #:use-module (guix gexp) + #:use-module (guix utils) + #:use-module (gnu packages admin) + #:use-module (gnu packages base) + #:use-module (gnu packages boost) + #:use-module (gnu packages gettext) + #:use-module (gnu packages kde) + #:use-module (gnu packages kde-frameworks) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages polkit) + #:use-module (gnu packages qt) + #:use-module (gnu packages serialization) + #:use-module (gnu packages web) + #:use-module (gnu packages python) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages python-web) + #:use-module (gnu packages time) + #:use-module (gnu packages xorg) + #:use-module (px packages common)) + +(define-public px-first-login-welcome-screen + (package + (name "px-first-login-welcome-screen") + (version "0.0.4") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_"; + version + ".tgz")) + (sha256 + (base32 "1av540acbwpn7ccc790bifmndfx7kscx6y7y1nqln6cmmazvzfvn")))) + (build-system cmake-build-system) + (arguments + '(#:tests? #f ; no tests + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-chpasswd-path + (lambda* (#:key inputs #:allow-other-keys) + (let ((shadow (assoc-ref inputs "shadow"))) + (substitute* "helper/px-first-login-password-helper.cpp" + (("chpasswd") + (string-append shadow "/sbin/chpasswd"))) + #t)))))) + (inputs + `(("qtbase" ,qtbase-5) + ("qtlinguist" ,qttools-5) + ("capnproto" ,capnproto-0.9) + ("polkit-qt" ,polkit-qt) + ("shadow" ,shadow))) + (propagated-inputs + `(("pkg-config" ,pkg-config))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Setup Assistant") + (description "This package provides cli and gui applications for Setup PantherX Devices") + (license license:gpl3))) + +(define-public px-setup-assistant + (package + (name "px-setup-assistant") + (version "v0.2.4") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/px-setup-assistant_" + version + ".tgz")) + (sha256 + (base32 "0fkcldxrr6j3ig9b26ar7c11h9xqrrdb9cn0gj9fb63lhdv0zac5")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'set-executable + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (invoke "chmod" "755" (string-append out "/bin/px-setup")) + #t)))))) + (inputs + `(("qtbase" ,qtbase-5) + ("qtlinguist" ,qttools-5) + ("rapidjson" ,rapidjson) + ("yaml-cpp" ,yaml-cpp))) + (propagated-inputs + `(("tzdata" ,tzdata))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Setup Assistant") + (description "This package provides cli and gui applications for Setup PantherX Devices") + (license license:gpl3))) + +(define-public px-install + (package + (name "px-install") + (version "0.1.0") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "132gnl6hxjm2zqf0sdcg0jy2kqd6bspcnmfnlkzf1wb9vz8kr0jm")))) + (build-system python-build-system) + (arguments + `(#:tests? #f)) + (inputs + `(("python-requests" ,python-requests) + ("python-tqdm" ,python-tqdm) + ("python-pytz" ,python-pytz) + ("python-qrcode" ,python-qrcode) + ("python-py-cpuinfo" ,python-py-cpuinfo) + ("python-urllib3" ,python-urllib3) + ("python-psutil" ,python-psutil))) + (native-inputs + `(("pkg-config" ,pkg-config))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX OS Installer") + (description "A command line driven installer with sane defaults.") + (license license:gpl3))) + + +(define-public calamares + (package + (name "calamares") + (version "3.2.61") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/calamares/" name "/releases/download/v" version + "/" name "-" version ".tar.gz")) + (sha256 + (base32 "1lhxf4rbii8ss86ny03an1nh08dbc9admf72kmxvmg9q0yvbk4bm")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:configure-flags + '("-DINSTALL_CONFIG=ON") + #:phases + (modify-phases + %standard-phases + (add-after 'unpack 'patch-source + (lambda _ + (let* ((out (assoc-ref %outputs "out")) + (zonefile (string-append (assoc-ref %build-inputs "tzdata") + "/share/zoneinfo/zone.tab")) + (xkb-file (string-append (assoc-ref %build-inputs "xkeyboard-config") + "/share/X11/xkb/rules/base.lst"))) + ;; patch polkit rules path + (substitute* "CMakeLists.txt" + (("DESTINATION \"\\$\\{POLKITQT-1_POLICY_FILES_INSTALL_DIR\\}") + "DESTINATION \"share/polkit-1/actions")) + ;; fix zone file path + (substitute* "src/libcalamares/locale/TimeZone.cpp" + (("/usr/share/zoneinfo/zone.tab") zonefile)) + ;; fix keyboard layout path + (substitute* "src/modules/keyboard/keyboardwidget/keyboardglobal.cpp" + (("/usr/share/X11/xkb/rules/base.lst") xkb-file)) + ;; settings.conf preparations + (call-with-output-file "settings.conf" + (lambda (port) + (format port "--- +modules-search: [ local ] +sequence: +- show: + - welcome + - locale + - keyboard + - summary +- show: + - finished +branding: default +prompt-install: false +dont-chroot: false +oem-setup: false +disable-cancel: false +disable-cancel-during-exec: false +hide-back-and-next-during-exec: false +quit-at-end: false\n"))) + #t)))))) + (native-inputs + (list boost + extra-cmake-modules + pkg-config)) + (inputs + (list + kcrash + kcoreaddons + kdbusaddons + kparts + kservice + kwidgetsaddons + polkit-qt + python + python-jsonschema + python-pyyaml + qtbase-5 + qtdeclarative-5 + qtquickcontrols-5 + qtquickcontrols2-5 + qtsvg-5 + qttools-5 + tzdata + xkeyboard-config + yaml-cpp)) + (propagated-inputs (list python)) + (home-page "https://calamares.io") + (synopsis " Distribution-independent installer framework ") + (description "Calamares is a distribution-independent system installer, +with an advanced partitioning feature for both manual and automated partitioning +operations. Calamares is designed to be customizable by distribution maintainers +without need for cumbersome patching, thanks to third party branding and external +modules support.") + (license license:gpl3))) + + +(define-public px-install-gui + (package + (inherit calamares) + (name "px-install-gui") + (version "3.2.61-b1") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 (base32 "1vdylrdkbvfq03i8rbzkamrjvg497j8zqlqwhvdkywqpazwgp8r9")))) + (arguments + (substitute-keyword-arguments (package-arguments calamares) + ((#:phases phases) + #~(modify-phases #$phases + (add-after 'patch-source 'setup-installer + (lambda _ + (call-with-output-file "settings.conf" + (lambda (port) + (format port "--- +modules-search: [ local ] +sequence: +- show: + - welcome + - locale + - packagechooser + - users + - summary +- exec: + - px-install +- show: + - finished +branding: default +prompt-install: false +dont-chroot: false +oem-setup: false +disable-cancel: false +disable-cancel-during-exec: false +hide-back-and-next-during-exec: false +quit-at-end: false\n"))))))))) + (propagated-inputs + (list python + python-requests + python-tqdm + python-pytz + python-qrcode + python-py-cpuinfo + python-urllib3)))) diff --git a/px/packages/sof.scm b/px/packages/sof.scm new file mode 100644 index 0000000..2ec7160 --- /dev/null +++ b/px/packages/sof.scm @@ -0,0 +1,88 @@ +(define-module (px packages sof) + #:use-module (gnu packages) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix build-system gnu) + #:use-module (guix build-system trivial) + #:use-module (gnu packages autotools) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages bison) + #:use-module (gnu packages bootstrap) + #:use-module (gnu packages curl) + #:use-module (gnu packages check) + #:use-module (gnu packages commencement) + #:use-module (gnu packages compression) + #:use-module (gnu packages docbook) + #:use-module (gnu packages documentation) + #:use-module (gnu packages dns) + #:use-module (gnu packages flex) + #:use-module (gnu packages gettext) + #:use-module (gnu packages glib) + #:use-module (gnu packages graphviz) + #:use-module (gnu packages gtk) + #:use-module (gnu packages libusb) + #:use-module (gnu packages linux) + #:use-module (gnu packages m4) + #:use-module (gnu packages man) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages networking) + #:use-module (gnu packages cyrus-sasl) + #:use-module (gnu packages gawk) + #:use-module (gnu packages popt) + #:use-module (gnu packages readline) + #:use-module (gnu packages tls) + #:use-module (gnu packages tex) + #:use-module (gnu packages texinfo) + #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages python-crypto) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages security-token) + #:use-module (gnu packages swig) + #:use-module (gnu packages web) + #:use-module (gnu packages xml) + #:use-module (px packages python-xyz)) + +(define-public sof-bin + (package + (name "sof-bin") + (version "1.5.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/thesofproject/sof-bin") + (commit "a06502dfe1d6d7c00fa355788430dab7527dc829") + (recursive? #t))) + (sha256 + (base32 "17bl463qm01d534fld7gb4cd658y0hyzd1p3vvj7n08k8ggp8q9y")) + (file-name (git-file-name name version)))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils) + (srfi srfi-26)) + (let* ((source (assoc-ref %build-inputs "source")) + (bash (assoc-ref %build-inputs "bash")) + (lib-dir (string-append %output "/lib/firmware"))) + (mkdir-p lib-dir) + (setenv "PATH" (string-append + (string-append bash "/bin:"))) + (copy-recursively source ".") + (substitute* "go.sh" (("\\$\\{ROOT\\}") %output)) + (substitute* "go.sh" (("\\$\\{VERSION\\}") ,version)) + (invoke "./go.sh") + #t)))) + (inputs `(("bash" ,bash))) + (home-page "https://thesofproject.github.io") + (synopsis "SOF Firmware and Topology Binaries.") + (description + "This is the living area and distribution channel for SOF firmware and topology binaries. It's still very much WiP and may churn a little until things settle down.") + (license license:lgpl2.1+))) + diff --git a/px/packages/software.scm b/px/packages/software.scm new file mode 100644 index 0000000..27cf8ff --- /dev/null +++ b/px/packages/software.scm @@ -0,0 +1,90 @@ +;;; Software Application for PantherX +;;; Author: Reza Alizadeh Majd (r.majd@pantherx.org) + +(define-module (px packages software) + #:use-module (guix build-system cmake) + #:use-module (guix build-system trivial) + #:use-module (guix download) + #:use-module (guix utils) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages compression) + #:use-module (gnu packages databases) + #:use-module (gnu packages gcc) + #:use-module (gnu packages guile) + #:use-module (gnu packages qt) + #:use-module (px packages library) + #:use-module (gnu packages serialization)) + + +(define-public px-software-assets-meta + (package + (name "px-software-assets-meta") + (version "0.1.6") + (source (origin + (method url-fetch) + (uri (string-append "https://assets.software.pantherx.org/px-software-assets_meta_" version ".tgz")) + (sha256 + (base32 + "0wd4gnsy9sw3cbm8b587qkscap7ljr0hbg6hk2c7pjy69rq0q5nr")))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils) + (srfi srfi-26)) + (let* ((source (assoc-ref %build-inputs "source")) + (tar (assoc-ref %build-inputs "tar")) + (gzip (assoc-ref %build-inputs "gzip")) + (wiki-dir (string-append %output "/share/px-software-assets-meta"))) + (mkdir-p wiki-dir) + (setenv "PATH" (string-append gzip "/bin")) + (invoke (string-append tar "/bin/tar") "xvf" source "-C" wiki-dir))))) + (native-inputs `(("tar" ,tar) + ("gzip" ,gzip))) + (inputs `(("bash" ,bash))) + (home-page "https://git.pantherx.org/development/applications/px-software-assets/") + (synopsis "PantherX Software Assets meta file.") + (description + "PantherX Software Assets meta file.") + (license license:expat))) + +(define-public px-software + (package + (name "px-software") + (version "0.3.7") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-software_v" + version + ".tgz")) + (sha256 (base32 "069hcfw6jm3yhb04n16yma9nh7zlm11szw0an6zhraz3rigr1w8w")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'set-executable + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (invoke "chmod" "755" (string-append out "/bin/px-software-update-check")) + #t)))))) + (inputs + `(("yaml-cpp" ,yaml-cpp))) + (native-inputs + `(("guile" ,guile-3.0-latest) + ("recutils" ,recutils) + ("px-gui-library" ,px-gui-library) + ("qtbase" ,qtbase-5) + ("qtlinguist" ,qttools-5) + ("zlib" ,zlib) + )) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Software") + (description "Software Application for PantherX") + (license license:gpl3))) + diff --git a/px/packages/tarsnap.scm b/px/packages/tarsnap.scm new file mode 100644 index 0000000..fc27af7 --- /dev/null +++ b/px/packages/tarsnap.scm @@ -0,0 +1,55 @@ +(define-module (px packages tarsnap) + #:use-module (gnu packages) + #:use-module (gnu packages autotools) + #:use-module (gnu packages compression) + #:use-module (gnu packages linux) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages tls) + #:use-module (guix build-system gnu) + #:use-module (guix download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages)) + +(define-public tarsnap + (package + (name "tarsnap") + (version "1.0.39") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/Tarsnap/tarsnap/archive/" + version ".tar.gz")) + (sha256 + (base32 "0b91k0sg64nxidvgzpip5a1rz0cwmygsfr13ac1q7zmd59iz1cz2")) + (patches + (search-patches "tarsnap-do-not-use-command-p-in-makefile.patch")))) + ;; This official release includes a configure script but it will + ;; try to invoke sh and that will not be found. Therefore it is + ;; necessary to build the configure script with autoconf. + #; + (source + (origin + (method url-fetch) + (uri (string-append "https://www.tarsnap.com/download/tarsnap-autoconf-" + version ".tgz")) + (sha256 + (base32 "10i0whbmb345l2ggnf4vs66qjcyf6hmlr8f4nqqcfq0h5a5j24sn")))) + (build-system gnu-build-system) + (inputs `(("openssl" ,openssl) + ("zlib" ,zlib) + ("e2fsprogs" ,e2fsprogs))) + (native-inputs `(("autoconf" ,autoconf) + ("autoconf-archive" ,autoconf-archive) + ;; necessary? I think this is added by the build system + ("automake" ,automake) + ("pkg-config" ,pkg-config))) + (home-page "https://www.tarsnap.com/") + (synopsis + "Tarsnap is a secure, efficient online backup service: \"Online backups for + the truly paranoid\".") + (description #f) + ;; See COPYING + (license #f))) + +;; TODO: unbundle diff --git a/px/packages/themes.scm b/px/packages/themes.scm new file mode 100644 index 0000000..fd3c757 --- /dev/null +++ b/px/packages/themes.scm @@ -0,0 +1,305 @@ +;;; Theme Packages Module for PantherX +;;; Author: Hamzeh Nasajpour (h.nasajpour@pantherx.org) +;;; + +(define-module (px packages themes) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (guix build-system cmake) + #:use-module (guix build-system meson) + #:use-module (guix build-system trivial) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) + #:use-module (gnu packages gnupg) + #:use-module (gnu packages gtk) + #:use-module (gnu packages kde-frameworks) + #:use-module (gnu packages kde-plasma) + #:use-module (gnu packages lxqt) + #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages qt) + #:use-module (gnu packages web)) + +(define-public px-widget-style + (package + (name "px-widget-style") + (version "5.19.5-1") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version + ".tgz")) + (sha256 + (base32 "0ihx39li1r266ankc1q4lvv2vfh9hbxjlyjddyy30rir8rbdfilp")))) + (properties `((tags . '("Desktop" "KDE" "Plasma")))) + (build-system cmake-build-system) + (native-inputs + `(("extra-cmake-modules" ,extra-cmake-modules) + ("pkg-config" ,pkg-config))) + ;; TODO: Warning at /gnu/store/…-kpackage-5.34.0/…/KF5PackageMacros.cmake: + ;; warnings during generation of metainfo for org.kde.breezedark.desktop: + ;; Package type "Plasma/LookAndFeel" not found + ;; TODO: Unknown property type for key "X-KDE-ParentApp", + ;; "X-Plasma-MainScript" + (inputs + `(("kcmutils" ,kcmutils) + ("kconfigwidgets" ,kconfigwidgets) + ("kcoreaddons" ,kcoreaddons) + ("kde-frameworkintegration" ,kde-frameworkintegration) + ("kdecoration" ,kdecoration) + ("kguiaddons" ,kguiaddons) + ("ki18n" ,ki18n) + ("kiconthemes" ,kiconthemes) + ("kpackage" ,kpackage) + ("kwayland" ,kwayland) + ("kwindowsystem" ,kwindowsystem) + ("plasma-framework" ,plasma-framework) ; missing in CMakeList.txt + ;;("qtbase" ,qtbase) + ("qtdeclarative" ,qtdeclarative-5) + ("qtx11extras" ,qtx11extras))) + (propagated-inputs + `(("qtbase" ,qtbase-5))) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'configure 'fix-source + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (substitute* "CMakeLists.txt" (("include\\(KDEClangFormat\\)") "#include(KDEClangFormat)")) + (substitute* "CMakeLists.txt" (("kde_clang_format") "#kde_clang_format")) + ;; Fixing the path of kde4breeze to pointing to the store of breeze theme + (substitute* "colors-px/breeze-default-colorscheme.desktop" + (("kde4breeze") (string-append out "/lib/kconf_update_bin/kde4breeze"))) + #t))) + ))) + (home-page "https://kde.org/plasma-desktop") + (synopsis "Default Plasma theme (meta-package)") + (description "Forked version of breeze style theme with additional color-schemes for PantherX.") + (license license:gpl2+))) + +(define-public lxqt-arc-dark-theme + (package + (name "lxqt-arc-dark-theme") + (version "0.0.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.pantherx.org/franz/lxqt-arc-dark-theme") + (commit "928cddad613a4b28f5453e1c2414b6ce0438d9c8"))) + (sha256 + (base32 "0qi5vy2hjkkyydycmpilbig6rwf870n8yjy2knz9jm0y6a2bx07w")) + (file-name (git-file-name name version)))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils) + (srfi srfi-26)) + (let* ((source (assoc-ref %build-inputs "source")) + (theme-dir (string-append %output "/share/lxqt/themes/")) + ) + (mkdir-p (string-append theme-dir "arc-dark")) + (copy-recursively (string-append source "/arc-dark") (string-append theme-dir "arc-dark")) + )))) + (synopsis "LXQt Arc Dark Theme") + (home-page "https://git.pantherx.org/franz/lxqt-arc-dark-theme") + (description "LXQt Theme based on Arc by horst3180 and LXQt dark theme") + (license license:gpl3+))) + +(define-public px-openbox-theme + (package + (name "px-openbox-theme") + (version "0.0.5") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version + ".tgz")) + (sha256 + (base32 "19ir80lknf0lxb3qfy3s0zxl1ly1dxw83d33304zj2zpghd77i37")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f)) + (synopsis "Arc Openbox theme") + (home-page "https://github.com/dglava/arc-openbox") + (description "Openbox theme created to fit in nicely with the Arc GTK theme.") + (license license:gpl3+))) + + +(define-public sddm-darkine-theme + (package + (name "sddm-darkine-theme") + (version "0.0.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Rokin05/darkine-kde.git") + (commit "cd37f809b3f3ca7fd8865e6e91887a26b591c8d3"))) + (sha256 + (base32 "0wfq5ydlmf92y7xj8qad2rjvvicy1f97cd7n3j5i3pmq9pl74zys")) + (file-name (git-file-name name version)))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils) + (srfi srfi-26)) + (let* ((source (assoc-ref %build-inputs "source")) + (theme-dir (string-append %output "/share/sddm/themes/darkine"))) + (mkdir-p theme-dir) + (copy-recursively (string-append source "/sddm/themes/darkine") theme-dir))))) + (home-page "https://github.com/Rokin05/darkine-kde") + (synopsis "SDDM theme from Darkine KDE collection") + (description "SDDM theme from Darkine KDE collection, a pure QtQuick2 based SDDM login theme") + (license license:expat))) + + +(define-public px-sddm-theme + (package + (name "px-sddm-theme") + (version "0.0.1") + (source (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name + "_v" version ".tgz")) + (sha256 + (base32 "1hjyi7mw8rkpkziq8wip2xsy8cwdjcwmyd7wjaq8892yir3rr66q")))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils) + (srfi srfi-26)) + (let ((tar (assoc-ref %build-inputs "tar")) + (gzip (assoc-ref %build-inputs "gzip")) + (src (assoc-ref %build-inputs "source")) + (theme-dir (string-append %output "/share/sddm/themes"))) + (mkdir-p theme-dir) + (setenv "PATH" (string-append gzip "/bin")) + (invoke (string-append tar "/bin/tar") + "xvf" src "-C" theme-dir) + #t)))) + (native-inputs + `(("tar" ,tar) + ("gzip" ,gzip))) + (home-page "https://pantherx.org") + (synopsis "PantherX login theme") + (description "SDDM login theme for PantherX") + (license license:expat))) + + +(define-public chilie-login-theme + (package + (name "chilie-login-theme") + (version "0.1.5") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/MarianArlt/sddm-chili/archive/" + version + ".tar.gz")) + (sha256 + (base32 + "03wswhqp9980blsrhk60jj49gbqmpkij85i71bzqyi0gyxxn1h53")))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils) + (srfi srfi-26)) + (let* ((source (assoc-ref %build-inputs "source")) + (tar (assoc-ref %build-inputs "tar")) + (gzip (assoc-ref %build-inputs "gzip")) + (theme-dir (string-append %output "/share/sddm/themes")) + ) + (mkdir-p theme-dir) + (setenv "PATH" (string-append gzip "/bin")) + (invoke (string-append tar "/bin/tar") "xvf" source "-C" theme-dir) + )))) + (native-inputs `(("tar" ,tar) + ("gzip" ,gzip) + )) + (home-page "https://github.com/MarianArlt/sddm-chili") + (synopsis "Chili login theme for SDDM") + (description "Chili login theme for SDDM.") + (license license:gpl3))) + +(define-public paper-icon-theme + (package + (name "paper-icon-theme") + (version "1.5.0") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/snwh/paper-icon-theme/archive/v." + version + ".tar.gz")) + (sha256 + (base32 + "1klf545hk6g7dx9g0bkblrzd46kz6hr0yj1mqvjq3r7cjpz1vwk2")))) + (build-system meson-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'configure 'disable-post-install + (lambda _ + (substitute* "meson.build" + (("meson.add_install_script.*") ""))))))) + (synopsis "Paper icon theme") + (home-page "https://snwh.org") + (description "Paper is an open source FreeDesktop icon project") + (license license:expat))) + + +(define-public px-lxqt-themes + (package + (name "px-lxqt-themes") + (version "1.3.0-u1") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 + (base32 "06zzwym5id6a2nwwvxki7c4c1c7xf2lq03rm6924gylj047hyj5q")))) + (build-system cmake-build-system) + (native-inputs + `(("lxqt-build-tools" ,lxqt-build-tools) + ("perl" ,perl))) + (arguments + `(#:tests? #f ; no tests + #:phases + (modify-phases %standard-phases + ;; !!! TODO I guess these Variables come from lxqt-build-tools, so maybe it would be better to update this package + ;; instead of these patches. + (add-after 'unpack 'patch-source + (lambda _ + (substitute* '("CMakeLists.txt") + (("DESTINATION \"\\$\\{LXQT_GRAPHICS_DIR\\}") + "DESTINATION \"share/lxqt/graphics")) + (substitute* '("themes/CMakeLists.txt") + (("DESTINATION \"\\$\\{LXQT_SHARE_DIR\\}") + "DESTINATION \"share/lxqt")) + (substitute* '("wallpapers/CMakeLists.txt") + (("DESTINATION \"\\$\\{LXQT_SHARE_DIR\\}") + "DESTINATION \"share/lxqt")) + (substitute* '("palettes/CMakeLists.txt") + (("DESTINATION \"\\$\\{LXQT_SHARE_DIR\\}") + "DESTINATION \"share/lxqt")) + #t))))) + (home-page "https://lxqt-project.org/") + (synopsis "Themes, graphics and icons for LXQt") + (description "This package comprises a number of graphic files and themes +for LXQt.") + ;; The whole package is released under LGPL 2.1+, while the LXQt logo is + ;; licensed under CC-BY-SA 3.0. + (license license:lgpl2.1+))) + diff --git a/px/packages/throttled.scm b/px/packages/throttled.scm new file mode 100644 index 0000000..48aeaa1 --- /dev/null +++ b/px/packages/throttled.scm @@ -0,0 +1,83 @@ +;;; throttled PantherX +;;; Author: Hamzeh Nasajpour (h.nasajpour@pantherx.org) +;;; + +(define-module (px packages throttled) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (guix build-system trivial) + #:use-module (gnu packages bash) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) + #:use-module (gnu packages glib) + #:use-module (gnu packages python) + #:use-module (gnu packages python-xyz)) + + (define-public throttled + (package + (name "throttled") + (version "0.8.0") + (source (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/throttled_v" version ".tgz")) + (sha256 + (base32 + "0xqdsrkn00vywqm8y7rv141ip7psajrq7g92c9ph4d134lfqclnp")))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils) + (srfi srfi-26)) + (let* ((source (assoc-ref %build-inputs "source")) + (bash (assoc-ref %build-inputs "bash")) + (coreutils (assoc-ref %build-inputs "coreutils")) + (dbus (assoc-ref %build-inputs "dbus")) + (gzip (assoc-ref %build-inputs "gzip")) + (python (assoc-ref %build-inputs "python")) + (python-dbus(assoc-ref %build-inputs "python-dbus")) + (python-pygo(assoc-ref %build-inputs "python-pygobject")) + (pythonpath (string-append "/lib/python" ,(version-major+minor (package-version python)) "/site-packages:")) + (tar (assoc-ref %build-inputs "tar")) + (bin-dir (string-append %output "/bin")) + (etc-dir (string-append %output "/etc/throttled")) + (python-dir (string-append %output "/python")) + (root-dir "throttled") + (bin-script (string-append root-dir "/runit/lenovo_fix/run")) + (py-script (string-append root-dir "/lenovo_fix.py"))) + (mkdir-p bin-dir) + (mkdir-p etc-dir) + (mkdir-p python-dir) + (setenv "PATH" (string-append + (string-append bash "/bin:") + (string-append coreutils "/bin:") + (string-append gzip "/bin:") + (string-append tar "/bin:"))) + (invoke "tar" "xvf" source) + (invoke "cp" (string-append root-dir "/etc/lenovo_fix.conf") (string-append etc-dir "/default.conf")) + (invoke "cp" (string-append root-dir "/mmio.py") python-dir) + (substitute* py-script (("/etc/throttled") etc-dir)) + (invoke "cp" py-script python-dir) + (substitute* bin-script (("/opt/lenovo_fix/venv") python)) + (substitute* bin-script (("/opt/lenovo_fix/lenovo_fix.py") (string-append python-dir "/lenovo_fix.py" " $@"))) + (invoke "mv" bin-script (string-append bin-dir "/throttled")) + (wrap-program (string-append bin-dir "/throttled") + `("PYTHONPATH" ":" prefix (,(string-append python-dbus pythonpath)))) + (wrap-program (string-append bin-dir "/throttled") + `("PYTHONPATH" ":" prefix (,(string-append python-pygo pythonpath)))) + + #t)))) + (native-inputs `(("coreutils" ,coreutils) + ("gzip" ,gzip) + ("python" ,python) + ("tar" ,tar))) + (inputs `(("bash" ,bash) + ("python-dbus" ,python-dbus) + ("python-pygobject" ,python-pygobject))) + (home-page "https://github.com/erpalma/throttled") + (synopsis "Fix Intel CPU Throttling on Linux") + (description + "This tool was originally developed to fix Linux CPU throttling issues affecting Lenovo T480 / T480s / X1C6.") + (license license:expat))) diff --git a/px/packages/time-tracking.scm b/px/packages/time-tracking.scm new file mode 100644 index 0000000..ba5c999 --- /dev/null +++ b/px/packages/time-tracking.scm @@ -0,0 +1,102 @@ +;;; Time Tracking Packages Module for PantherX +;;; Author: Fakhri Sajadi (f.sajadi@pantherx.org) +;;; + +(define-module (px packages time-tracking) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (guix build-system python) + #:use-module (guix utils) + #:use-module (gnu packages compression) + #:use-module (gnu packages sqlite) + #:use-module (gnu packages networking) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages serialization) + #:use-module (gnu packages qt) + #:use-module (px packages common) + #:use-module (px packages dav) + #:use-module (px packages databases) + #:use-module (px packages library) + #:use-module (px packages python-xyz) + #:use-module (px packages hub) + #:use-module (guix gexp)) + + +(define-public px-time-tracking + (package + (name "px-time-tracking") + (version "0.0.7") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/px-time-tracking_" version ".tgz")) + (sha256 + (base32 + "0d34fp4vzxh191ilp19m4ms91zxr2pdsah0wcb98vsw8hi8wf71w")))) + (build-system cmake-build-system) + (arguments + `( + #:tests? #f)) + (inputs `( + ("sqlite" ,sqlite) + ("sqlitecpp" ,sqlitecpp) + ("zlib" ,zlib) + ("yaml-cpp" ,yaml-cpp) + ("capnproto" ,capnproto-0.9) + ("qtcharts" ,qtcharts) + ("qtbase" ,qtbase-5))) + (native-inputs `( + ("pkg-config" ,pkg-config) + ("python" ,python) + ("px-gui-library" ,px-gui-library) + ("pybind11" ,pybind11))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX Time Tracking Service") + (description "This package provides background services to tracking time spend on issues in PantherX") + (license license:expat))) + + +(define-public px-time-tracking-plugin-gitlab + (package + (name "px-time-tracking-plugin-gitlab") + (version "0.0.3") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 (base32 "1qq9pdmyj0ar6l8m49n7n3bmzjfbxim7h3wjvg9znizz6lm2hw98")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'register-plugin + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (type "python") + (regpath (string-append out "/etc/px/time-tracking/plugins")) + (regdata (string-append "plugin:" + "\n name: " ,name + "\n version: " ,version + "\n type: " type + "\n path: " out + "\n"))) + (display regdata) + (mkdir-p regpath) + (with-output-to-file (string-append regpath "/" ,name ".yaml") + (lambda _ (format #t regdata)))))) + (delete 'sanity-check)))) + (propagated-inputs + `(("px-hub-service-plugin-common", px-hub-service-plugin-common) + ("px-online-sources-library", px-online-sources-library))) + (home-page "https://www.pantherx.org/") + (synopsis "GitLab plugin for PantherX Time Tracking Service") + (description "Adds support to retrieve data from GitLab API.") + (license license:expat))) diff --git a/px/packages/tls.scm b/px/packages/tls.scm new file mode 100644 index 0000000..65b8829 --- /dev/null +++ b/px/packages/tls.scm @@ -0,0 +1,174 @@ +(define-module (px packages tls) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix build-system gnu) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (gnu packages) + #:use-module (gnu packages base) + #:use-module (gnu packages perl)) + + +(define-public openssl-1.0 + (package + (name "openssl") + (version "1.0.2u") + (source (origin + (method url-fetch) + (uri (list (string-append "https://www.openssl.org/source/openssl-" + version ".tar.gz") + (string-append "ftp://ftp.openssl.org/source/" + "openssl-" version ".tar.gz") + (string-append "ftp://ftp.openssl.org/source/old/" + (string-trim-right version char-set:letter) + "/openssl-" version ".tar.gz"))) + (patches (search-patches "openssl-runpath.patch" + "openssl-c-rehash-in.patch")) + (sha256 + (base32 + "05lxcs4hzyfqd5jn0d9p0fvqna62v2s4pc9qgmq0dpcknkzwdl7c")))) + (build-system gnu-build-system) + (outputs '("out" + "doc" ;1.5MiB of man3 pages + "static")) ;6MiB of .a files + (native-inputs (list perl)) + (arguments + `(#:parallel-tests? #f + #:test-target "test" + + ;; Changes to OpenSSL sometimes cause Perl to "sneak in" to the closure, + ;; so we explicitly disallow it here. + #:disallowed-references ,(list (canonical-package perl)) + #:phases + ,#~ + (modify-phases %standard-phases + #$@(if (%current-target-system) + #~((add-before + 'configure 'set-cross-compile + (lambda* (#:key target #:allow-other-keys) + (setenv "CROSS_COMPILE" (string-append target "-")) + (setenv "CONFIGURE_TARGET_ARCH" + #$(target->openssl-target + (%current-target-system)))))) + #~()) + ;; This test seems to be dependant on kernel features. + ;; https://github.com/openssl/openssl/issues/12242 + #$@(if (or (target-arm?) + (target-riscv64?)) + #~((replace 'check + (lambda* (#:key tests? test-target #:allow-other-keys) + (when tests? + (invoke "make" "TESTS=-test_afalg" test-target))))) + #~()) + (replace 'configure + ;; Override this phase because OpenSSL 1.0 does not understand -rpath. + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (invoke #$@(if (%current-target-system) + #~("./Configure") + #~("./config")) + "shared" ;build shared libraries + "--libdir=lib" + + ;; The default for this catch-all directory is + ;; PREFIX/ssl. Change that to something more + ;; conventional. + (string-append "--openssldir=" out + "/share/openssl-" #$version) + + (string-append "--prefix=" out) + #$@(if (%current-target-system) + '((getenv "CONFIGURE_TARGET_ARCH")) + '()))))) + (add-after 'install 'move-static-libraries + (lambda _ + ;; Move static libraries to the "static" output. + (let* ((out #$output) + (lib (string-append out "/lib")) + (static #$output:static) + (slib (string-append static "/lib"))) + (for-each (lambda (file) + (install-file file slib) + (delete-file file)) + (find-files lib "\\.a$"))))) + (add-after 'install 'move-extra-documentation + (lambda _ + ;; Move man pages and full HTML documentation to "doc". + (let* ((out #$output) + (man (string-append out "/share/man")) + (html (string-append out "/share/doc/openssl")) + (doc #$output:doc) + (man-target (string-append doc "/share/man")) + (html-target (string-append doc "/share/doc/openssl"))) + (mkdir-p (dirname man-target)) + (mkdir-p (dirname html-target)) + (rename-file man man-target) + (rename-file html html-target)))) + (add-after 'install 'remove-miscellany + (lambda _ + ;; The 'misc' directory contains random undocumented shell and Perl + ;; scripts. Remove them to avoid retaining a reference on Perl. + (delete-file-recursively (string-append #$output "/share/openssl-" + #$(package-version this-package) + "/misc")))) + (add-before 'patch-source-shebangs 'patch-tests + (lambda* (#:key inputs native-inputs #:allow-other-keys) + (let ((bash (assoc-ref (or native-inputs inputs) "bash"))) + (substitute* (find-files "test" ".*") + (("/bin/sh") + (string-append bash "/bin/sh")) + (("/bin/rm") + "rm")) + #t))) + (add-before 'configure 'patch-Makefile.org + (lambda* (#:key outputs #:allow-other-keys) + ;; The default MANDIR is some unusual place. Fix that. + (let ((out (assoc-ref outputs "out"))) + (patch-makefile-SHELL "Makefile.org") + (substitute* "Makefile.org" + (("^MANDIR[[:blank:]]*=.*$") + (string-append "MANDIR = " out "/share/man\n"))) + #t))) + (delete 'move-extra-documentation) + (add-after 'install 'move-man3-pages + (lambda* (#:key outputs #:allow-other-keys) + ;; Move section 3 man pages to "doc". + (let* ((out (assoc-ref outputs "out")) + (man3 (string-append out "/share/man/man3")) + (doc (assoc-ref outputs "doc")) + (target (string-append doc "/share/man/man3"))) + (mkdir-p target) + (for-each (lambda (file) + (rename-file file + (string-append target "/" + (basename file)))) + (find-files man3)) + (delete-file-recursively man3) + #t))) + ;; XXX: Duplicate this phase to make sure 'version' evaluates + ;; in the current scope and not the inherited one. + (replace 'remove-miscellany + (lambda* (#:key outputs #:allow-other-keys) + ;; The 'misc' directory contains random undocumented shell and Perl + ;; scripts. Remove them to avoid retaining a reference on Perl. + (let ((out (assoc-ref outputs "out"))) + (delete-file-recursively (string-append out "/share/openssl-" + #$version "/misc")) + #t))) + ))) + (native-search-paths + (list (search-path-specification + (variable "SSL_CERT_DIR") + (separator #f) ;single entry + (files '("etc/ssl/certs"))) + (search-path-specification + (variable "SSL_CERT_FILE") + (file-type 'regular) + (separator #f) ;single entry + (files '("etc/ssl/certs/ca-certificates.crt"))))) + (synopsis "SSL/TLS implementation") + (description + "OpenSSL is an implementation of SSL/TLS.") + (license license:openssl) + (home-page "https://www.openssl.org/"))) diff --git a/px/packages/tmetric.scm b/px/packages/tmetric.scm new file mode 100644 index 0000000..615bd9b --- /dev/null +++ b/px/packages/tmetric.scm @@ -0,0 +1,106 @@ +(define-module (px packages tmetric) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (guix build-system trivial) + #:use-module (gnu packages bash) + #:use-module (gnu packages bootstrap) + #:use-module (gnu packages commencement) + #:use-module (gnu packages compression) + #:use-module (gnu packages elf) + #:use-module (gnu packages base) + #:use-module (gnu packages glib) + #:use-module (gnu packages gtk) + #:use-module (gnu packages xorg)) + + (define-public tmetric + (package + (name "tmetric") + (version "20.2.4") + (source (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 + (base32 + "0ssw356b6a4z14vw74pdcplz326x6qwxpx6gnwgfg2s004w6raj8")))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils) + (srfi srfi-26)) + (let* ((source (assoc-ref %build-inputs "source")) + (atk (assoc-ref %build-inputs "atk")) + (bash (assoc-ref %build-inputs "bash")) + (cairo (assoc-ref %build-inputs "cairo")) + (coreutils (assoc-ref %build-inputs "coreutils")) + (gdk-pixbuf (assoc-ref %build-inputs "gdk-pixbuf")) + (glib (assoc-ref %build-inputs "glib")) + (gzip (assoc-ref %build-inputs "gzip")) + (gtk (assoc-ref %build-inputs "gtk+")) + (pango (assoc-ref %build-inputs "pango")) + (patchelf (assoc-ref %build-inputs "patchelf")) + (tar (assoc-ref %build-inputs "tar")) + (xz (assoc-ref %build-inputs "xz")) + (libx11 (assoc-ref %build-inputs "libx11")) + (libxss (assoc-ref %build-inputs "libxscrnsaver")) + (ld-so (string-append (assoc-ref %build-inputs "glibc") + ,(glibc-dynamic-linker))) + (bin-dir (string-append %output "/bin"))) + (mkdir-p bin-dir) + (setenv "PATH" (string-append + (string-append bash "/bin:") + (string-append coreutils "/bin:") + (string-append gzip "/bin:") + (string-append patchelf "/bin:") + (string-append tar "/bin:") + (string-append xz "/bin:"))) + (invoke "tar" "xvf" source) + (invoke "tar" "xvf" "tmetric/data.tar.xz") + (substitute* '("usr/share/applications/tmetricdesktop.desktop") + (("Exec=/usr/share/tmetricdesktop/TMetricDesktop") (string-append "Exec=" %output "/bin/tmetric"))) + (copy-recursively "usr" %output) + (invoke "patchelf" "--set-interpreter" ld-so (string-append %output "/share/tmetricdesktop/TMetricDesktop")) + (invoke "ln" "-s" (string-append %output "/share/tmetricdesktop/TMetricDesktop") + (string-append %output "/bin/tmetric")) + (wrap-program (string-append %output "/share/tmetricdesktop/TMetricDesktop") + `("LD_LIBRARY_PATH" ":" prefix (,(string-append gdk-pixbuf "/lib")))) + (wrap-program (string-append %output "/share/tmetricdesktop/TMetricDesktop") + `("LD_LIBRARY_PATH" ":" prefix (,(string-append pango "/lib")))) + (wrap-program (string-append %output "/share/tmetricdesktop/TMetricDesktop") + `("LD_LIBRARY_PATH" ":" prefix (,(string-append glib "/lib")))) + (wrap-program (string-append %output "/share/tmetricdesktop/TMetricDesktop") + `("LD_LIBRARY_PATH" ":" prefix (,(string-append cairo "/lib")))) + (wrap-program (string-append %output "/share/tmetricdesktop/TMetricDesktop") + `("LD_LIBRARY_PATH" ":" prefix (,(string-append libx11 "/lib")))) + (wrap-program (string-append %output "/share/tmetricdesktop/TMetricDesktop") + `("LD_LIBRARY_PATH" ":" prefix (,(string-append gtk "/lib")))) + (wrap-program (string-append %output "/share/tmetricdesktop/TMetricDesktop") + `("LD_LIBRARY_PATH" ":" prefix (,(string-append libxss "/lib")))) + (wrap-program (string-append %output "/share/tmetricdesktop/TMetricDesktop") + `("PATH" ":" prefix (,(string-append gtk "/bin")))) + (wrap-program (string-append %output "/share/tmetricdesktop/TMetricDesktop") + `("LD_LIBRARY_PATH" ":" prefix (,(string-append atk "/lib")))) + #t)))) + (native-inputs `(("coreutils" ,coreutils) + ("cairo" ,cairo) + ("gcc-toolchain" ,gcc-toolchain) + ("glib" ,glib) + ("gdk-pixbuf" ,gdk-pixbuf) + ("gtk+" ,gtk+-2) + ("glibc" ,glibc) + ("libx11" ,libx11) + ("libxscrnsaver" ,libxscrnsaver) + ("gzip" ,gzip) + ("pango" ,pango) + ("patchelf" ,patchelf) + ("tar" ,tar) + ("xz" ,xz))) + (inputs `(("bash" ,bash) + ("zlib" ,zlib))) + (home-page "https://tmetric.com/") + (synopsis "Free Time Tracking Software & App") + (description "TMetric is a simple and accurate work time-tracker +that sets you free from tedious time reporting.") + (license license:expat))) diff --git a/px/packages/tools.scm b/px/packages/tools.scm new file mode 100644 index 0000000..043e382 --- /dev/null +++ b/px/packages/tools.scm @@ -0,0 +1,32 @@ +(define-module (px packages tools) + #:use-module (gnu packages guile) + #:use-module (gnu packages pkg-config) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system cmake) + #:use-module (guix utils)) + + +(define-public guix-tools + (package + (name "guix-tools") + (version "0.1.10") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/guix-tools_v" + version ".tgz")) + (sha256 + (base32 "0b6z2fx5prkibdqsc2n13v322jcl9h29h9g0r67556h21x8f84n8")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f)) + (inputs `(("guile-json", guile-json-1) + ("guile", guile-3.0))) + (native-inputs `(("pkg-config", pkg-config))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX guix tools to automate guix related tasks") + (description "Automate `guix` package manager tasks using scheme scripts. +this tool is developed for PantherX team internal usage.") + (license license:expat))) diff --git a/px/packages/tpm.scm b/px/packages/tpm.scm new file mode 100644 index 0000000..76f9859 --- /dev/null +++ b/px/packages/tpm.scm @@ -0,0 +1,239 @@ +(define-module (px packages tpm) + #:use-module (gnu packages) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix build-system gnu) + #:use-module (guix build-system glib-or-gtk) + #:use-module (guix build-system python) + #:use-module (gnu packages autotools) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages curl) + #:use-module (gnu packages check) + #:use-module (gnu packages docbook) + #:use-module (gnu packages documentation) + #:use-module (gnu packages dns) + #:use-module (gnu packages elf) + #:use-module (gnu packages flex) + #:use-module (gnu packages gettext) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnupg) + #:use-module (gnu packages graphviz) + #:use-module (gnu packages gtk) + #:use-module (gnu packages hardware) + #:use-module (gnu packages libusb) + #:use-module (gnu packages linux) + #:use-module (gnu packages m4) + #:use-module (gnu packages man) + #:use-module (gnu packages networking) + #:use-module (gnu packages cyrus-sasl) + #:use-module (gnu packages popt) + #:use-module (gnu packages readline) + #:use-module (gnu packages serialization) + #:use-module (gnu packages statistics) + #:use-module (gnu packages sqlite) + #:use-module (gnu packages tls) + #:use-module (gnu packages tex) + #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages python-crypto) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages security-token) + #:use-module (gnu packages swig) + #:use-module (gnu packages version-control) + #:use-module (gnu packages web) + #:use-module (gnu packages xml)) + + +(define-public tpm2-tss-openssl-1.1 + (package + (name "tpm2-tss") + (version "3.0.3") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/tpm2-software/tpm2-tss" + "/releases/download/" version "/tpm2-tss-" version + ".tar.gz")) + (sha256 + (base32 "05xynpwq851fp8f5fy7ac0blvz8mr5m5cbqj3gslgbwv63kjnfbq")))) + (build-system gnu-build-system) + (native-inputs + (list pkg-config)) + (inputs + (list curl json-c openssl-1.1)) + (home-page "https://tpm2-software.github.io/") + (synopsis "OSS Implementation of the TCG TPM2 Software Stack (TSS2)") + (description + "This package provides the @acronym{TCG, Trusted Computing Group} +@acronym{TSS2, TPM2 Software Stack}. The stack contains libtss2-fapi, +libtss2-esys, libtss2-sys, libtss2-mu, libtss2-tcti-device, libtss2-tcti-swtpm +and libtss2-tcti-mssim.") + (license license:bsd-2))) + +(define-public tpm2-tss-engine + (package + (name "tpm2-tss-engine") + (version "1.1.0") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/tpm2-software/tpm2-tss-engine/archive/v" version ".tar.gz")) + (sha256 + (base32 + "0xby0jhdpp9jlwd84dp97y7fx7swww1b1k5srr9k64akbnrgwpz0")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; only manual test scripts + #:configure-flags (list (string-append "--with-enginesdir=" (assoc-ref %outputs "out") "/lib/engines-1.1/")) + #:phases + (modify-phases %standard-phases + (add-after 'install 'setting-env-vars-install-openssl-conf + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (tpm2-tss (assoc-ref %build-inputs "tpm2-tss")) + (engine-path (string-append (assoc-ref %outputs "out") "/lib/engines-1.1/")) + (opensslconf-file "openssl.conf.sample") + (opensslconf-path (string-append (assoc-ref %outputs "out") "/etc/"))) + (wrap-program (string-append out "/bin/tpm2tss-genkey") + `("OPENSSL_ENGINES" ":" prefix (,engine-path))) + ;;(wrap-program (string-append out "/bin/tpm2tss-genkey") + ;; `("TPM2TSSENGINE_TCTI" ":" prefix (,(string-append tpm2-tss "/lib/libtss2-tcti-device.so:/dev/tpm0")))) + ;;(wrap-program (string-append out "/bin/tpm2tss-genkey") + ;; `("TPM2TOOLS_TCTI" ":" prefix (,(string-append tpm2-tss "/lib/libtss2-tcti-device.so:/dev/tpm0")))) + (mkdir-p opensslconf-path) + (substitute* opensslconf-file (("/usr") out)) + (substitute* opensslconf-file (("default_algorithms") "#default_algorithms")) + (copy-file opensslconf-file (string-append opensslconf-path "openssl-tss2.conf")) + #t)))))) + (native-inputs + `(("autoconf" ,autoconf) + ("autoconf-archive" ,autoconf-archive) + ("automake" ,automake) + ("bash" ,bash) + ("curl" ,curl) + ("doxygen" ,doxygen) + ("json-c" ,json-c) + ("libgcrypt" ,libgcrypt) + ("libtool" ,libtool) + ("m4" ,m4) + ("pkg-config" ,pkg-config) + ("openssl" ,openssl-1.1) + ("patchelf" ,patchelf))) + (inputs + `(("tpm2-tss" ,tpm2-tss-openssl-1.1) + ("bash-minimal" ,bash-minimal))) + (home-page "https://github.com/tpm2-software/tpm2-tss-engine") + (synopsis "The tpm2-tss-engine project implements a cryptographic engine for OpenSSL for Trusted Platform Module (TPM 2.0) using the tpm2-tss software stack that follows the Trusted Computing Groups (TCG) TPM Software Stack (TSS 2.0).") + (description + "The tpm2-tss-engine project implements a cryptographic engine for OpenSSL for Trusted Platform Module (TPM 2.0) using the tpm2-tss software stack that follows the Trusted Computing Groups (TCG) TPM Software Stack (TSS 2.0).") + (license license:bsd-2))) + +(define-public tpm2-tools + (package + (name "tpm2-tools") + (version "4.3.1") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/tpm2-software/tpm2-tools/archive/" version ".tar.gz")) + (sha256 + (base32 + "1sfrgzwhpbilk29lh233k0wncd0b5v12w2bz4h8n7nclcdlhw449")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; only manual test scripts + #:configure-flags (list "--enable-tctienvvar") + )) + (native-inputs + `(("autoconf" ,autoconf) + ("autoconf-archive" ,autoconf-archive) + ("automake" ,automake) + ("bash" ,bash) + ("curl" ,curl) + ("doxygen" ,doxygen) + ("json-c" ,json-c) + ("libgcrypt" ,libgcrypt) + ("libtool" ,libtool) + ("m4" ,m4) + ("pkg-config" ,pkg-config) + ("openssl" ,openssl-1.1) + ("libuuid" ,util-linux "lib") + ("tpm2-tss" ,tpm2-tss-openssl-1.1))) + (home-page "https://github.com/tpm2-software/tpm2-tools") + (synopsis "The source repository for the Trusted Platform Module (TPM2.0) tools ") + (description + "The source repository for the Trusted Platform Module (TPM2.0) tools ") + (license license:lgpl2.1+))) + +(define-public tpm2-abrmd + (package + (name "tpm2-abrmd") + (version "2.4.0") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/tpm2-software/tpm2-abrmd/archive/refs/tags/" version ".tar.gz")) + (sha256 + (base32 + "14sj4cbw7myx1fkzz9ya4gc06rzm6x7hy9jd9im8wc2a1r3141k2")))) + (build-system gnu-build-system) + (native-inputs + `(("autoconf" ,autoconf) + ("autoconf-archive" ,autoconf-archive) + ("automake" ,automake) + ("glib" ,glib "bin") + ("glib" ,glib) + ("git" ,git) + ("libtool" ,libtool) + ("pkg-config" ,pkg-config) + ("tpm2-tss" ,tpm2-tss) + ("which" ,which))) + (home-page "https://github.com/tpm2-software/tpm2-abrmd") + (synopsis "TPM2 Access Broker & Resource Manager") + (description + "This is a system daemon implementing the TPM2 access broker (TAB) + & Resource Manager (RM) spec from the TCG. The daemon (tpm2-abrmd) is + implemented using Glib and the GObject system. In this documentation and in the code + we use tpm2-abrmd and tabrmd interchangeably.") + (license license:bsd-2))) + +(define-public tpm2-pkcs11 + (package + (name "tpm2-pkcs11") + (version "1.7.0") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/tpm2-software/tpm2-pkcs11/archive/refs/tags/" version ".tar.gz")) + (sha256 + (base32 + "0kkzzdxiz1389jl4rabh739m99x1jh42xagq4sycn5s8kvik1sa5")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; only manual test scripts + ; #:configure-flags (list "--enable-tctienvvar") + )) + (native-inputs + `( + ("autoconf" ,autoconf) + ("autoconf-archive" ,autoconf-archive) + ("automake" ,automake) + ("libtool" ,libtool) + ("m4" ,m4) + ("pkg-config" ,pkg-config))) + (inputs + `(("libyaml" ,libyaml) + ("sqlite" ,sqlite) + ("openssl" ,openssl) + ("tpm2-abrmd" ,tpm2-abrmd) + ("tpm2-tools" ,tpm2-tools) + ("tpm2-tss" ,tpm2-tss) + )) + (home-page "https://github.com/tpm2-software/tpm2-pkcs11") + (synopsis "A PKCS#11 interface for TPM2 hardware") + (description + "PKCS #11 is a Public-Key Cryptography Standard that defines a standard method + to access cryptographic services from tokens/ devices such as hardware security modules (HSM), + smart cards, etc. In this project we intend to use a TPM2 device as the cryptographic token.") + (license license:bsd-2))) diff --git a/px/packages/user-services.scm b/px/packages/user-services.scm new file mode 100644 index 0000000..b903c3b --- /dev/null +++ b/px/packages/user-services.scm @@ -0,0 +1,77 @@ +(define-module (px packages user-services) + #:use-module (guix packages) + #:use-module (guix build-system trivial) + #:use-module (guix download) + #:use-module (guix utils) + #:use-module (gnu packages bash) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) + #:use-module (gnu packages guile-xyz) + #:use-module (gnu packages syncthing) + #:use-module (gnu packages sync) + #:use-module (px packages accounts) + #:use-module (px packages contacts-calendar) + #:use-module (px packages desktop-tools) + #:use-module (px packages events) + #:use-module (px packages hub) + #:use-module (px packages mastodon) + #:use-module (px packages secret) + #:use-module (px packages time-tracking) + #:use-module (px packages settings) + #:use-module ((guix licenses) #:prefix license:)) + + +(define-public px-user-services + (package + (name "px-user-services") + (version "2.0.6") + (source + (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/" name "_v" version ".tgz")) + (sha256 + (base32 "0mrqdgcm7z20inf6qrq8agliidn13327gihjassqdlcr9k7fkq1y")))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((out (assoc-ref %outputs "out")) + (src (assoc-ref %build-inputs "source"))) + (setenv "PATH" + (string-append + (assoc-ref %build-inputs "tar") "/bin" ":" + (assoc-ref %build-inputs "gzip") "/bin" ":")) + (invoke "tar" "xvf" src) + (chdir ,name) + (mkdir-p (string-append out "/etc/xdg/autostart")) + (copy-recursively "etc/xdg/autostart" + (string-append out "/etc/xdg/autostart")) + (mkdir-p (string-append out "/etc/px/services")) + (copy-recursively "etc/px/services" + (string-append out "/etc/px/services")) + (substitute* (string-append out "/etc/xdg/autostart/user-services.desktop") + (("Exec=/etc/px/services/start.sh") + (string-append "Exec=" out "/etc/px/services/start.sh"))) + #t)))) + (native-inputs + `(("tar" ,tar) + ("gzip" ,gzip))) + (propagated-inputs + `( + ; ("px-secret-service" ,px-secret-service) + ; ("px-events-service" ,px-events-service) + ; ("px-accounts-service" ,px-accounts-service) + ; ("px-contacts-calendar" ,px-contacts-calendar) + ("px-settings-service" ,px-settings-service) + ; ("px-mastodon-service" ,px-mastodon-service) + ; ("px-hub-service" ,px-hub-service) + ; ("px-time-tracking" ,px-time-tracking) + ("mcron" ,mcron) + ("syncthing" ,syncthing) + ("syncthingtray" ,syncthingtray))) + (home-page "https://www.pantherx.org/") + (synopsis "PantherX user services execution package") + (description "Run user-level services for PantherX desktop") + (license license:expat))) diff --git a/px/packages/video.scm b/px/packages/video.scm new file mode 100644 index 0000000..7763787 --- /dev/null +++ b/px/packages/video.scm @@ -0,0 +1,120 @@ + +(define-module (px packages video) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix utils) + #:use-module (guix packages) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix build-system waf) + #:use-module (gnu packages audio) + #:use-module (gnu packages cdrom) + #:use-module (gnu packages compression) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages ghostscript) + #:use-module (gnu packages gl) + #:use-module (gnu packages image) + #:use-module (gnu packages linux) + #:use-module (gnu packages lua) + #:use-module (gnu packages mp3) + #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages pulseaudio) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages textutils) + #:use-module (gnu packages video) + #:use-module (gnu packages vulkan) + #:use-module (gnu packages xdisorg) + #:use-module (gnu packages xorg)) + + +(define-public mpv-0.34 + (package + (name "mpv") + (version "0.34.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mpv-player/mpv") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "12qxwm1ww5vhjddl8yvj1xa0n1fi9z3lmzwhaiday2v59ca0qgsk")))) + (build-system waf-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-file-names + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "player/lua/ytdl_hook.lua" + (("\"yt-dlp\",") + (string-append + "\"" (search-input-file inputs "bin/yt-dlp") "\","))))) + (add-before 'configure 'build-reproducibly + (lambda _ + ;; Somewhere in the build system library dependencies are enumerated + ;; and passed as linker flags, but the order in which they are added + ;; varies. See <https://github.com/mpv-player/mpv/issues/7855>. + ;; Set PYTHONHASHSEED as a workaround for deterministic results. + (setenv "PYTHONHASHSEED" "1"))) + (add-before 'configure 'set-up-waf + (lambda* (#:key inputs #:allow-other-keys) + (copy-file (search-input-file inputs "bin/waf") "waf") + (setenv "CC" #$(cc-for-target))))) + #:configure-flags + #~(list "--enable-libmpv-shared" + "--enable-cdda" + "--enable-dvdnav" + "--disable-build-date") + ;; No check function defined. + #:tests? #f)) + (native-inputs + (list perl ; for zsh completion file + pkg-config python-docutils)) + ;; Missing features: libguess, V4L2. + (inputs + (list alsa-lib + enca + ffmpeg-5 + jack-1 + ladspa + lcms + libass + libbluray + libcaca + libbs2b + libcdio-paranoia + libdvdread + libdvdnav + libjpeg-turbo + libva + libvdpau + libx11 + libxext + libxkbcommon + libxinerama + libxrandr + libxscrnsaver + libxv + ;; XXX: lua > 5.2 is not currently supported; see + ;; waftools/checks/custom.py + lua-5.2 + mesa + mpg123 + pulseaudio + python-waf + rsound + shaderc + vulkan-headers + vulkan-loader + wayland + wayland-protocols + yt-dlp + zlib)) + (home-page "https://mpv.io/") + (synopsis "Audio and video player") + (description "MPV is a general-purpose audio and video player. It is a +fork of mplayer2 and MPlayer. It shares some features with the former +projects while introducing many more.") + (license license:gpl2+))) + diff --git a/px/packages/wiki.scm b/px/packages/wiki.scm new file mode 100644 index 0000000..5fac084 --- /dev/null +++ b/px/packages/wiki.scm @@ -0,0 +1,93 @@ +;;; throttled PantherX +;;; Author: Hamzeh Nasajpour (h.nasajpour@pantherx.org) +;;; + +(define-module (px packages wiki) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (guix build-system cmake) + #:use-module (guix build-system trivial) + #:use-module (gnu packages bash) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages qt) + #:use-module (px packages library)) + +(define-public px-desktop-wiki + (package + (name "px-desktop-wiki") + (version "0.1.5") + (source + (origin + (method url-fetch) + (uri (string-append + "https://source.pantherx.org/" name "_" version ".tgz")) + (sha256 + (base32 + "1xzr6b8f2478s81kngp8hd7qvvhx6nv6xja396sfhp78y04q5yw1")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'wrap + ;; The program fails to find the QtWebEngineProcess program, + ;; so we set QTWEBENGINEPROCESS_PATH to help it. + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((bin (string-append (assoc-ref outputs "out") "/bin")) + (qtwebengineprocess (string-append + (assoc-ref inputs "qtwebengine") + "/lib/qt5/libexec/QtWebEngineProcess"))) + (for-each (lambda (program) + (wrap-program program + `("QTWEBENGINEPROCESS_PATH" = + (,qtwebengineprocess)))) + (find-files bin ".*"))) + #t))))) + (propagated-inputs `(("px-wiki" ,px-wiki))) + (native-inputs `( + ("pkg-config" ,pkg-config) + ("qt" ,qtbase-5) + ("qtdeclarative" ,qtdeclarative-5) + ("qtwebengine" ,qtwebengine-5) + ("qtwebchannel-5" ,qtwebchannel-5) + ("px-gui-library" ,px-gui-library))) + (home-page "https://wiki.pantherx.org/") + (synopsis "PantherX Wiki Desktop Application") + (description "PantherX Wiki Desktop Application") + (license license:expat))) + +(define-public px-wiki + (package + (name "px-wiki") + (version "0.0.15") + (source (origin + (method url-fetch) + (uri (string-append "https://source.pantherx.org/wiki.pantherx.org_v" version ".tgz")) + (sha256 + (base32 + "05j1fk64yph8z2irw7vfr225xvgp8zhax3vm9awpfi3hy2hsd07x")))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils) + (srfi srfi-26)) + (let* ((source (assoc-ref %build-inputs "source")) + (tar (assoc-ref %build-inputs "tar")) + (gzip (assoc-ref %build-inputs "gzip")) + (wiki-dir (string-append %output "/share/px-wiki"))) + (mkdir-p wiki-dir) + (setenv "PATH" (string-append gzip "/bin")) + (invoke (string-append tar "/bin/tar") "xvf" source "-C" wiki-dir))))) + (native-inputs `(("tar" ,tar) + ("gzip" ,gzip))) + (inputs `(("bash" ,bash))) + (home-page "https://www.wiki.pantherx.org/") + (synopsis "PantherX Wiki") + (description + "PantherX Wiki - Offline html files.") + (license license:expat))) diff --git a/px/services/base.scm b/px/services/base.scm new file mode 100644 index 0000000..91a966e --- /dev/null +++ b/px/services/base.scm @@ -0,0 +1,293 @@ +;;; PantherX System Configuration Module +;;; This module supports configuration modules for PantherX OS definitions +;;; +;;; Reza Alizadeh Majd <r.majd@pantherx.org> +;;; Franz Geffke <franz@pantherx.org> +;;; + +(define-module (px services base) + #:use-module (gnu packages gnome) + #:use-module (gnu packages openbox) + #:use-module (gnu packages networking) + #:use-module (gnu packages security-token) + #:use-module (gnu packages xdisorg) + #:use-module (gnu services) + #:use-module (gnu services avahi) + #:use-module (gnu services base) + #:use-module (gnu services cups) + #:use-module (gnu services dbus) + #:use-module (gnu services desktop) + #:use-module (gnu services networking) + #:use-module (gnu services pm) + #:use-module (gnu services sddm) + #:use-module (gnu services sound) + #:use-module (gnu services ssh) + #:use-module (gnu services xorg) + #:use-module (px packages desktop) + #:use-module (px services desktop) + #:use-module (px services device) + #:use-module (px services security-token) + #:use-module (guix gexp) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:export (%px-core-services + + ;; for custom desktops (for ex. xfce) + ;; without lxqt + %px-desktop-services-base + + %px-desktop-services + %px-desktop-ee-services + + ;; for custom servers (for ex. docker) + ;; without nftables and dh + %px-server-services-base + + %px-server-services + ; %px-server-iptables-services + %px-server-ee-services + + %px-core-arm-services + %px-gui-arm-services + %px-desktop-arm-services) + + #:re-export (px-desktop-service-type)) + +;;; +;;; Utilities +;;; + +(define (make-firewall-rules open-ports) + + (define (make-port-rules open-ports status) + "Generate list of strings each is a port/service rule for nftables" + (reduce-right append '() + (map (match-lambda + ((protocol ports ...) + (map (lambda (port) + (string-append " " protocol " dport " port " " status)) + ports))) + open-ports))) + + (let ((port-rules (make-port-rules open-ports "accept"))) + (plain-file "nftables" + (string-append "#PantherX firewall rules\n" + "table inet filter {\n" + " chain input {\n" + " type filter hook input priority 0; policy drop;\n" + " # early drop of invalid connections\n" + " ct state invalid drop\n" + " # allow established/related connections\n" + " ct state { established, related } accept\n" + " # allow from loopback\n" + " iifname lo accept\n" + " # allow icmp\n" + " ip protocol icmp accept\n" + " ip6 nexthdr icmpv6 accept\n" + (string-join port-rules "\n" 'suffix) + " # reject everything else\n" + " reject with icmpx type port-unreachable\n" + " }\n" + " chain forward {\n" + " type filter hook forward priority 0; policy drop;\n" + " }\n" + " chain output {\n" + " type filter hook output priority 0; policy accept;\n" + " }\n" + "}\n")))) + +;;; +;;; +;;; CORE +;;; + +(define %px-core-services + (append + ;; list of services that only required to be available in px-core-os, + ;; since they are available by default in upstream's %desktop-services + (list (service dhcp-client-service-type) + (service ntp-service-type)) + %base-services)) + +;;; +;;; DESKTOP +;;; + +(define %px-desktop-services-base + (append (list + ;; Various udev rules incl. FIDO support + (simple-service 'custom-udev-rules + udev-service-type + (list libu2f-host)) + + (ledger-wallet-service) + (nitro-key-service) + + ;; Power savings + (service tlp-service-type) + + ;; Bluetooth service + ;; (bluetooth-service #:auto-enable? #t) + (service bluetooth-service-type + (bluetooth-configuration + (auto-enable? #t))) + + ;; Prevent overheating + ;; TLP does not conflict with thermald. + (service thermald-service-type) + + ; Display manager + (service sddm-service-type + (sddm-configuration + (minimum-uid 1000) + (theme "px-sddm-theme"))) + + ;; Printing + (service cups-service-type + (cups-configuration + (web-interface? #t) + (browsing? #t) + (default-paper-size "a4"))) + + ;; Keychain + (service gnome-keyring-service-type + (gnome-keyring-configuration + (pam-services '(("passwd" . passwd) + ("sddm" . login))))) + + ;; SSH is enabled by default but only with SSH key + (service openssh-service-type + (openssh-configuration + (permit-root-login 'prohibit-password))) + + ;; Firewall + (service nftables-service-type + (nftables-configuration + (ruleset (make-firewall-rules '())))) + + ;; Screensaver + (service screen-locker-service-type + (screen-locker-configuration + (name "xlock") + (program (file-append xlockmore "/bin/xlock"))))) + + (modify-services %desktop-services + ;; GDM is default on upstream, on x86_64 + (delete gdm-service-type) + (delete screen-locker-service-type) + (dbus-root-service-type config => (dbus-configuration (inherit config) + (services (list blueman)))) + (network-manager-service-type config => + (network-manager-configuration + (inherit config) + (vpn-plugins (list network-manager-openvpn + network-manager-openconnect))))))) + +(define %px-desktop-services + (append + %px-desktop-services-base)) + +(define %px-desktop-ee-services + (append (list (service px-device-identity-service-type) + (service px-user-identity-service-type) + ;; Desktop + (service px-desktop-service-type)) + %px-desktop-services-base)) + +;;; +;;; SERVER +;;; + +(define %px-server-services-base + (append (list + ;; OpenSSH is enabled by default but only with SSH key + (service openssh-service-type + (openssh-configuration + (permit-root-login 'prohibit-password))) + + ;; Time service + (service ntp-service-type)) + + %base-services)) + +(define %px-server-services + (append (list + ;; Firewall + (service nftables-service-type) + ;; DHCP + (service dhcp-client-service-type)) + %px-server-services-base)) + +; (define %px-server-iptables-services +; (append (list +; ;; Firewall +; ;; nftables doesn't work well with Docker +; (service iptables-service-type)) +; %px-server-services-base)) + +(define %px-server-ee-services + (append (list (service px-device-identity-service-type) + ;; Firewall + (service nftables-service-type) + ;; DHCP + (service dhcp-client-service-type)) + %px-server-services-base)) + +;;; +;;; ARM-SPECIFIC +;;; + +(define %px-core-arm-services + (cons* + ;; networking + (service wpa-supplicant-service-type) + (service network-manager-service-type) + (service modem-manager-service-type) + (service usb-modeswitch-service-type) + (service ntp-service-type) + + ;; remote access + (service openssh-service-type + (openssh-configuration + (x11-forwarding? #t) + (permit-root-login #t))) + + %base-services)) + +(define %px-gui-arm-services + (cons* + (service slim-service-type + (slim-configuration + (vt "vt7") + (auto-login? #t) + (auto-login-session (file-append openbox "/bin/openbox-session")) + (default-user "default"))) + (service avahi-service-type) + (service udisks-service-type) + (service upower-service-type) + (service accountsservice-service-type) + (service polkit-service-type) + (service elogind-service-type) + (service dbus-root-service-type) + polkit-wheel-service + polkit-network-manager-service ;; control network without sudo + polkit-elogind-service ;; reboot without sudo + + (service pulseaudio-service-type) + (service alsa-service-type) + %px-core-arm-services)) + +(define %px-desktop-arm-services + (append + (list (service dhcp-client-service-type) + (service sddm-service-type + (sddm-configuration + (minimum-uid 1000) + (theme "px-sddm-theme"))) + (service px-desktop-service-type + (px-desktop-configuration + (lxqt lxqt-modified) + (default-packages '())))) + (modify-services %desktop-services + (delete gdm-service-type) + (delete network-manager-service-type))))
\ No newline at end of file diff --git a/px/services/bluetooth.scm b/px/services/bluetooth.scm new file mode 100644 index 0000000..d8953df --- /dev/null +++ b/px/services/bluetooth.scm @@ -0,0 +1,114 @@ +(define-module (px services bluetooth) + #:use-module (gnu) + #:use-module (gnu packages admin) + #:use-module (gnu packages base) + #:use-module (gnu packages linux) + #:use-module (gnu packages screen) + #:use-module (gnu packages video) + #:use-module (gnu services mcron) + #:use-module (gnu services shepherd) + #:use-module (gnu system) + #:use-module (gnu system shadow) + + #:use-module (px packages device) + #:use-module (px packages security-token) + #:use-module (px packages tpm) + + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module (ice-9 match) + #:use-module (ice-9 pretty-print) + + #:export (btuart-configuration + btuart-service-type + + bluetooth-client-manager-configuration + bluetooth-client-manager-service-type)) + +;; +;; btuart-service-type +;; + +(define-record-type* <btuart-configuration> + btuart-configuration make-btuart-configuration + btuart-configuration? + (package btuart-configuration-package + (default bluez)) + (device btuart-configuration-device + (default "/dev/ttyAMA0")) + (protocol btuart-configuration-protocol + (default "bcm")) + (baudrate btuart-configuration-baudrate + (default "3000000")) + (flow-control? btuart-configuration-flow-control? + (default #t))) + + +(define btuart-shepherd-service + (match-lambda + (($ <btuart-configuration> package device protocol baudrate flow-control?) + (list + (shepherd-service + (documentation "attach serial lines as Bluetooth HCI interfaces") + (provision '(btuart)) + (requirement '(udev)) + (start #~(make-forkexec-constructor + (list #$(file-append package "/bin/btattach") + "-B" #$device "-P" #$protocol + "-S" #$baudrate + (when #$flow-control? "-N")))) + (one-shot? #t)))))) + + +(define btuart-service-type + (service-type + (name 'btuart) + (extensions (list (service-extension shepherd-root-service-type + btuart-shepherd-service))) + (default-value (btuart-configuration)) + (description "Attach serial lines as Bluetooth HCI interfaces"))) + +;; +;; bluetooth-client-manager-service +;; + +(define-record-type* <bluetooth-client-manager-configuration> + bluetooth-client-manager-configuration make-bluetooth-client-manager-configuration + bluetooth-client-manager-configuration? + (package bluetooth-client-manager-configuration-package + (default bluetooth-client-manager-service)) + (debug? bluetooth-client-manager-configuration-debug? + (default #f)) + (skip-approval? bluetooth-client-manager-configuration-skip-approval? + (default #f))) + + +(define bluetooth-client-manager-shepherd-service + (match-lambda + (($ <bluetooth-client-manager-configuration> package debug? skip-approval?) + (list (shepherd-service + (provision '(bluetooth-client-manager-service)) + (documentation "Run px-device-identity-service as a daemon") + (requirement '(networking user-processes px-device-identity)) + (start #~(make-forkexec-constructor + (list (string-append #$package "/bin/bluetooth-client-manager-service") + #$@(if debug? '("--verbose") '()) + #$@(if skip-approval? '("--skip-approval") '())) + #:log-file "/var/log/bluetooth-client-manager-service.log" + #:environment-variables + (cons* "HOME=/root" + "XDG_DATA_HOME=/root/.local/share" + "XDG_CONFIG_HOME=/root/.config" + "SSL_CERT_DIR=/run/current-system/profile/etc/ssl/certs" + "SSL_CERT_FILE=/run/current-system/profile/etc/ssl/certs/ca-certificates.crt" + (default-environment-variables)))) + (stop #~(make-kill-destructor))))))) + + +(define bluetooth-client-manager-service-type + (service-type + (name 'bluetooth-client-manager-service) + (description "PantherX Bluetooth Client Manager service") + (extensions (list (service-extension shepherd-root-service-type + bluetooth-client-manager-shepherd-service))) + (default-value (bluetooth-client-manager-configuration)))) diff --git a/px/services/databases.scm b/px/services/databases.scm new file mode 100644 index 0000000..aa90f20 --- /dev/null +++ b/px/services/databases.scm @@ -0,0 +1,132 @@ +;;; Databases service definitions for PantherX +;;; Author: Reza Alizadeh Majd (r.majd@pantherx.org) + + +(define-module (px services databases) + #:use-module (gnu services) + #:use-module (gnu services shepherd) + #:use-module (gnu system shadow) + #:use-module (gnu packages admin) + #:use-module (guix modules) + #:use-module (guix records) + #:use-module (guix gexp) + #:use-module (px packages databases) + #:use-module (srfi srfi-1) + #:use-module (ice-9 match) + #:export (mongodb-configuration + mongodb-configuration? + mongodb-configuration-mongodb + mongodb-configuration-config-file + mongodb-configuration-data-directory + mongodb-service-type)) + + +;;; +;;; MongoDB +;;; +;;; @subsubheading MongoDB +;;; @defvr {Scheme Variable} mongodb-service-type +;;; This is the service type for @uref{https://www.mongodb.com/, MongoDB}. +;;; The value for the service type is a @code{mongodb-configuration} object. +;;; @end defvr +;;; @lisp +;;; (service mongodb-service-type) +;;; @end lisp +;;; @deftp {Data Type} mongodb-configuration +;;; Data type representing the configuration of mongodb. +;;; @table @asis +;;; @item @code{mongodb} (default: @code{mongodb}) +;;; The MongoDB package to use. +;;; @item @code{config-file} (default: @code{%default-mongodb-configuration-file}) +;;; The configuration file for MongoDB. +;;; @item @code{data-directory} (default: @code{"/var/lib/mongodb"}) +;;; This value is used to create the directory, so that it exists and is +;;; owned by the mongodb user. It should match the data-directory which +;;; MongoDB is configured to use through the configuration file. +;;; @end table +;;; @end deftp + + +(define %default-mongodb-configuration-file + (plain-file + "mongodb.yaml" + "# GNU Guix: MongoDB default configuration file +processManagement: + pidFilePath: /var/run/mongodb/pid +storage: + dbPath: /var/lib/mongodb +")) + + +(define-record-type* <mongodb-configuration> + mongodb-configuration make-mongodb-configuration + mongodb-configuration? + (mongodb mongodb-configuration-mongodb + (default mongodb)) + (config-file mongodb-configuration-config-file + (default %default-mongodb-configuration-file)) + (data-directory mongodb-configuration-data-directory + (default "/var/lib/mongodb"))) + +(define %mongodb-accounts + (list (user-group (name "mongodb") (system? #t)) + (user-account + (name "mongodb") + (group "mongodb") + (system? #t) + (comment "Mongodb server user") + (home-directory "/var/lib/mongodb") + (shell (file-append shadow "/sbin/nologin"))))) + +(define mongodb-activation + (match-lambda + (($ <mongodb-configuration> mongodb config-file data-directory) + #~(begin + (use-modules (guix build utils)) + (let ((user (getpwnam "mongodb"))) + (for-each + (lambda (directory) + (mkdir-p directory) + (chown directory + (passwd:uid user) (passwd:gid user))) + '("/var/run/mongodb" #$data-directory))))))) + +(define mongodb-shepherd-service + (match-lambda + (($ <mongodb-configuration> mongodb config-file data-directory) + (shepherd-service + (provision '(mongodb)) + (documentation "Run the Mongodb daemon.") + (requirement '(user-processes loopback)) + (start #~(make-forkexec-constructor + `(,(string-append #$mongodb "/bin/mongod") + "--config" + ,#$config-file) + #:user "mongodb" + #:group "mongodb" + #:pid-file "/var/run/mongodb/pid" + #:log-file "/var/log/mongodb.log")) + (stop #~(make-kill-destructor)))))) + +(define mongodb-service-type + (service-type + (name 'mongodb) + (description "Run the MongoDB document database server.") + (extensions + (list (service-extension shepherd-root-service-type + (compose list + mongodb-shepherd-service)) + (service-extension activation-service-type + mongodb-activation) + (service-extension account-service-type + (const %mongodb-accounts)))) + (default-value + (mongodb-configuration)))) + + +(use-modules (gnu system) + (gnu bootloader) + (gnu bootloader grub) + (gnu system file-systems) + (px system config)) + diff --git a/px/services/desktop.scm b/px/services/desktop.scm new file mode 100644 index 0000000..2ce403d --- /dev/null +++ b/px/services/desktop.scm @@ -0,0 +1,124 @@ +;;; Desktop service definitions for PantherX +;;; +;;; Reza Alizadeh Majd <r.majd@pantherx.org> +;;; Franz Geffke <franz@pantherx.org> +;;; + +(define-module (px services desktop) + #:use-module (gnu packages admin) + #:use-module (gnu packages base) + #:use-module (gnu packages linux) + #:use-module (gnu packages xdisorg) + #:use-module (gnu services) + #:use-module (gnu services avahi) + #:use-module (gnu services base) + #:use-module (gnu services cups) + #:use-module (gnu services dbus) + #:use-module (gnu services desktop) + #:use-module (gnu packages gnome) + #:use-module (gnu packages lxqt) + #:use-module (gnu services networking) + #:use-module (gnu services shepherd) + #:use-module (gnu services sddm) + #:use-module (gnu services ssh) + #:use-module (gnu services xorg) + #:use-module (gnu system) + #:use-module (gnu system setuid) + #:use-module (guix build utils) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix records) + #:use-module (px packages desktop) + #:use-module (srfi srfi-1) + #:use-module (ice-9 match) + #:export (px-desktop-configuration + px-desktop-configuration? + px-desktop-service-type + + polkit-network-manager-service + polkit-elogind-service + + create-swap-space-service)) + +;; +;; PantherX desktop service type +;; + +(define-record-type* <px-desktop-configuration> px-desktop-configuration + make-px-desktop-configuration + px-desktop-configuration? + (lxqt px-config-package + (default lxqt-modified)) + (default-packages px-config-default-packages + (default (list px-desktop-defaults)))) + +(define (px-desktop-polkit-settings config) + "Return the list of LXQt dependencies that provide polkit actions and +rules." + (list lxqt-admin)) + +(define px-desktop-profile-packages + (lambda (config) + (append + (list (px-config-package config)) + (px-config-default-packages config)))) + + +(define px-desktop-service-type + (service-type + (name 'px-desktop) + (extensions + (list (service-extension polkit-service-type + px-desktop-polkit-settings) + (service-extension profile-service-type + px-desktop-profile-packages))) + (default-value (px-desktop-configuration)) + (description "Run LXQt desktop environment on PantherX."))) + +;; +;; allow netdev group to control network manger +;; + +(define polkit-network-manager + (file-union + "polkit-nm" + `(("share/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules" + ,(plain-file + "nm.rules" + "polkit.addRule(function(action, subject) { + if (action.id.indexOf(\"org.freedesktop.NetworkManager.\") == 0 && subject.isInGroup(\"netdev\")) { + return polkit.Result.YES; + } +}); +"))))) + + +;; primarily for ARM + +(define polkit-network-manager-service + (simple-service 'polkit-nm polkit-service-type (list polkit-network-manager))) + +;; +;; Allow users group to perform reboot/poweroff +;; primarily for ARM +;; + +(define polkit-loginctl + (file-union + "polkit-loginctl" + `(("share/polkit-1/rules.d/10-enable-session-power.rules" + ,(plain-file + "login.rules" + "polkit.addRule(function(action, subject) { + if ( (action.id == \"org.freedesktop.login1.reboot\" || + action.id == \"org.freedesktop.login1.reboot-multiple-sessions\" || + action.id == \"org.freedesktop.login1.power-off\" || + action.id == \"org.freedesktop.login1.power-off-multiple-sessions\") + && subject.isInGroup(\"users\") ) { + return polkit.Result.YES; + } +}); +"))))) + +(define polkit-elogind-service + (simple-service 'polkit-login polkit-service-type (list polkit-loginctl)))
\ No newline at end of file diff --git a/px/services/device.scm b/px/services/device.scm new file mode 100644 index 0000000..4fbbc64 --- /dev/null +++ b/px/services/device.scm @@ -0,0 +1,332 @@ +(define-module (px services device) + #:use-module (gnu) + #:use-module (gnu packages admin) + #:use-module (gnu packages base) + #:use-module (gnu packages linux) + #:use-module (gnu packages screen) + #:use-module (gnu packages video) + #:use-module (gnu services mcron) + #:use-module (gnu services shepherd) + #:use-module (gnu system) + #:use-module (gnu system shadow) + + #:use-module (px packages device) + #:use-module (px packages security-token) + #:use-module (px packages tpm) + + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module (ice-9 match) + #:use-module (ice-9 pretty-print) + + #:export (<px-device-identity-configuration> + px-device-identity-configuration + px-device-identity-configuration? + px-device-identity-service-type + + <px-device-identity-configuration> + px-user-identity-configuration + px-user-identity-configuration? + px-user-identity-service-type + + px-enterprise-channels-service + + px-device-runner-configuration + px-device-runner-service-type + + px-file-upload-configuration + px-file-upload-service-type + + btuart-configuration + btuart-service-type + + bluetooth-client-manager-configuration + bluetooth-client-manager-service-type)) + + +;; +;; Device Identity API SERVICE +;; + +(define-record-type* <px-device-identity-configuration> + px-device-identity-configuration make-px-device-identity-configuration + px-device-identity-configuration? + (package px-device-identity-configuration-package + (default px-device-identity-service))) + + +(define px-device-identity-shepherd-service + (match-lambda + (($ <px-device-identity-configuration> package) + (list (shepherd-service + (provision '(px-device-identity)) + (documentation "Run px-device-identity-service as a daemon") + (requirement '(networking user-processes)) + (start #~(make-forkexec-constructor + (list (string-append #$screen "/bin/screen") + "-D" "-m" "-S" "identity-api" + (string-append #$package "/bin/px-device-identity-service")))) + (stop #~(make-kill-destructor))))))) + + +(define px-device-identity-service-type + (service-type + (name 'px-device-identity) + (description "PantherX device identity service") + (extensions (list (service-extension shepherd-root-service-type + px-device-identity-shepherd-service))) + (default-value (px-device-identity-configuration)))) + + +;; +;; User Identity Service +;; + +(define-record-type* <px-user-identity-configuration> + px-user-identity-configuration make-px-user-identity-configuration + px-user-identity-configuration? + (package px-user-identity-configuration-package + (default px-user-identity-service))) + +(define (px-user-identity-shepherd-service config) + (match config + (($ <px-user-identity-configuration> package) + (list (shepherd-service + (provision '(px-user-identity)) + (documentation "Run px-user-identity-service as a shepherd daemon") + (requirement `(networking user-processes)) + (start #~(make-forkexec-constructor + (list (string-append #$screen "/bin/screen") + "-D" "-m" "-S" "user-identity" + (string-append #$package "/bin/px-user-identity-service")) + #:environment-variables + (cons* "HOME=/root" + "XDG_DATA_HOME=/root/.local/share" + "XDG_CONFIG_HOME=/root/.config" + "SSL_CERT_DIR=/run/current-system/profile/etc/ssl/certs" + "SSL_CERT_FILE=/run/current-system/profile/etc/ssl/certs/ca-certificates.crt" + (default-environment-variables)))) + (stop #~(make-kill-destructor))))))) + +(define px-user-identity-service-type + (service-type + (name 'px-user-identity) + (description "PantherX user identity service") + (extensions (list (service-extension shepherd-root-service-type + px-user-identity-shepherd-service))) + (default-value (px-user-identity-configuration)))) + +;; +;; Pantherx Enterprise Channels Service +;; + +(define (px-enterprise-channels-service channels) + (let ((channel-conf + (call-with-output-string + (lambda (port) (pretty-print channels port))))) + (simple-service + 'enterprise-channels + special-files-service-type + `(("/etc/guix/channels.scm" + ,(computed-file + "channels.scm" + (with-imported-modules + '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (let ((base-dir (dirname #$output))) + (mkdir-p base-dir) + (call-with-output-file #$output + (lambda (port) + (format port #$channel-conf)))))))))))) + + +;; +;; Device Runner Service +;; + +(define-record-type* <px-device-runner-configuration> + px-device-runner-configuration make-px-device-runner-configuration + px-device-runner-configuration? + (schedule px-device-runner-configuration-schedule + (default "*/5 * * * *"))) + +(define (px-device-runner-job config) + #~(job #$(px-device-runner-configuration-schedule config) + (string-append #$px-device-runner + "/bin/px-device-runner"))) + +(define (px-device-runner-mcron-jobs config) + (list (px-device-runner-job config))) + +(define px-device-runner-service-type + (service-type + (name "px-device-runner") + (extensions + (list (service-extension mcron-service-type + px-device-runner-mcron-jobs))) + (description "Service definition to run device runnner as a cronjob") + (default-value (px-device-runner-configuration)))) + + +;; +;; File Upload Service +;; + +(define-record-type* <px-file-upload-configuration> + px-file-upload-configuration make-px-file-upload-configuration + px-file-upload-configuration? + (package px-file-upload-configuration-package + (default px-file-upload-cli)) + (schedule px-file-upload-configuration-schedule + (default "0 * * * *")) + (types px-file-upload-configuration-types + (default '())) + (source px-file-upload-configuration-source) + (endpoint px-file-upload-configuration-endpoint) + (keys px-file-upload-configuration-keys + (default '())) + (parse? px-file-upload-configuration-parse? + (default #f)) + (delete-on-success? px-file-upload-configuration-delete-on-success? + (default #f))) + + +(define (px-file-upload-configuration->config config) + "Return configuration file for px-file-upload-cli" + (match config + (($ <px-file-upload-configuration> + package schedule types source endpoint keys parse? delete-on-success?) + (computed-file "file-upload.conf" + (with-imported-modules + '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (call-with-output-file #$output + (lambda (port) + (format port + "types = ~a +source = ~a +endpoint = ~a +keys = ~a +parse_file_name = ~a +delete_on_success = ~a" + #$(string-join types ",") + #$source + #$endpoint + #$(string-join keys "") + #$(if parse? "true" "false") + #$(if delete-on-success? "true" "false")))))))))) + + +(define (px-file-upload-mcron-jobs config) + (let ((configpath (px-file-upload-configuration->config config)) + (schedule (px-file-upload-configuration-schedule config)) + (package (px-file-upload-configuration-package config))) + (list + #~(job #$schedule + (string-append + #$package "/bin/px-file-upload-cli" + " --config " #$configpath))))) + + +(define px-file-upload-service-type + (service-type + (name 'px-file-upload) + (extensions + (list (service-extension mcron-service-type + px-file-upload-mcron-jobs) + (service-extension profile-service-type + (lambda (config) + (list (px-file-upload-configuration-package config) + px-device-identity + tpm2-tss-engine))))) + (description "Service definition to run file upload on intervals"))) + +;; +;; btuart-service-type +;; + +(define-record-type* <btuart-configuration> + btuart-configuration make-btuart-configuration + btuart-configuration? + (package btuart-configuration-package + (default bluez)) + (device btuart-configuration-device + (default "/dev/ttyAMA0")) + (protocol btuart-configuration-protocol + (default "bcm")) + (baudrate btuart-configuration-baudrate + (default "3000000")) + (flow-control? btuart-configuration-flow-control? + (default #t))) + + +(define btuart-shepherd-service + (match-lambda + (($ <btuart-configuration> package device protocol baudrate flow-control?) + (list + (shepherd-service + (documentation "attach serial lines as Bluetooth HCI interfaces") + (provision '(btuart)) + (requirement '(udev)) + (start #~(make-forkexec-constructor + (list #$(file-append package "/bin/btattach") + "-B" #$device "-P" #$protocol + "-S" #$baudrate + (when #$flow-control? "-N")))) + (one-shot? #t)))))) + + +(define btuart-service-type + (service-type + (name 'btuart) + (extensions (list (service-extension shepherd-root-service-type + btuart-shepherd-service))) + (default-value (btuart-configuration)) + (description "Attach serial lines as Bluetooth HCI interfaces"))) + +;; +;; bluetooth-client-manager-service +;; + +(define-record-type* <bluetooth-client-manager-configuration> + bluetooth-client-manager-configuration make-bluetooth-client-manager-configuration + bluetooth-client-manager-configuration? + (package bluetooth-client-manager-configuration-package + (default bluetooth-client-manager-service)) + (debug? bluetooth-client-manager-configuration-debug? + (default #f)) + (skip-approval? bluetooth-client-manager-configuration-skip-approval? + (default #f))) + + +(define bluetooth-client-manager-shepherd-service + (match-lambda + (($ <bluetooth-client-manager-configuration> package debug? skip-approval?) + (list (shepherd-service + (provision '(bluetooth-client-manager-service)) + (documentation "Run px-device-identity-service as a daemon") + (requirement '(networking user-processes px-device-identity)) + (start #~(make-forkexec-constructor + (list (string-append #$package "/bin/bluetooth-client-manager-service") + #$@(if debug? '("--verbose") '()) + #$@(if skip-approval? '("--skip-approval") '())) + #:log-file "/var/log/bluetooth-client-manager-service.log" + #:environment-variables + (cons* "HOME=/root" + "XDG_DATA_HOME=/root/.local/share" + "XDG_CONFIG_HOME=/root/.config" + "SSL_CERT_DIR=/run/current-system/profile/etc/ssl/certs" + "SSL_CERT_FILE=/run/current-system/profile/etc/ssl/certs/ca-certificates.crt" + (default-environment-variables)))) + (stop #~(make-kill-destructor))))))) + + +(define bluetooth-client-manager-service-type + (service-type + (name 'bluetooth-client-manager-service) + (description "PantherX Bluetooth Client Manager service") + (extensions (list (service-extension shepherd-root-service-type + bluetooth-client-manager-shepherd-service))) + (default-value (bluetooth-client-manager-configuration)))) diff --git a/px/services/disk.scm b/px/services/disk.scm new file mode 100644 index 0000000..ca10546 --- /dev/null +++ b/px/services/disk.scm @@ -0,0 +1,99 @@ +;;; Desktop service definitions for PantherX +;;; +;;; Reza Alizadeh Majd <r.majd@pantherx.org> +;;; Franz Geffke <franz@pantherx.org> +;;; + +(define-module (px services disk) + #:use-module (gnu packages admin) + #:use-module (gnu packages base) + #:use-module (gnu packages linux) + #:use-module (gnu packages xdisorg) + #:use-module (gnu services) + #:use-module (gnu services base) + #:use-module (gnu services cups) + #:use-module (gnu services dbus) + #:use-module (gnu services desktop) + #:use-module (gnu services networking) + #:use-module (gnu services shepherd) + #:use-module (gnu system) + #:use-module (gnu system setuid) + #:use-module (guix build utils) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix records) + #:use-module (srfi srfi-1) + #:use-module (ice-9 match) + #:export (create-swap-space-service + + disk-init-configuration + disk-init-service-type)) + +;; +;; Create swap-file service +;; primarily for ARM +;; + +(define (create-swap-space-service size) + (simple-service 'create-swap-space + activation-service-type + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (let ((swapfile "/swapfile")) + (when (not (file-exists? swapfile)) + (invoke #+(file-append util-linux "/bin/fallocate") "-l" #$size swapfile) + (chmod swapfile #o600) + (invoke #+(file-append util-linux "/sbin/mkswap") swapfile) + )))))) + +;; +;; Disk initiation service +;; primarily for ARM +;; + +(define-record-type* <disk-init-configuration> + disk-init-configuration make-disk-init-configuration + disk-init-configuration? + (device disk-init-configuration-device) + (index disk-init-configuration-index) + (target disk-init-configuration-target) + (swap-size disk-init-configuration-swap-size + (default #f)) + (swap-path disk-init-configuration-swap-path + (default "/swapfile"))) + +(define disk-init-activation + (match-lambda + (($ <disk-init-configuration> device index target swap-size swap-path) + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (let ((lock-file "/etc/disk-init.lock")) + (when (not (file-exists? lock-file)) + ;; resize root partition + ;; workaround to fix growpart execution + (setenv "PATH" (string-append "/run/current-system/profile/bin:" (getenv "PATH"))) + (invoke #+(file-append cloud-utils "/bin/growpart") #$device #$index) + (invoke #+(file-append e2fsprogs "/sbin/resize2fs") #$target) + (invoke #+(file-append coreutils "/bin/sync")) + + ;; create swap-file + (when (and #$swap-size + (not (file-exists? #$swap-path))) + (invoke #+(file-append util-linux "/bin/fallocate") + "-l" #$swap-size #$swap-path) + (chmod #$swap-path #o600) + (invoke #+(file-append util-linux "/sbin/mkswap") #$swap-path)) + + (call-with-output-file lock-file + (lambda (port) + (display "disk image initiated\n" port)))))))))) + +(define disk-init-service-type + (service-type + (name 'disk-init) + (extensions (list + (service-extension activation-service-type + disk-init-activation))) + (description "Resize root partition on first boot and create swapfile"))) diff --git a/px/services/enterprise.scm b/px/services/enterprise.scm new file mode 100644 index 0000000..998092b --- /dev/null +++ b/px/services/enterprise.scm @@ -0,0 +1,126 @@ +(define-module (px services enterprise) + #:use-module (gnu packages bash) + #:use-module (gnu packages databases) + #:use-module (gnu services) + #:use-module (gnu services shepherd) + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module (ice-9 match) + #:export (px-channel-migration-configuration + px-channel-migration-service-type)) + +;;; +;;; Channel Migration Service +;;; + +(define-record-type* <px-channel-migration-configuration> + px-channel-migration-configuration make-px-channel-migration-configuration + px-channel-migration-configuration? + (profile px-channel-migration-configuration-profile ;; path to profile we want to migrate (root) + (default "/root/.config/guix/current")) + (config px-channel-migration-configuration-config ;; path to system configuration file + (default "/etc/system.scm")) + (channels px-channel-migration-configuration-channels ;; path to channels file + (default "/etc/guix/channels.scm")) + (branch px-channel-migration-configuration-branch) ;; target branch that we want to migrate to + (timeout px-channel-migration-configuration-timeout ;; timeout before start the migration + (default 60))) + + +(define (px-channel-migration->script config) + (match config + (($ <px-channel-migration-configuration> profile config channels branch timeout) + (computed-file + "px-channel-migration.sh" + #~(begin + (call-with-output-file #$output + (lambda (port) + (format port "# AUTO GENERATED BY: px-channel-migration-service +GUIX_PROFILE=~a +SYSTEM_CONFIG=~a +SYSTEM_CHANNELS=~a +TARGET_BRANCH=~a +START_TIMEOUT=~a +RETRY_TIMEOUT=15 +echo \"--------------------------------------------\" +echo \">>> service started\" +echo \">>> Sleep for $START_TIMEOUT\" +sleep $START_TIMEOUT + +UPGRADE_FILE=/etc/last_unattended_upgrade.txt + +if [ -f $UPGRADE_FILE ]; then + BOOT_TIME=$(cat /proc/stat | grep btime | awk '{print $2}') + LAST_UPGRADE=$(cat $UPGRADE_FILE) + if [ $BOOT_TIME -lt $LAST_UPGRADE ]; then + echo 'Migration ran once since last reboot. Exiting...' + exit 0 + fi +fi + +echo \">>> Profile Path: $GUIX_PROFILE\" +. \"$GUIX_PROFILE/etc/profile\" + +echo \">>> System status:\" +guix describe +current_branch=$(guix describe --format=recutils | ~a -e \"name='guix'\" -P 'branch') +# if [ \"$current_branch\" == \"$TARGET_BRANCH\" ]; then +# echo \"Machine already migrated\" +# exit 0 +# fi + +echo \">>> Pull latest changes\" +guix pull --allow-downgrades --disable-authentication +if [ $? -ne 0 ]; then + echo 'ERROR: Pull Failed' + exit 1 +fi + +echo \">>> Start system reconfigure\" +function perform_reconfigure { + guix time-machine --disable-authentication --channels=$SYSTEM_CHANNELS \ + -- system reconfigure --allow-downgrades $SYSTEM_CONFIG +} +perform_reconfigure +while [ $? -ne 0 ]; do + echo \"ERROR: reconfigure failed. retry in $RETRY_TIMEOUT seconds.\" + sleep $RETRY_TIMEOUT + perform_reconfigure +done + +guix describe +echo $(date +'%s') > $UPGRADE_FILE +echo \">>> Device channels migrated successfully.\" +" #$profile #$config #$channels #$branch #$timeout #$(file-append recutils "/bin/recsel"))))))))) + + +(define (px-channel-migration-shepherd-service config) + (match config + (($ <px-channel-migration-configuration> ...) + (let ((script (px-channel-migration->script config))) + (list (shepherd-service + (provision '(px-channel-migration)) + (documentation "Migrate device channels to new references") + (requirement '(networking user-processes)) + (one-shot? #t) + (start #~(make-forkexec-constructor + (list (string-append #$bash "/bin/bash") + #$script) + #:environment-variables + (cons* + "HOME=/root" + "XDG_DATA_HOME=/root/.local/share" + "XDG_CONFIG_HOME=/root/.config" + "SSL_CERT_DIR=/run/current-system/profile/etc/ssl/certs" + "SSL_CERT_FILE=/run/current-system/profile/etc/ssl/certs/ca-certificates.crt" + (default-environment-variables)) + #:log-file "/var/log/px-channel-migration.log")) + (stop #~(make-kill-destructor)))))))) + + +(define px-channel-migration-service-type + (service-type + (name 'px-channel-migration) + (description "Migrate device channels to new references") + (extensions (list (service-extension shepherd-root-service-type + px-channel-migration-shepherd-service))))) diff --git a/px/services/log.scm b/px/services/log.scm new file mode 100644 index 0000000..f8f2bc2 --- /dev/null +++ b/px/services/log.scm @@ -0,0 +1,152 @@ +(define-module (px services log) + #:use-module (gnu) + #:use-module (gnu packages admin) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages linux) + #:use-module (gnu packages logging) + #:use-module (gnu packages screen) + #:use-module (gnu services shepherd) + #:use-module (px packages log) + #:use-module (gnu system) + #:use-module (gnu system shadow) + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module (ice-9 match) + #:use-module (ice-9 pretty-print) + + #:export (remote-syslog-service-configuration + remote-syslog-service-type + + %rsyslog-default-config + %rsyslog-default-config-file + rsyslog-configuration + rsyslog-service-type)) + +;; +;; remote-syslog SERVICE +;; + +(define (script-builder destionation-host destionation-port hostname log-files package) + "Return the chorny configuration file corresponding to CONFIG." + (computed-file "remote-syslog-script.sh" + (with-imported-modules + '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (call-with-output-file #$output + (lambda (port) + (format port "#!~a~% exec ~a \"$@\"~%" + #+(file-append bash "/bin/sh") + (string-append #$package "/bin/remote_syslog2" + " --no-detach" + " -d " #$destionation-host + " -p " #$destionation-port + " --pid-file=/var/run/remote_syslog.pid" + " --hostname " #$hostname + " " #$log-files)) + (chmod port #o555))))))) + +(define-record-type* <remote-syslog-service-configuration> + remote-syslog-service-configuration make-remote-syslog-service-configuration + remote-syslog-service-configuration? + (destionation-host remote-syslog-service-configuration-destionation-host + (default "logs.papertrailapp.com")) + (destionation-port remote-syslog-service-configuration-destionation-port + (default "46169")) + (hostname remote-syslog-service-configuration-host + (default "$(hostname)")) + (log-files remote-syslog-service-configuration-log-files + (default "/var/log/messages")) + (package remote-syslog-service-configuration-package + (default remote_syslog2))) + +(define remote-syslog-shepherd-service + (match-lambda + (($ <remote-syslog-service-configuration> destionation-host destionation-port hostname log-files package) + (list (shepherd-service + (provision '(remote-syslog)) + (documentation "Run remote-syslog as a daemon") + (requirement '(networking syslogd)) + (start #~(make-forkexec-constructor + (list #$(script-builder destionation-host destionation-port hostname log-files package)))) + (stop #~(make-kill-destructor))))))) + +(define remote-syslog-service-type + (service-type + (name "remote-syslog") + (description "Remote syslog service") + (extensions (list (service-extension shepherd-root-service-type + remote-syslog-shepherd-service))) + (default-value (remote-syslog-service-configuration)))) + + +;; +;; rsyslog-service-type +;; + +(define %rsyslog-default-config + "## full conf created by rsyslog version 8.2204.1 at 2023-01-02 16:44:08 ## + +$ModLoad imuxsock # provides support for local system logging (e.g. via logger command) +$ModLoad imklog # provides kernel logging support (previously done by rklogd) +$ModLoad immark # provides --MARK-- message capability + +$ModLoad imudp +$UDPServerRun 514 + +$ModLoad imtcp +$InputTCPServerRun 514 + +$WorkDirectory /var/lib/rsyslog +$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat + +*.* /var/log/rsyslog +") + + +(define %rsyslog-default-config-file + (plain-file "rsyslog.conf" %rsyslog-default-config)) + + +(define-record-type* <rsyslog-configuration> + rsyslog-configuration make-rsyslog-cofiguration + rsyslog-configuration? + (package rsyslog-configuration-package + (default rsyslog)) + (config-file rsyslog-configuration-config-file + (default %rsyslog-default-config-file))) + + +(define (rsyslog-activation config) + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules ((guix build utils))) + (let ((lib-dir "/var/lib/rsyslog")) + (mkdir-p lib-dir))))) + + +(define rsyslog-shepherd-service + (match-lambda + (($ <rsyslog-configuration> package config-file) + (list + (shepherd-service + (provision '(rsyslogd)) + (documentation "Rsyslog daemon service") + (requirement '(syslogd)) + (start #~(make-forkexec-constructor + (list #$(file-append package "/sbin/rsyslogd") + "-n" "-f" #$config-file))) + (stop #~(make-kill-destructor))))))) + + +(define rsyslog-service-type + (service-type + (name 'rsyslog) + (description "Run rsyslog daemon on machine") + (extensions + (list (service-extension shepherd-root-service-type + rsyslog-shepherd-service) + (service-extension activation-service-type + rsyslog-activation))) + (default-value (rsyslog-configuration)))) diff --git a/px/services/monitoring.scm b/px/services/monitoring.scm new file mode 100644 index 0000000..a5c64e5 --- /dev/null +++ b/px/services/monitoring.scm @@ -0,0 +1,116 @@ +(define-module (px services monitoring) + #:use-module (gnu) + #:use-module (gnu packages base) + #:use-module (gnu packages curl) + #:use-module (gnu packages linux) + #:use-module (gnu packages gnome) + #:use-module (gnu packages screen) + #:use-module (gnu services shepherd) + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module (px packages device) + #:use-module (ice-9 match) + #:use-module (px packages monitoring) + #:export (<px-remote-status-service-configuration> + px-remote-status-service-configuration + px-remote-status-service-configuration? + px-remote-status-service-type)) + +;; +;; px-remote-status-service-type +;; + +(define-record-type* <px-remote-status-service-configuration> + px-remote-status-service-configuration make-px-remote-status-configuration + px-remote-status-service-configuration? + (package px-remote-status-service-configuration-package + (default px-org-remote-status-service)) + (interval px-remote-status-service-configuration-interval + (default 300)) + (jobs px-remote-status-service-configuration-jobs + (default '()))) + +(define (px-remote-service-configuration->monitrc config) + "Return monitrc file for config" + (match config + (($ <px-remote-status-service-configuration> jobs) + (computed-file + "monitrc" + (with-imported-modules + '((guix build utils)) + #~(begin + (use-modules (guix build utils) + (ice-9 match)) + (call-with-output-file #$output + (lambda (port) + (display "\ +### Monit default configurations +## Check interval +set daemon 30 # check services at 30 seconds intervals +# with start delay 240 # optional: delay the first check by 4-minutes (by +# # default Monit check immediately after Monit start) + +## Set syslog logging +set log syslog + +## Monit embedded HTTP interface +set httpd port 2812 and + use address localhost # only accept connection from localhost (drop if you use M/Monit) + allow localhost # allow localhost to connect to the server and + allow admin:monit # require user 'admin' with password 'monit' + +### Monit job definitions\n" port) + (for-each (lambda (job) + (display (string-append job "\n") port)) + '#$(px-remote-status-service-configuration-jobs config)) + )))))))) + +(define (px-remote-status-shepherd-service config) + "Return <shepherd-service> running px-org-remote-status-service" + (match config + (($ <px-remote-status-service-configuration> package interval) + (let ((monitrc (px-remote-service-configuration->monitrc config))) + (list (shepherd-service + (provision '(px-remote-status)) + (documentation "Run px-org-remote-status-service as a shepherd daemon") + (requirement '(networking user-processes px-device-identity)) + (modules `((srfi srfi-1) + (srfi srfi-26) + ,@%default-modules)) + (start #~(make-forkexec-constructor + (list (string-append #$screen "/bin/screen") + "-D" "-m" "-S" "remote-status" + (string-append #$package "/bin/px-org-remote-status-service") + "-i" (number->string #$interval) + "-m" #$monitrc) + #:environment-variables + (cons* (string-append "PATH=" + #$monit "/bin:" + #$network-manager "/bin:" + #$lshw "/sbin:" + #$coreutils "/bin:" + #$sysstat "/bin:" + #$curl "/bin:" + #$util-linux+udev "/bin:" + #$px-device-identity "/bin:" + "/run/current-system/profile/bin:" + (getenv "PATH")) + "HOME=/root" + "XDG_DATA_HOME=/root/.local/share" + "XDG_CONFIG_HOME=/root/.config" + "SSL_CERT_DIR=/run/current-system/profile/etc/ssl/certs" + "SSL_CERT_FILE=/run/current-system/profile/etc/ssl/certs/ca-certificates.crt" + (remove (cut string-prefix? "PATH=" <>) + (environ))))) + (stop #~(make-kill-destructor)))))))) + + + +(define px-remote-status-service-type + (service-type + (name 'px-remote-status) + (description "PantherX remote status service") + (extensions (list (service-extension shepherd-root-service-type + px-remote-status-shepherd-service))) + (default-value (px-remote-status-service-configuration)))) + diff --git a/px/services/networking.scm b/px/services/networking.scm new file mode 100644 index 0000000..eac9b81 --- /dev/null +++ b/px/services/networking.scm @@ -0,0 +1,157 @@ +(define-module (px services networking) + #:use-module (gnu) + #:use-module (gnu packages admin) + #:use-module (gnu packages base) + #:use-module (gnu packages linux) + #:use-module (gnu packages ntp) + #:use-module (gnu packages screen) + #:use-module (gnu services admin) + #:use-module (gnu services shepherd) + #:use-module (gnu system) + #:use-module (gnu system shadow) + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module (ice-9 match) + #:use-module (ice-9 pretty-print) + #:use-module (px packages networking) + #:use-module (srfi srfi-1) + + #:export (chrony-service-configuration + chrony-service-type + + nebula-configuration + nebula-configuration-package + nebula-configuration-provision + nebula-configuration-config-path + %default-nebula-configuration + nebula-service-type)) + +;; +;; Chrony SERVICE +;; + +(define-record-type* <chrony-service-configuration> + chrony-service-configuration make-chrony-service-configuration + chrony-service-configuration? + (package chrony-service-configuration-package + (default chrony)) + (user chrony-service-configuration-user + (default "root")) + (config chrony-service-configuration-config + (default "server 0.pool.ntp.org iburst +server 1.pool.ntp.org iburst +server 2.pool.ntp.org iburst +server 3.pool.ntp.org iburst +driftfile /var/lib/chrony/drift +makestep 1.0 3 +rtcsync +logdir /var/log/chrony"))) + +(define (chrony-service-config-file config) + "Return the chorny configuration file corresponding to CONFIG." + (computed-file "chrony.conf" + (with-imported-modules + '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (call-with-output-file #$output + (lambda (port) + (format port + #$config))))))) + +(define chrony-shepherd-service + (match-lambda + (($ <chrony-service-configuration> package user config) + (list (shepherd-service + (provision '(chrony)) + (documentation "Run chrony as a daemon") + (requirement '(networking)) + (start #~(make-forkexec-constructor + (list (string-append #$package "/sbin/chronyd") + "-n" "-u" #$user + "-f" #$(chrony-service-config-file config)))) + (stop #~(make-kill-destructor))))))) + +(define chrony-service-type + (service-type + (name "chrony") + (description "Chrony service") + (extensions (list (service-extension shepherd-root-service-type + chrony-shepherd-service))) + (default-value (chrony-service-configuration)))) + + +;; +;; Nebula SERVICE +;; + +(define-record-type* <nebula-configuration> + nebula-configuration + make-nebula-configuration + nebula-configuration? + (package nebula-configuration-package + (default nebula)) + (provision nebula-configuration-provision) + (config-path nebula-configuration-config-path)) + + +(define nebula-profile-packages + (lambda (configurations) + (fold (lambda (config prv) + (let ((pkg (nebula-configuration-package config))) + (if (memq pkg prv) + prv + (cons pkg prv)))) + '() configurations))) + + +(define (nebula-shepherd-service config) + (match config + (($ <nebula-configuration> package provision config-path) + (let ((log-path (string-append + "/var/log/" + (symbol->string (car provision)) + ".log"))) + (shepherd-service + (provision provision) + (documentation "Run configured instance of nebula on system start") + (requirement '(networking user-processes)) + (start #~(make-forkexec-constructor + (list (string-append #$package "/bin/nebula") + "-config" #$config-path) + #:log-file #$log-path + #:environment-variables + (cons* "HOME=/root" + "XDG_DATA_HOME=/root/.local/share" + "XDG_CONFIG_HOME=/root/.config" + "SSL_CERT_DIR=/run/current-system/profile/etc/ssl/certs" + "SSL_CERT_FILE=/run/current-system/profile/etc/ssl/certs/ca-certificates.crt" + (default-environment-variables)))) + (stop #~(make-kill-destructor))))))) + + +(define (nebula-shepherd-services configurations) + (map nebula-shepherd-service configurations)) + + +(define %default-nebula-configuration + (nebula-configuration + (provision '(nebula)) + (config-path "/etc/nebula/config.yml"))) + +(define %nebula-log-rotations + (list (log-rotation + (files (list "/var/log/nebula.log"))))) + +(define nebula-service-type + (service-type + (name 'nebula) + (extensions + (list (service-extension shepherd-root-service-type + nebula-shepherd-services) + (service-extension profile-service-type + nebula-profile-packages) + (service-extension rottlog-service-type + (const %nebula-log-rotations)))) + (default-value (list %default-nebula-configuration)) + (description "Run configured instance of nebula on system start"))) diff --git a/px/services/ntp.scm b/px/services/ntp.scm new file mode 100644 index 0000000..bbba3c6 --- /dev/null +++ b/px/services/ntp.scm @@ -0,0 +1,73 @@ +(define-module (px services ntp) + #:use-module (gnu) + #:use-module (gnu packages admin) + #:use-module (gnu packages base) + #:use-module (gnu packages linux) + #:use-module (gnu packages ntp) + #:use-module (gnu packages screen) + #:use-module (gnu services admin) + #:use-module (gnu services shepherd) + #:use-module (gnu system) + #:use-module (gnu system shadow) + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module (ice-9 match) + #:use-module (ice-9 pretty-print) + #:use-module (srfi srfi-1) + + #:export (chrony-service-configuration + chrony-service-type)) + +;; +;; Chrony SERVICE +;; + +(define-record-type* <chrony-service-configuration> + chrony-service-configuration make-chrony-service-configuration + chrony-service-configuration? + (package chrony-service-configuration-package + (default chrony)) + (user chrony-service-configuration-user + (default "root")) + (config chrony-service-configuration-config + (default "server 0.pool.ntp.org iburst +server 1.pool.ntp.org iburst +server 2.pool.ntp.org iburst +server 3.pool.ntp.org iburst +driftfile /var/lib/chrony/drift +makestep 1.0 3 +rtcsync +logdir /var/log/chrony"))) + +(define (chrony-service-config-file config) + "Return the chorny configuration file corresponding to CONFIG." + (computed-file "chrony.conf" + (with-imported-modules + '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (call-with-output-file #$output + (lambda (port) + (format port + #$config))))))) + +(define chrony-shepherd-service + (match-lambda + (($ <chrony-service-configuration> package user config) + (list (shepherd-service + (provision '(chrony)) + (documentation "Run chrony as a daemon") + (requirement '(networking)) + (start #~(make-forkexec-constructor + (list (string-append #$package "/sbin/chronyd") + "-n" "-u" #$user + "-f" #$(chrony-service-config-file config)))) + (stop #~(make-kill-destructor))))))) + +(define chrony-service-type + (service-type + (name "chrony") + (description "Chrony service") + (extensions (list (service-extension shepherd-root-service-type + chrony-shepherd-service))) + (default-value (chrony-service-configuration))))
\ No newline at end of file diff --git a/px/services/package-management.scm b/px/services/package-management.scm new file mode 100644 index 0000000..d393d2d --- /dev/null +++ b/px/services/package-management.scm @@ -0,0 +1,64 @@ +(define-module (px services package-management) + #:use-module (gnu) + #:use-module (gnu packages bash) + #:use-module (gnu services shepherd) + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module (ice-9 match) + #:use-module (px packages package-management) + #:export (px-unattended-upgrades-configuration + px-unattended-upgrades-configuration? + px-unattended-upgrades-service-type)) + +;; +;; px-unattended-upgrades-service-type +;; + +(define-record-type* <px-unattended-upgrades-configuration> + px-unattended-upgrades-configuration make-px-unattended-upgrades-configuration + px-unattended-upgrades-configuration? + (package px-unattended-upgrades-configuration-package + (default px-unattended-upgrades)) + (timeout px-unattended-upgrades-timeout + (default 300))) + + +(define (px-unattended-upgrades-configuration->script config) + (match config + (($ <px-unattended-upgrades-configuration> package timeout) + (computed-file + "px-unattended-upgrades.sh" + #~(begin + (call-with-output-file #$output + (lambda (port) + (display "# AUTO GENERATED BY: px-unattended-upgrades-shepherd-service\n\n" port) + (display "echo \"$(date) > service started: \"\n" port) + (format port "echo \"$(date) > sleep for: ~a\"\n" #$timeout) + (format port "sleep ~a\n" #$timeout) + (display "echo \"$(date) > start upgrade\"\n" port) + (format port "~a/bin/px-unattended-upgrades\n" #$package)))))))) + + +(define (px-unattended-upgrades-shepherd-service config) + (match config + (($ <px-unattended-upgrades-configuration> package timeout) + (let ((script (px-unattended-upgrades-configuration->script config))) + (list (shepherd-service + (provision '(px-unattended-upgrades)) + (documentation "Run px-unattended-upgrades once after reboot") + (requirement '(networking user-processes)) + (one-shot? #t) + (start #~(make-forkexec-constructor + (list (string-append #$bash "/bin/bash") + #$script) + #:log-file "/var/log/px-unattended-upgrades.log")) + (stop #~(make-kill-destructor)))))))) + + +(define px-unattended-upgrades-service-type + (service-type + (name 'px-unattended-upgrades) + (description "PantherX unattended upgrades service") + (extensions (list (service-extension shepherd-root-service-type + px-unattended-upgrades-shepherd-service))) + (default-value (px-unattended-upgrades-configuration)))) diff --git a/px/services/security-token.scm b/px/services/security-token.scm new file mode 100644 index 0000000..87c5d32 --- /dev/null +++ b/px/services/security-token.scm @@ -0,0 +1,123 @@ +;;; module for security tokens and hardware wallet related services +;;; Author: Reza Alizadeh Majd (r.majd@pantherx.org) + +(define-module (px services security-token) + #:use-module (gnu services base) + #:export (ledger-wallet-service + nitro-key-service)) + + +;;; +;;; Ledger hardware wallet definitions +;;; udev-rules from: https://github.com/LedgerHQ/udev-rules/blob/master/20-hw1.rules +;;; + +(define (ledger-udev-rule-record title vendor-id product-id tags) + (string-append "# " title "\n" + "SUBSYSTEMS==\"usb\", " + "ATTRS{idVendor}==\"" vendor-id "\", " + "ATTRS{idProduct}==\"" product-id "\", " + (string-join (map (lambda (tag) + (string-append "TAG+=\"" tag "\"")) + tags) ", ") + "\n")) + + +(define %ledger-udev-rule + (udev-rule "20-ledger.rules" + (string-append + (ledger-udev-rule-record "HW.1 / Nano" + "2581" + "1b7c|2b7c|3b7c|4b7c" + '("uaccess" "udev-acl")) + (ledger-udev-rule-record "Blue" + "2c97" + "0000|0000|0001|0002|0003|0004|0005|0006|0007|0008|0009|000a|000b|000c|000d|000e|000f|0010|0011|0012|0013|0014|0015|0016|0017|0018|0019|001a|001b|001c|001d|001e|001f" + '("uaccess" "udev-acl")) + (ledger-udev-rule-record "Nano S" + "2c97" + "0001|1000|1001|1002|1003|1004|1005|1006|1007|1008|1009|100a|100b|100c|100d|100e|100f|1010|1011|1012|1013|1014|1015|1016|1017|1018|1019|101a|101b|101c|101d|101e|101f" + '("uaccess" "udev-acl")) + + (ledger-udev-rule-record "Aramis" + "2c97" + "0002|2000|2001|2002|2003|2004|2005|2006|2007|2008|2009|200a|200b|200c|200d|200e|200f|2010|2011|2012|2013|2014|2015|2016|2017|2018|2019|201a|201b|201c|201d|201e|201f" + '("uaccess" "udev-acl")) + (ledger-udev-rule-record "HW2" + "2c97" + "0003|3000|3001|3002|3003|3004|3005|3006|3007|3008|3009|300a|300b|300c|300d|300e|300f|3010|3011|3012|3013|3014|3015|3016|3017|3018|3019|301a|301b|301c|301d|301e|301f" + '("uaccess" "udev-acl")) + (ledger-udev-rule-record "Nano X" + "2c97" + "0004|4000|4001|4002|4003|4004|4005|4006|4007|4008|4009|400a|400b|400c|400d|400e|400f|4010|4011|4012|4013|4014|4015|4016|4017|4018|4019|401a|401b|401c|401d|401e|401f" + '("uaccess" "udev-acl")) + (ledger-udev-rule-record "Ledger Test" + "2c97" + "0005|5000|5001|5002|5003|5004|5005|5006|5007|5008|5009|500a|500b|500c|500d|500e|500f|5010|5011|5012|5013|5014|5015|5016|5017|5018|5019|501a|501b|501c|501d|501e|501f" + '("uaccess" "udev-acl"))))) + + +(define (ledger-wallet-service) + (udev-rules-service 'ledger %ledger-udev-rule)) + + +;;; +;;; Nitrokey definitions +;;; udev-rules from: https://raw.githubusercontent.com/Nitrokey/libnitrokey/master/data/41-nitrokey.rules +;;; + +(define %nitro-key-udev-rule + (udev-rule "41-nitrokey.rules" + "ACTION!=\"add|change\", GOTO=\"u2f_end\" +# Nitrokey U2F +KERNEL==\"hidraw*\", SUBSYSTEM==\"hidraw\", ATTRS{idVendor}==\"2581\", ATTRS{idProduct}==\"f1d0\", TAG+=\"uaccess\" +# Nitrokey FIDO U2F +KERNEL==\"hidraw*\", SUBSYSTEM==\"hidraw\", ATTRS{idVendor}==\"20a0\", ATTRS{idProduct}==\"4287\", TAG+=\"uaccess\" +# Nitrokey FIDO2 +KERNEL==\"hidraw*\", SUBSYSTEM==\"hidraw\", ATTRS{idVendor}==\"20a0\", ATTRS{idProduct}==\"42b1\", TAG+=\"uaccess\" +# Nitrokey 3 NFC +KERNEL==\"hidraw*\", SUBSYSTEM==\"hidraw\", ATTRS{idVendor}==\"20a0\", ATTRS{idProduct}==\"42b3\", TAG+=\"uaccess\" + +LABEL=\"u2f_end\" + + +SUBSYSTEM!=\"usb\", GOTO=\"gnupg_rules_end\" +ACTION!=\"add\", GOTO=\"gnupg_rules_end\" + +# USB SmartCard Readers +## Crypto Stick 1.2 +ATTR{idVendor}==\"20a0\", ATTR{idProduct}==\"4107\", ENV{ID_SMARTCARD_READER}=\"1\", ENV{ID_SMARTCARD_READER_DRIVER}=\"gnupg\", TAG+=\"uaccess\" +## Nitrokey Pro +ATTR{idVendor}==\"20a0\", ATTR{idProduct}==\"4108\", ENV{ID_SMARTCARD_READER}=\"1\", ENV{ID_SMARTCARD_READER_DRIVER}=\"gnupg\", TAG+=\"uaccess\" +## Nitrokey Pro Bootloader +ATTRS{idVendor}==\"20a0\", ATTRS{idProduct}==\"42b4\", TAG+=\"uaccess\" +## Nitrokey Storage +ATTR{idVendor}==\"20a0\", ATTR{idProduct}==\"4109\", ENV{ID_SMARTCARD_READER}=\"1\", ENV{ID_SMARTCARD_READER_DRIVER}=\"gnupg\", TAG+=\"uaccess\" +## Nitrokey Start +ATTR{idVendor}==\"20a0\", ATTR{idProduct}==\"4211\", ENV{ID_SMARTCARD_READER}=\"1\", ENV{ID_SMARTCARD_READER_DRIVER}=\"gnupg\", TAG+=\"uaccess\" +## Nitrokey HSM +ATTR{idVendor}==\"20a0\", ATTR{idProduct}==\"4230\", ENV{ID_SMARTCARD_READER}=\"1\", ENV{ID_SMARTCARD_READER_DRIVER}=\"gnupg\", TAG+=\"uaccess\" + +LABEL=\"gnupg_rules_end\" + + +# Nitrokey Storage dev Entry +KERNEL==\"sd?1\", ATTRS{idVendor}==\"20a0\", ATTRS{idProduct}==\"4109\", SYMLINK+=\"nitrospace\"")) + +(define (nitro-key-service) + (udev-rules-service 'nitro %nitro-key-udev-rule)) + + +;;; +;;; YubiKey definitions +;;; https://wiki.archlinux.org/title/YubiKey#YubiKey_not_acting_as_HID_device +;;; DO NOTE: This rule is very similar to 1st of Nitrokey +;;; + +(define %yubikey-udev-rule + (udev-rule "10-security-key.rules" + " +KERNEL==\"hidraw*\", SUBSYSTEM==\"hidraw\", MODE=\"0664\", GROUP=\"users\", ATTRS{idVendor}==\"2581\", ATTRS{idProduct}==\"f1d0\"")) + +(define (yubikey-service) + (udev-rules-service 'yubikey %yubikey-udev-rule)) diff --git a/px/services/server.scm b/px/services/server.scm new file mode 100644 index 0000000..acb721b --- /dev/null +++ b/px/services/server.scm @@ -0,0 +1,76 @@ +(define-module (px services server) + #:use-module (gnu packages bash) + #:use-module (gnu packages node) + #:use-module (gnu services) + #:use-module (gnu services shepherd) + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module (ice-9 match) + #:export (px-server-launcher-configuration + px-server-launcher-service-type)) + + +;;; +;;; PantherX Server Launcher Service +;;; + +(define-record-type* <px-server-launcher-configuration> + px-server-launcher-configuration make-px-server-launcher-configuration + px-server-launcher-configuration? + (user px-server-launcher-configuration-user + (default "panther")) + (group px-server-launcher-configuration-group + (default "users")) + (executable px-server-launcher-configuration-executable) + (args px-server-launcher-configuration-args + (default '())) + (cwd px-server-launcher-configuration-cwd + (default #f))) + + +(define (px-server-launcher->script config) + (match config + (($ <px-server-launcher-configuration> user group executable args cwd) + (plain-file "px-server-launcher" + (string-append "#!/bin/sh\n\n" + "export PATH=$HOME/.local/bin:$PATH\n" ;; add user installed binaries to PATH + (if cwd (string-append "cd " cwd "\n") "") + "exec " executable " " (string-join args " ") "\n"))))) + + +(define (px-server-launcher-shepherd-service config) + (match config + (($ <px-server-launcher-configuration> user group executable args cwd) + (let* ((home-dir (if (eq? user "root") + "/root" + (string-append "/home/" user))) + (script (px-server-launcher->script config))) + (list (shepherd-service + (provision '(px-server-launcher)) + (documentation "PantherX Server Application Launcher Service") + (requirement '(networking user-processes)) + (one-shot? #t) + (start #~(make-forkexec-constructor + (list (string-append #$bash "/bin/bash") + #$script) + #:user #$user + #:group #$group + #:environment-variables + (cons* (string-append "HOME=" #$home-dir) + (string-append "PATH=/run/current-system/profile/bin") + (string-append "XDG_DATA_HOME=" #$home-dir "/.local/share") + (string-append "XDG_CONFIG_HOME=" #$home-dir "/.config") + "SSL_CERT_DIR=/run/current-system/profile/etc/ssl/certs" + "SSL_CERT_FILE=/run/current-system/profile/etc/ssl/certs/ca-certificates.crt" + (default-environment-variables)) + #:log-file "/var/log/px-server-launcher.log")) + (stop #~(make-kill-destructor)))))))) + + +(define px-server-launcher-service-type + (service-type + (name 'px-server-launcher) + (description "PantherX Server Application Launcher Service") + (extensions (list + (service-extension shepherd-root-service-type + px-server-launcher-shepherd-service))))) diff --git a/px/system/config.scm b/px/system/config.scm new file mode 100644 index 0000000..6ec4f4c --- /dev/null +++ b/px/system/config.scm @@ -0,0 +1,223 @@ +;;; PantherX System Configuration Module +;;; This module supports configuration modules for PantherX OS definitions +;;; +;;; Reza Alizadeh Majd <r.majd@pantherx.org> +;;; Franz Geffke <franz@pantherx.org> +;;; + +(define-module (px system config) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader u-boot) + #:use-module (gnu services) + #:use-module (gnu system) + #:use-module (gnu system accounts) + #:use-module (gnu system nss) + #:use-module (gnu system file-systems) + #:use-module (gnu system shadow) + #:use-module (nongnu packages linux) + #:use-module (nongnu system linux-initrd) + #:use-module (px packages base) + #:use-module (px services base) + #:use-module (px system os) + #:use-module (guix gexp) + #:use-module (srfi srfi-1) + #:export (px-core-os + + px-desktop-os + px-desktop-ee-os + px-new-desktop + + px-server-os + px-server-ee-os + + px-core-arm-os + px-gui-arm-os + px-desktop-arm-os + + %px-server-open-ports-common) + +;; Re-export for convenience +#:re-export (%px-core-services + + px-desktop-service-type + + %px-desktop-services + %px-desktop-ee-services + + %px-server-services + %px-server-ee-services + + %px-core-arm-services + %px-gui-arm-services + %px-desktop-arm-services + + %px-core-packages + + %px-desktop-packages-gtk + %px-desktop-packages-qt + %px-desktop-packages + %px-desktop-ee-packages + + %px-server-packages + %px-server-ee-packages + %px-core-arm-packages + %px-gui-arm-packages)) + +;;; +;;; PantherX Desktop OS defintions +;;; + +(define %px-desktop-swap-devices + (list (swap-space (target "/swapfile")))) + +(define %px-server-open-ports-common + '(("tcp" "ssh" "http" "https"))) + +;;; +;;; CORE +;;; + +(define* (px-core-os os-config #:key + (kernel 'libre) + (templates '()) + (open-ports #f) + (authorized-keys '())) + "returns operating-system definition for px-core-os, based on config" + (make-os os-config + #:kernel kernel + #:open-ports open-ports + #:authorized-keys authorized-keys + #:templates templates + #:default-packages %px-core-packages + #:default-services %px-core-services)) + +;;; +;;; DESKTOP +;;; + +(define* (px-desktop-os os-config #:key + (kernel 'nonlibre) + (templates '()) + (open-ports #f) + (authorized-keys '())) + (make-os (operating-system + (inherit os-config) + (swap-devices + (prepare-swap-devices os-config %px-desktop-swap-devices))) + #:kernel kernel + #:open-ports open-ports + #:authorized-keys authorized-keys + #:templates templates + #:default-packages %px-desktop-packages + #:default-services %px-desktop-services)) + +(define* (px-desktop-ee-os os-config #:key + (kernel 'nonlibre) + (templates '()) + (open-ports #f) + (authorized-keys '())) + (make-os (operating-system + (inherit os-config) + (swap-devices + (prepare-swap-devices os-config %px-desktop-swap-devices))) + #:kernel kernel + #:open-ports open-ports + #:authorized-keys authorized-keys + #:templates templates + #:default-packages %px-desktop-ee-packages + #:default-services %px-desktop-ee-services)) + +(define* (px-new-desktop os-config #:key + (kernel 'nonlibre) + (open-ports #f) + (authorized-keys '()) + (templates '())) + (make-os os-config + #:kernel kernel + #:open-ports open-ports + #:authorized-keys authorized-keys + #:templates templates + #:default-packages %px-desktop-packages + #:default-services %px-desktop-services)) + +;;; +;;; SERVER +;;; + +(define* (px-server-os os-config #:key + (kernel 'libre) + (templates '()) + (open-ports %px-server-open-ports-common) + (authorized-keys '())) + (make-os os-config + #:kernel kernel + #:open-ports open-ports + #:authorized-keys authorized-keys + #:templates templates + #:default-packages %px-server-packages + #:default-services %px-server-services)) + +(define* (px-server-ee-os os-config #:key + (kernel 'libre) + (templates '()) + (open-ports %px-server-open-ports-common) + (authorized-keys '())) + (make-os os-config + #:kernel kernel + #:open-ports open-ports + #:authorized-keys authorized-keys + #:templates templates + #:default-packages %px-server-ee-packages + #:default-services %px-server-ee-services)) + + +;;; +;;; ARM +;;; + +(define px-core-arm-os + (operating-system + (host-name "pantherx") + (timezone "Europe/Berlin") + (locale "en_US.utf8") + + (bootloader (bootloader-configuration + (bootloader u-boot-bootloader) + (targets '("/dev/vda")))) + + (file-systems (cons (file-system + (device "/dev/sda1") + (mount-point "/") + (type "ext4")) + %base-file-systems)) + + (users (cons* (user-account + (name "panther") + (comment "default user") + (group "users") + (password (crypt "pantherx" "$6$abc")) + (supplementary-groups '("wheel" "netdev" "lp" + "video" "audio"))) + %base-user-accounts)) + + (packages %px-core-arm-packages) + (services %px-core-arm-services) + (name-service-switch %mdns-host-lookup-nss))) + +(define px-gui-arm-os + (operating-system + (inherit px-core-arm-os) + (host-name "pantherx") + (packages %px-gui-arm-packages) + (services %px-gui-arm-services))) + +(define (px-desktop-arm-os os-config) + (let ((selected-packages (prepare-packages os-config %px-desktop-arm-packages)) + (selected-services (prepare-services os-config %px-desktop-arm-services))) + (operating-system + (inherit os-config) + + (packages selected-packages) + (services selected-services) + + (name-service-switch %mdns-host-lookup-nss))))
\ No newline at end of file diff --git a/px/system/config/config b/px/system/config/config new file mode 100644 index 0000000..c919b65 --- /dev/null +++ b/px/system/config/config @@ -0,0 +1,205 @@ +;; This is an operating system configuration template +;; for PantherX core Desktop + +(use-modules (gnu) + (gnu system nss) + (gnu packages fonts) + (gnu packages gnuzilla) + (gnu packages gnome) + (gnu packages qt) + (gnu packages rsync) + (gnu packages vim) + (guix build utils) + (px packages accounts) + (px packages user-services) + (px packages themes) + (px packages desktop) + (px packages software) + (px packages tarsnap) + (px packages settings) + (px packages hub) + (srfi srfi-1)) + + +(load "pxconfig.scm") +(use-modules (pxconfig)) + +;; Yeap! We really need to organize those package more logically ... + +(use-service-modules desktop networking ssh xorg sddm dbus avahi) +(use-package-modules connman screen ssh certs tls version-control lxqt xorg) + + +;; +;; PantherX Packages Definition +;; +(define %panther-packages + (cons* px-user-services + + ;; PantherX Desktop Applications + px-software + px-settings-ui + + ;; px-accounts-service related plugins + px-accounts-service-plugin-oauth2-github + px-accounts-service-plugin-oauth2-mastodon + px-accounts-service-plugin-oauth2-google + + ;; px-hub-service related plugins + px-hub-service-plugin-mastodon + + ;; px-settings-service related plugins + px-settings-service-plugin-accounts + px-settings-service-plugin-software + + %base-packages)) + + +;; +;; PantherX Services Definition +;; +(define %panther-services + (cons* + ;; Desktopp + (service sddm-service-type + (sddm-configuration + (minimum-uid 1000) + (theme "darkine"))) + (service elogind-service-type) + (service udisks-service-type) + (service dbus-root-service-type) + (service colord-service-type) + (service polkit-service-type) + (service ntp-service-type) + (service avahi-service-type) + (service upower-service-type) + + ;; network configuration + (service openssh-service-type + (openssh-configuration + (port-number 22) + (permit-root-login 'without-password) + (authorized-keys + `()))) + (service wpa-supplicant-service-type) + (service connman-service-type + (connman-configuration + (disable-vpn? #f))) + + ;; System Services + ;; We need to Authorize public key of PantherX build server + ;; before using this new configuration on core image: + ;; $ guix archive --authorize < path/to/signing-key.pub + (modify-services %base-services + (guix-service-type + config => (guix-configuration + (substitute-urls '("https://ci.guix.gnu.org" + "https://build.pantherx.org"))))))) + +;; +;; PantherX Skeleton Fils Definition +;; +(define (pantherx-skeletons) + (define mkpath + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (mkdir-p #$output)))) + + (let ((gtk2 "\ +# Created by lxqt-config-appearance (DO NOT EDIT!) +gtk-theme-name = \"Breeze\" +gtk-icon-theme-name = \"breeze\" +gtk-font-name = \"Source Sans Pro 11\" +gtk-button-images = 1 +gtk-menu-images = 1 +gtk-toolbar-style = GTK_TOOLBAR_BOTH_HORIZ") + (gtk3 "\ +# Created by lxqt-config-appearance (DO NOT EDIT!) +[Settings] +gtk-theme-name = Breeze +gtk-icon-theme-name = breeze +# GTK3 ignores bold or italic attributes. +gtk-font-name = Source Sans Pro 11 +gtk-menu-images = 1 +gtk-button-images = 1 +gtk-toolbar-style = GTK_TOOLBAR_BOTH_HORIZ") + (pcmanfmqt "\ +[Desktop] +Wallpaper=/run/current-system/profile/share/wallpapers/pantherx/wallpaper.jpg +WallpaperMode=zoom")) + (append + `((".config/guix" ,(computed-file "channels_dir" mkpath)) + (".gtkrc-2.0" ,(plain-file "gtk2" gtk2)) + (".config/gtk-3.0" ,(computed-file "gtk3_dir" mkpath)) + (".config/gtk-3.0/settings.ini" ,(plain-file "gtk3" gtk3)) + (".config/pcmanfm-qt/lxqt" ,(computed-file "pcmanfmqt_dir" mkpath)) + (".config/pcmanfm-qt/lxqt/settings.conf" ,(plain-file "pcmanfmqt" pcmanfmqt))) + (default-skeletons) + ))) + + +(load "pxconfig.scm") +(use-modules (pxconfig)) + +;; +;; Operating System Definition +;; +(operating-system + (host-name hostname) + (timezone timezone) + (locale locale) + + ;; Boot in "legacy" BIOS mode + (bootloader (bootloader-configuration + (bootloader grub-bootloader) + (target "/dev/sda"))) + (file-systems (cons (file-system + (device (file-system-label "my-root")) + (mount-point "/") + (type "ext4")) + %base-file-systems)) + + ;; in case of low memory occurence during build, you need to uncomment + ;; `swap-devices` section and perform these steps before reconfigure: + ;; + ;; 1. fallocate -l 1G /swapfile + ;; 2. chmod 600 /swapfile + ;; 3. mkswap /swapfile + ;; 4. swapon /swapfile + ; (swap-devices '("/swapfile")) + + ;; The "root" account is implicit + (users (cons (user-account + (name username) + (comment comment) + (group groupname) + ;; Adding the account to the "wheel" group + ;; makes it a sudoer. Adding it to "audio" + ;; and "video" allows the user to play sound + ;; and access the webcam. + (supplementary-groups '("wheel" + "audio" "video")) + (home-directory (string-append "/home/" username))) + %base-user-accounts)) + + (skeletons (pantherx-skeletons)) + + ;; Globally-installed packages. + (packages (cons* openssh nss-certs gnutls + git vim rsync ;; development + screen ;; terminal window manager + ;; Desktop + px-desktop-dev ;; desktop + ;; PantherX stuff for desktop + ;; tarsnap + ;; build failed: px-settings-service + ;; Temporary - to reduce compile times + ;; qtwebkit + %panther-packages)) + + ;; Add services to the baseline + (services %panther-services) + + ;; Allow resolution of '.local' host names with mDNS. + (name-service-switch %mdns-host-lookup-nss)) diff --git a/px/system/config/pxconfig b/px/system/config/pxconfig new file mode 100644 index 0000000..f30b93b --- /dev/null +++ b/px/system/config/pxconfig @@ -0,0 +1,11 @@ + +(define-module (pxconfig) + #:export (username comment groupname timezone locale hostname) + #:declarative? #f) + +(define username "panther") +(define comment "-") +(define groupname "users") +(define hostname "my-computer.local") +(define timezone "Europe/Berlin") +(define locale "en_US.UTF-8") diff --git a/px/system/install.scm b/px/system/install.scm new file mode 100644 index 0000000..14263b3 --- /dev/null +++ b/px/system/install.scm @@ -0,0 +1,28 @@ +;;; PantherX disk image configuration file +;;; +;;; Author: Reza Alizadeh Majd <r.majd@PantherX.org> +;;; Version: 1.0.0 +;;; Time-stamp: <2022-02-09 21:33:50 reza> + +;; Generate a bootable image (e.g. for USB sticks, etc.) with: +;; $ guix system disk-image path/to/px-install.scm +;; Using Guix time-machine +;; $ guix time-machine --channels=/path/to/channels.scm -- system disk-image /path/to/px-install.scm + +(define-module (px system install) + #:use-module (gnu system) + #:use-module (gnu system install) + #:use-module (nongnu packages linux) + #:use-module (px packages setup) + #:export (installation-os-nonfree)) + +(define px-installation-os + (operating-system + (inherit installation-os) + (kernel linux) + (firmware (list linux-firmware)) + + (packages (cons* px-install + (operating-system-packages installation-os))))) + +px-installation-os diff --git a/px/system/os.scm b/px/system/os.scm new file mode 100644 index 0000000..cdff7e8 --- /dev/null +++ b/px/system/os.scm @@ -0,0 +1,319 @@ +(define-module (px system os) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader grub) + #:use-module (gnu packages linux) + #:use-module (gnu services) + #:use-module (gnu services base) + #:use-module (gnu services networking) + #:use-module (gnu services ssh) + #:use-module (gnu system) + #:use-module (gnu system file-systems) + #:use-module (gnu system linux-initrd) + #:use-module (gnu system nss) + #:use-module (nongnu packages linux) + #:use-module (nongnu system linux-initrd) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix records) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:export (make-os + + os-template + os-template-service + + ;; used in px system config + prepare-packages + prepare-services + prepare-swap-devices + + ;; used in ee repo + adjust-bootloader-theme + + ;; This is not used anywhere + ;; %px-artwork-repository + ;; %px-grub-theme + + ;; %px-substitute-server-url + ;; %px-substitute-server-key + ;; apply-px-substitute-server + )) + +;;; +;;; Templates +;;; + +(define-record-type* <os-template-service> + os-template-service make-os-template-service + os-template-service? + (type os-template-service-type) ; type of modification required: 'add 'edit 'delete + (kind os-template-service-kind) ; service-kind that needs to be matched + (action os-template-service-action ; action to be applied on service + (default #f))) + +(define-record-type* <os-template> + os-template make-os-template + os-template? + (title os-template-title) + (firmwares os-template-firmwares ; list of firmwares to be installed + (default '())) + (packages os-template-packages ; list of <package> to be installed + (default '())) + (services os-template-services ; list of <os-template-service> + (default '()))) + +(define (apply-template-firmwares initial-firmwares template-firmwares) + (fold (lambda (firmware result) + (if (memq firmware result) + result + (cons firmware result))) + initial-firmwares + template-firmwares)) + +(define (apply-template-package-imports initial-packages template-packages) + (fold (lambda (pkg result) + (if (memq pkg result) + result + (cons pkg result))) + initial-packages + template-packages)) + +(define (apply-template-service-modifications initial-services template-services) + (fold (lambda (svc result) + (match svc + (($ <os-template-service> type kind action) + (case type + ((add) (cons (if action + (service kind action) + (service kind)) + result)) + ((edit) (modify-services result + (kind config => (action config)))) + ((delete) (remove (lambda (s) + (eq? (service-kind s) kind)) + result)) + (else result))))) + initial-services + template-services)) + +(define (apply-templates os-configuration os-templates) + (fold (lambda (template result) + (let ((target-firmwares (apply-template-firmwares + (operating-system-firmware os-configuration) + (os-template-firmwares template))) + (target-packages (apply-template-package-imports + (operating-system-packages result) + (os-template-packages template))) + (target-services (apply-template-service-modifications + (operating-system-user-services result) + (os-template-services template)))) + (operating-system + (inherit result) + (firmware target-firmwares) + (packages target-packages) + (services target-services)))) + os-configuration + os-templates)) + +;; +;; Firewall customization +;; + +(define (make-firewall-rules open-ports) + (define (make-port-rules open-ports status) + "Generate list of strings each is a port/service rule for nftables" + (reduce-right append '() + (map (match-lambda + ((protocol ports ...) + (map (lambda (port) + (string-append " " protocol " dport " port " " status)) + ports))) + open-ports))) + (let ((port-rules (make-port-rules open-ports "accept"))) + (plain-file "nftables" + (string-append + "#PantherX firewall rules\n" + "table inet filter {\n" + " chain input {\n" + " type filter hook input priority 0; policy drop;\n" + " # early drop of invalid connections\n" + " ct state invalid drop\n" + " # allow established/related connections\n" + " ct state { established, related } accept\n" + " # allow from loopback\n" + " iifname lo accept\n" + " # allow icmp\n" + " ip protocol icmp accept\n" + " ip6 nexthdr icmpv6 accept\n" + (string-join port-rules "\n" 'suffix) + " # reject everything else\n" + " reject with icmpx type port-unreachable\n" + " }\n" + " chain forward {\n" + " type filter hook forward priority 0; policy drop;\n" + " }\n" + " chain output {\n" + " type filter hook output priority 0; policy accept;\n" + " }\n" + "}\n")))) + +;; +;; OS customization +;; + +(define %px-artwork-repository + (let ((commit "ecfd456e814a59e3b6743bcda83eab5d5c12ae99")) + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.pantherx.org/development/desktop/px-artwork.git") + (commit commit))) + (file-name (string-append "px-artwork-" (string-take commit 7) + "-checkout")) + (sha256 + (base32 + "06i47c8qp239c9rgkcizk3jd8rld4qbx90s5gg1a1rw1x90p245z"))))) + +(define %px-grub-theme + (grub-theme + (image (file-append %px-artwork-repository + "/grub/PantherX-4-3.svg")))) + +(define %px-substitute-server-url + "https://packages.pantherx.org") + +(define %px-substitute-server-key + (plain-file "packages.pantherx.org.pub" + "(public-key + (ecc + (curve Ed25519) + (q #E8322D13EA02C09F06CB70FDA2ABBFD5E463F2AA34C18C692F5E25858F4E315D#) + ) + ) +")) + +(define (adjust-bootloader-theme config) + (let* ((bootloader-config (operating-system-bootloader config)) + (bootloader (bootloader-configuration-bootloader bootloader-config))) + (case (bootloader-name bootloader) + ((grub grub-efi) + (bootloader-configuration + (inherit bootloader-config) + (theme %px-grub-theme))) + (else bootloader-config)))) + +(define (prepare-packages config default-packages) + "Check if custom packages provided in system configuration file or not. +return @code{default-packages} if there was no modifications applied." + (let ((package-list (operating-system-packages config))) + (if (eq? package-list %base-packages) + default-packages + package-list))) + +(define (prepare-services config default-services) + "Check if custom services provided in system configuration file or not. +return @code{default-services} if there is no modification applied." + (let ((service-list (operating-system-user-services config))) + (if (eq? service-list %base-services) + default-services + service-list))) + +(define (prepare-swap-devices config default-value) + "Check if custom definition provided for swap-devices or not. +return @code{defaule-value} if there is no modification applied." + (let ((devices (operating-system-swap-devices config))) + (if (eq? devices '()) + default-value + devices))) + +(define (prepare-kernel config kernel) + (case kernel + ((libre) linux-libre) + ((nonlibre) linux) + (else (operating-system-kernel config)))) + +(define (prepare-initrd config kernel) + (case kernel + ((libre) base-initrd) + ((nonlibre) microcode-initrd) + (else (operating-system-initrd config)))) + +(define (prepare-firmwares config kernel) + (case kernel + ((libre) %base-firmware) + ((nonlibre) (list linux-firmware)) + (else (operating-system-firmware config)))) + +;; +;; OS config generation +;; + +(define (apply-px-substitute-server guix-config) + (let ((existing-urls (guix-configuration-substitute-urls guix-config)) + (existing-keys (guix-configuration-authorized-keys guix-config))) + (guix-configuration + (inherit guix-config) + (substitute-urls (append (list %px-substitute-server-url) + existing-urls)) + (authorized-keys (append (list %px-substitute-server-key) + existing-keys))))) + +(define* (make-os config #:key + (kernel 'libre) + (open-ports #f) + (authorized-keys '()) + (templates '()) + default-packages + default-services) + "Create <operating-system> definition based on provided templates and default +packages and services" + + (define (apply-firewall-rules config) + (nftables-configuration + (inherit config) + (ruleset (if open-ports + (make-firewall-rules open-ports) + (nftables-configuration-ruleset config))))) + (define (apply-authorized-keys config) + (if (> (length authorized-keys) 0) + (openssh-configuration + (inherit config) + (authorized-keys authorized-keys)) + config)) + (define (apply-swap-changes config) + (let ((devices (operating-system-swap-devices config))) + (if (eq? devices '()) + (list (swap-space (target "/swapfile"))) + devices))) + (let ((target-kernel (prepare-kernel config kernel)) + (target-initrd (prepare-initrd config kernel)) + (target-firmwares (prepare-firmwares config kernel)) + (target-bootloader (adjust-bootloader-theme config)) + (target-packages (prepare-packages config default-packages)) + (target-services (prepare-services config default-services))) + (apply-templates + (operating-system + (inherit config) + (bootloader target-bootloader) + (kernel target-kernel) + (initrd target-initrd) + (firmware target-firmwares) + (swap-devices (apply-swap-changes config)) + + (packages target-packages) + (services (fold (lambda (svc result) + (let ((type (service-kind svc)) + (value (service-value svc))) + (cond + ((eq? type guix-service-type) + (cons (service guix-service-type (apply-px-substitute-server value)) result)) + ((eq? type nftables-service-type) + (cons (service nftables-service-type (apply-firewall-rules value)) result)) + ((eq? type openssh-service-type) + (cons (service openssh-service-type (apply-authorized-keys value)) result)) + (else (cons svc result))))) + '() + target-services)) + (name-service-switch %mdns-host-lookup-nss)) + templates))) diff --git a/px/system/raspberry.scm b/px/system/raspberry.scm new file mode 100644 index 0000000..f63c69c --- /dev/null +++ b/px/system/raspberry.scm @@ -0,0 +1,255 @@ +(define-module (px system raspberry) + #:use-module (gnu bootloader) + #:use-module (gnu image) + #:use-module (gnu services) + #:use-module (gnu system) + #:use-module (gnu system file-systems) + #:use-module (gnu system image) + #:use-module (gnu system nss) + #:use-module (gnu system shadow) + #:use-module (guix gexp) + #:use-module (guix platforms arm) + #:use-module (nongnu packages linux) + #:use-module (px bootloader u-boot) + #:use-module (px system os) + #:use-module (px hardware raspberrypi) + #:use-module (px packages base) + #:use-module (px packages bootloaders) + #:use-module (px packages linux) + #:use-module (px services base) + #:use-module (px services device) + #:use-module (px system config) + #:use-module (srfi srfi-26) + #:export (%raspberrypi-config-params + %raspberrypi-cmdline-params + raspberrypi-gui-os + raspberrypi-gui-image + + %reterminal-config-params + %reterminal-cmdline-params + reterminal-image-type + + %reterminal-core-packages + %reterminal-core-services + reterminal-core-os + reterminal-core-image + + %reterminal-gui-packages + %reterminal-gui-services + reterminal-gui-os)) + + +(define %raspberrypi-config-params + (list "enable_uart=1" + "uart_2ndstage=1" + "arm_64bit=1" + "kernel=u-boot.bin")) + + +(define %raspberrypi-cmdline-params + (list "root=LABEL=RASPIROOT rw rootwait" + "console=serial0,115200 console=tty1 console=ttyAMA0,115200" + "selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N" + "dwc_otg.lpm_enable=0 kgdboc=serial0,115200")) + + +(define (make-raspberrypi-boot-partition config cmdline) + (partition + (size (* 128 (expt 2 20))) + (label "BOOT") + (file-system "fat32") + (flags '()) + (initializer + (gexp (lambda* (root #:key #:allow-other-keys) + (use-modules (guix build utils)) + (mkdir-p root) + (copy-recursively #$(file-append u-boot-rpi-arm64 "/libexec/u-boot.bin" ) + (string-append root "/u-boot.bin")) + (copy-recursively #$(file-append raspberrypi-firmware "/" ) root) + (copy-recursively #$(file-append seeed-reterminal-dtoverlays "/" ) + (string-append root "/overlays")) + (copy-recursively #$(plain-file "config.txt" + (string-join config "\n")) + (string-append root "/config.txt")) + (copy-recursively #$(plain-file "cmdline.txt" + (string-join cmdline " ")) + (string-append root "/cmdline.txt")) + ))))) + +(define %raspberrypi-boot-partition + (make-raspberrypi-boot-partition %raspberrypi-config-params + %raspberrypi-cmdline-params)) + + +(define %raspberrypi-root-partition + (partition + (size 'guess) + (label "RASPIROOT") + (file-system "ext4") + (flags '(boot)) + (initializer (gexp initialize-root-partition)))) + + +(define raspberrypi-image-type + (image-type + (name 'raspberrypi-raw) + (constructor (cut image-with-os + (image-without-os + (format 'disk-image) + (partitions (list %raspberrypi-boot-partition + %raspberrypi-root-partition))) + <>)))) + + +(define raspberrypi-gui-os + (operating-system + (inherit px-gui-arm-os) + + (bootloader (bootloader-configuration + (bootloader u-boot-rpi-arm64-bootloader) + (targets '("/dev/vda")) + (device-tree-support? #f))) + (kernel linux-raspberry-5.15) + (kernel-arguments (cons* "cgroup_enable=memory" + %default-kernel-arguments)) + (initrd-modules '()) + (firmware (list raspberrypi-firmware + brcm80211-firmware + bluez-firmware)) + (file-systems (cons* (file-system + (device (file-system-label "BOOT")) + (mount-point "/boot/firmware") + (type "vfat")) + (file-system + (device (file-system-label "RASPIROOT")) + (mount-point "/") + (type "ext4")) + %base-file-systems)) + (services (cons* (service btuart-service-type) + %px-gui-arm-services)))) + + +(define raspberrypi-gui-image + (image + (inherit + (os+platform->image raspberrypi-gui-os aarch64-linux + #:type raspberrypi-image-type)) + (partition-table-type 'mbr) + (name 'raspberrypi-gui-image))) + +;; +;; SEEED reTerminal core configurations +;; + +(define %reterminal-config-params + (cons* "dtoverlay=dwc2,dr_mode=host" + "dtparam=ant2" + "disable_splash=1" + "ignore_lcd=1" + "dtoverlay=vc4-kms-v3d-pi4" + "dtoverlay=i2c3,pins_4_5" + "gpio=13=pu" + "dtoverlay=reTerminal,tp_rotate=0" + "dtoverlay=reTerminal-bridge" + "dtoverlay=reTerminal,key0=0x043,key1=0x044,key2=0x057,key3=0x058" + "vt.global_cursor_default=0" + %raspberrypi-config-params)) + +(define %reterminal-cmdline-params + %raspberrypi-cmdline-params) + +(define %reterminal-boot-partition + (make-raspberrypi-boot-partition %reterminal-config-params + %reterminal-cmdline-params)) + + +(define reterminal-image-type + (image-type + (name 'reterminal-image-raw) + (constructor (cut image-with-os + (image-without-os + (format 'disk-image) + (partitions (list %reterminal-boot-partition + %raspberrypi-root-partition))) + <>)))) + +(define %reterminal-core-packages + %px-core-arm-packages) + + +(define %reterminal-core-services + %px-core-arm-services) + + +(define* (reterminal-core-os #:key (open-ports %px-server-open-ports-common) + (authorized-keys '())) + (make-os + (operating-system + (host-name "reterminal-core") + (timezone "Europe/Berlin") + (locale "en_US.utf8") + + (bootloader (bootloader-configuration + (bootloader u-boot-rpi-arm64-bootloader) + (targets '("/dev/vda")) + (device-tree-support? #f))) + (initrd-modules '()) + (kernel linux-raspberry-5.15) + (kernel-loadable-modules %reterminal-kernel-modules) + (kernel-arguments (cons* "cgroup_enable=memory" + %default-kernel-arguments)) + (file-systems (cons* (file-system + (device (file-system-label "BOOT")) + (mount-point "/boot/firmware") + (type "vfat")) + (file-system + (device (file-system-label "RASPIBOOT")) + (mount-point "/") + (type "ext4")) + %base-file-systems)) + (users (cons (user-account + (name "panther") + (comment "panther's account") + (group "users") + (password (crypt "pantherx" "$6$abc")) + (supplementary-groups '("wheel" + "audio" "video")) + (home-directory "/home/panther")) + %base-user-accounts)) + (name-service-switch %mdns-host-lookup-nss)) + #:kernel 'custom + #:open-ports open-ports + #:authorized-keys authorized-keys + #:templates (list %raspberry-pi-4-template + %seeed-reterminal-template) + #:default-packages %reterminal-core-packages + #:default-services %reterminal-core-services) + ) + +(define reterminal-core-image + (image + (inherit + (os+platform->image (reterminal-core-os) + aarch64-linux + #:type reterminal-image-type)) + (partition-table-type 'mbr) + (name 'reterminal-core-image))) + +;; +;; SEEED reTerminal GUI configuration +;; + + +(define %reterminal-gui-packages + (cons* seeed-reterminal-dtoverlays + %px-gui-arm-packages)) + +(define %reterminal-gui-services + %px-gui-arm-services) + +(define reterminal-gui-os + (operating-system + (inherit raspberrypi-gui-os) + (kernel-loadable-modules %reterminal-kernel-modules) + (packages %reterminal-gui-packages) + (services %reterminal-gui-services))) |