guix configuration
server config
(use-modules (gnu))
(use-modules (guix packages))
(use-service-modules linux networking ssh virtualization nfs vnc)
(use-package-modules disk certs wget version-control rsync compression ssh
admin vim tmux python)
(operating-system
(host-name "spot")
(timezone "America/Denver")
(locale "en_US.utf8")
(keyboard-layout (keyboard-layout "us" "dvorak"))
(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(targets '("/boot"))
(keyboard-layout keyboard-layout)))
(file-systems (append
(list (file-system
(device (file-system-label "boot"))
(mount-point "/boot")
(type "vfat"))
(file-system
(device (file-system-label "guixsd"))
(mount-point "/")
(type "ext4"))
(file-system
(device (file-system-label "data"))
(mount-point "/data")
(type "ext4"))
)
%base-file-systems))
(users (cons (user-account
(name "akyle")
(group "users")
(supplementary-groups '("wheel" "audio" "video")))
%base-user-accounts))
;; Globally-installed packages.
(packages (append (list parted wget git rsync unzip
openssh-sans-x vim htop tmux)
%base-packages))
(services
(append
(list
(service ntp-service-type)
(service dhcpcd-service-type)
(service openssh-service-type
(openssh-configuration
(openssh openssh-sans-x)
(port-number 15213)
(password-authentication? #f)
(use-pam? #f)))
(service nfs-service-type
(nfs-configuration
(exports
'(("/data"
"localhost(rw,insecure,no_subtree_check,crossmnt,fsid=0,all_squash,anonuid=1000,anongid=998)")))))
)
%base-services)))
on macos need to add to /etc/nfs.conf:
nfs.client.mount.options = vers=4
then
ssh -L 2049:localhost:2049 spot
and finally in finder cmd-K
#!/usr/bin/env bash
exec -a "${0##*/}" guix shell --pure --container --emulate-fhs --network --preserve="(TERM)|(LANG)" --share=/home/akyle/.julia -- /home/akyle/.julia/juliaup/julia-1.12.4+0.x64.linux.gnu/bin/julia "$@"
PATH=~/bin:$PATH
keep stuff
(modify-services %base-services
(guix-service-type config =>
(guix-configuration
(inherit config)
(extra-options '("--gc-keep-derivations=yes"
"--gc-keep-outputs=yes")))))
qemu-binfmt
(service qemu-binfmt-service-type
(qemu-binfmt-configuration
(platforms (lookup-qemu-platforms "aarch64"))))
rrsync
(use-modules ((guix licenses) #:prefix license:))
(use-modules (guix build-system copy))
(define-public rrsync
(package
(inherit rsync)
(name "rrsync")
(build-system copy-build-system)
(arguments
`(#:install-plan
'(("support/rrsync" "bin/rrsync")
("rrsync.1" "share/man/man1/"))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'fixup-paths
(lambda _
(substitute* "support/rrsync" (("/usr/bin/rsync") (which "rsync"))))))))
(propagated-inputs
(list rsync python))
(synopsis "A script to setup restricted rsync users via ssh logins")
(description "A script to setup restricted rsync users via ssh logins")
(license license:gpl3+)
(home-page "https://rsync.samba.org/")))
(packages (append (list parted wget git rsync rrsync unzip
openssh-sans-x vim htop tmux)
%base-packages))
vm config
rsync -azP guix-sys-config.scm spot:
guix build -s aarch64-linux -f guix-sys-config.scm
sudo guix publish -u akyle
ssh -L 8080:localhost:8080 spot
guix weather --substitute-urls='https://ci.guix.gnu.org https://bordeaux.guix.gnu.org http://localhost:8080' linux-libre
sudo guix system reconfigure --substitute-urls='https://ci.guix.gnu.org https://bordeaux.guix.gnu.org http://localhost:8080' .config/guix-sys-config.scm
sudo guix system -L git/guix-channel reconfigure --substitute-urls='https://ci.guix.gnu.org https://bordeaux.guix.gnu.org http://localhost:8080' .config/guix-sys-config.scm
sudo guix system reconfigure .config/guix-sys-config.scm
;; Do not edit this file directly!
;; This file was generated by running ~org-babel-tangle~ on dotfiles.org
(use-modules (gnu)
(guix packages)
(guix utils)
(gnu bootloader))
(use-service-modules linux networking ssh desktop dbus nfs)
(use-package-modules disk certs wget version-control rsync compression ssh
admin vim tmux virtualization bootloaders)
(operating-system
(host-name "data")
(timezone "America/Denver")
(locale "en_US.utf8")
(keyboard-layout (keyboard-layout "us" "dvorak"))
(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(targets '("/boot"))
(keyboard-layout keyboard-layout)))
(file-systems (append
(list (file-system
(device (file-system-label "boot"))
(mount-point "/boot")
(type "vfat"))
(file-system
(device (file-system-label "guixsd"))
(mount-point "/")
(type "ext4"))
(file-system
(device (file-system-label "home"))
(mount-point "/home")
(type "ext4")))
%base-file-systems))
(users (cons (user-account
(name "akyle")
(group "users")
(supplementary-groups '("wheel" "audio" "video")))
%base-user-accounts))
;; Globally-installed packages.
(packages (append (list parted nss-certs wget git rsync unzip openssh-sans-x
vim htop tmux)
%base-packages))
(services (append (list (service ntp-service-type)
(service dhcp-client-service-type)
(service openssh-service-type
(openssh-configuration
(openssh openssh-sans-x)
(port-number 15213)
(password-authentication? #f)
(use-pam? #f)))
)
(modify-services %base-services
(guix-service-type
config =>
(guix-configuration
(inherit config)
(extra-options '("--gc-keep-derivations=yes"
"--gc-keep-outputs=yes"))
)))
)))
channels
guix pull -C .config/guix-channels.scm
;; Do not edit this file directly!
;; This file was generated by running ~org-babel-tangle~ on dotfiles.org
(list (channel
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(branch "master")
(commit
"6e38ec447f98383e0722ac300734f8d7c8c5c7b0")
(introduction
(make-channel-introduction
"9edb3f66fd807b096b48283debdcddccfea34bad"
(openpgp-fingerprint
"BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"))))
(channel
(name 'emacs-latest)
(url "https://github.com/akirakyle/guix-emacs-latest")
(branch "main")
(commit
"db869e6e2c19774105c9a55e1be823b6383bdf59")
(introduction
(make-channel-introduction
"dd804da433e4e9ccd7408a356cd4f1bec942d28b"
(openpgp-fingerprint
"963C 2413 0BD3 BF1B 624C EF4C 8850 284C 20B8 078D")))))
system config
rsync -azP guix-sys-config.scm spot:
guix build -s aarch64-linux -f guix-sys-config.scm
sudo guix publish -u akyle
ssh -L 8080:localhost:8080 spot
guix weather --substitute-urls='https://ci.guix.gnu.org https://bordeaux.guix.gnu.org http://localhost:8080' linux-libre
sudo guix system reconfigure --substitute-urls='https://ci.guix.gnu.org https://bordeaux.guix.gnu.org http://localhost:8080' .config/guix-sys-config.scm
sudo guix system -L git/guix-channel reconfigure --substitute-urls='https://ci.guix.gnu.org https://bordeaux.guix.gnu.org http://localhost:8080' .config/guix-sys-config.scm
sudo guix system reconfigure .config/guix-sys-config.scm
;; Do not edit this file directly!
;; This file was generated by running ~org-babel-tangle~ on dotfiles.org
(use-modules (gnu)
(guix packages)
(guix utils)
(gnu bootloader))
(use-service-modules linux networking ssh desktop dbus nfs)
(use-package-modules disk certs wget version-control rsync compression ssh
admin vim tmux virtualization bootloaders)
;; https://github.com/elogind/elogind/search?q=chvt&type=code
(define my-polkit-chvt
(file-union
"my-polkit-chvt"
`(("share/polkit-1/rules.d/10-polkit-chvt.rules"
,(plain-file
"10-polkit-chvt.rules"
"polkit.addRule(function(action, subject) {
if (action.id == \"org.freedesktop.login1.chvt\") {
return polkit.Result.YES;
}
});
")))))
(define my-polkit-chvt-service
(simple-service 'my-polkit-chvt polkit-service-type (list my-polkit-chvt)))
(operating-system
(host-name "data")
(timezone "America/Denver")
(locale "en_US.utf8")
(keyboard-layout (keyboard-layout "us" "dvorak"))
(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(targets '("/boot"))
(keyboard-layout keyboard-layout)))
(file-systems (append
(list (file-system
(device (file-system-label "boot"))
(mount-point "/boot")
(type "vfat"))
(file-system
(device (file-system-label "guixsd"))
(mount-point "/")
(type "ext4"))
(file-system
(device (file-system-label "home"))
(mount-point "/home")
(type "ext4")))
%base-file-systems))
(users (cons (user-account
(name "akyle")
(group "users")
(supplementary-groups '("wheel" "audio" "video")))
%base-user-accounts))
;; Globally-installed packages.
(packages (append (list parted nss-certs wget git rsync unzip openssh-sans-x
vim htop tmux)
%base-packages))
(services (append (list (service ntp-service-type)
(service dhcp-client-service-type)
(service accountsservice-service-type)
(service elogind-service-type)
(service dbus-root-service-type)
(service polkit-service-type)
polkit-wheel-service
my-polkit-chvt-service
(service zram-device-service-type
(zram-device-configuration
(size "2G")))
(service openssh-service-type
(openssh-configuration
(openssh openssh-sans-x)
(port-number 15213)
(password-authentication? #f)
(use-pam? #f)))
(service nfs-service-type
(nfs-configuration
(exports
'(("/home/akyle"
"192.168.64.1(rw,insecure,no_subtree_check,crossmnt,fsid=0,all_squash,anonuid=1000,anongid=998)")))))
)
(modify-services %base-services
(guix-service-type
config =>
(guix-configuration
(inherit config)
(extra-options '("--gc-keep-derivations=yes"
"--gc-keep-outputs=yes"))
)))
)))
home config
guix home -L git/guix-channel reconfigure .config/guix-home-config.scm
;; Do not edit this file directly!
;; This file was generated by running ~org-babel-tangle~ on dotfiles.org
(use-modules
(gnu)
(gnu home)
(gnu home services shells)
(gnu home services guix)
(gnu home services mcron)
(gnu packages)
(gnu services)
(guix channels)
(emacs-latest emacs)
(akira emacs-xyz)
(akira tex)
)
(use-package-modules emacs wm glib fontutils fonts inkscape pdf admin
mail code gnome gnupg linux password-utils aspell
shellutils rust-apps virtualization xdisorg)
(define %my-rsync-command "
rsync -azv --del \
--exclude=.cache \
--exclude=.mozilla \
--exclude=.julia \
--exclude=.emacs.d/eln-cache \
--exclude amac \
/home/akyle spot-backup:")
(define rsync-daily-backup
#~(job '(next-day) (string-append #$%my-rsync-command "daily")))
(define rsync-weekly-backup
#~(job '(next-day '(1 8 15 22 29)) (string-append #$%my-rsync-command "weekly")))
(define rsync-monthly-backup
#~(job '(next-month) (string-append #$%my-rsync-command "monthly")))
(home-environment
(packages
(append
%all-my-latex-packages
%all-my-emacs-packages
(list
gnupg ; could work together better using
pinentry-gnome3 ; https://git.sr.ht/~abcdw/rde/tree/master/item/gnu/home-services/gnupg.scm
gcr ; needed for pinentry-gnome3
isync
the-silver-searcher
ripgrep
;sshfs
netcat-openbsd
password-store
aspell ; would like to add en-computers and en-science?
aspell-dict-en
;direnv
dbus
fontconfig
font-dejavu
sway ; needs updating to 1.7
adwaita-icon-theme
inkscape/stable
poppler
;;virt-manager
emacs-next-pgtk-latest
)))
(services
(list
(simple-service 'emacs-latest-packages-service
home-channels-service-type
(list
(channel
(name 'emacs-latest)
(url "https://git.sr.ht/~akyle/guix-emacs-latest")
(introduction
(make-channel-introduction
"dd804da433e4e9ccd7408a356cd4f1bec942d28b"
(openpgp-fingerprint
"963C 2413 0BD3 BF1B 624C EF4C 8850 284C 20B8 078D"))))))
(service home-bash-service-type
(home-bash-configuration
(bashrc (list (plain-file
;eval \"$(direnv hook bash)\"
"bashrc" "
# If running from tty1 start sway
if [ \"$(tty)\" = \"/dev/tty1\" ]; then
export EDITOR=emacsclient
export WLR_NO_HARDWARE_CURSORS=1
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
dbus-run-session sway > ~/.sway.log 2>&1
fi
")))))
; use exec dbus-run-session sway > ~/.sway.log 2>&1 to leave tty after exit
(service home-mcron-service-type
(home-mcron-configuration
(jobs (list
rsync-daily-backup
rsync-weekly-backup
rsync-monthly-backup))))
)
)
)
show-dependencies.scm
#!/usr/bin/env -S guile -s
!#
(use-modules (guix packages)
((gnu packages) #:select (specification->package
specification->package+output))
((srfi srfi-1) #:select (delete-duplicates))
((srfi srfi-11) #:select (let-values))
((ice-9 match) #:select (match))
((ice-9 format) #:select (format)))
(define (package->specification package)
(format #f "~a@~a:~a"
(package-name package)
(package-version package)
(not (eq? #f (supported-package? package "aarch64-linux")))
))
(define (input->specification input)
(match input
((label (? package? package) . _)
(package->specification package))
((label (? origin? origin))
(format #f "[source code from ~a]"
(origin-uri origin)))
(other-input
(format #f "~a" other-input))))
(define (unique-inputs inputs)
(delete-duplicates
(map input->specification inputs)))
(define (main args)
(define packages
(map specification->package args))
(define inputs
(sort
(delete-duplicates
(apply append
(map (lambda (package)
(unique-inputs
(package-direct-inputs package)))
packages)))
string<))
(define build-inputs
(sort
(delete-duplicates
(apply append
(map (lambda (package)
(unique-inputs
(bag-direct-inputs
(package->bag package))))
packages)))
string<))
(define closure
(sort
(delete-duplicates
(map package->specification
(package-closure packages)))
string<))
(format #t "Packages: ~d\n ~{ ~a~}\n"
(length packages)
(sort
(map package->specification packages)
string<))
(format #t "Package inputs: ~d packages\n ~{ ~a~}\n"
(length inputs)
inputs)
(format #t "Build inputs: ~d packages\n ~{ ~a~}\n"
(length build-inputs)
build-inputs)
(format #t "Package closure: ~d packages\n ~{ ~a~}\n"
(length closure)
closure))
(main (cdr (command-line)))
python config
jupyter manifest
(list (channel
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(branch "master")
(commit
"754ce586e013582b0f6d28337fdc46db35395997")
(introduction
(make-channel-introduction
"9edb3f66fd807b096b48283debdcddccfea34bad"
(openpgp-fingerprint
"BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA")))))
(use-modules
(gnu packages)
(guix packages)
(guix download)
((guix licenses) #:prefix license:)
(guix build-system python)
(guix build-system pyproject)
)
(use-package-modules python-xyz python-science python-build cmake check)
;; guix time-machine -C guix-channels.scm -- shell -m guix-manifest.scm -r .guix-profile --search-paths
;; guix shell -m guix-manifest.scm -r .guix-profile --search-paths
(define python-qutip
(package
(name "python-qutip")
(version "4.7.1")
;(version "5.0.0a1")
(source (origin
(method url-fetch)
(uri (pypi-uri "qutip" version))
(sha256
(base32
"1wiscs9viy8ppm2ysp1j26hh116c7jaalv2jbcac4idid271g1ws"))))
;"05yd7gsw29wf89gy6k19x1b0xdib0nnl3vlmp6fzmw8pvill8dqx"))))
(build-system python-build-system)
(arguments
`(#:tests? #f))
;`(#:phases
; (modify-phases %standard-phases
; (add-before 'check 'build-ext
; (lambda _
; (invoke "python" "setup.py" "build_ext" "--inplace")))
; (replace 'check
; (lambda* (#:key tests? #:allow-other-keys)
; (when tests?
; (invoke "pytest")))))))
(propagated-inputs (list python-numpy python-packaging python-scipy))
(native-inputs (list python-pytest python-cython
))
(home-page "https://qutip.org")
(synopsis "QuTiP: The Quantum Toolbox in Python")
(description "QuTiP: The Quantum Toolbox in Python")
(license #f)))
(define python-cvxpy
(package
(name "python-cvxpy")
(version "1.3.1")
(source (origin
(method url-fetch)
(uri (pypi-uri "cvxpy" version))
(sha256
(base32
"1jx3s3h7145a0y0sgcwrrrx29qh1xwiadzf4aj2mlxbscy9zwyzh"))))
(build-system pyproject-build-system)
(arguments
`(#:tests? #f))
(propagated-inputs (list python-ecos
python-numpy
python-osqp
python-scipy
python-scs
python-setuptools))
(home-page "https://github.com/cvxpy/cvxpy")
(synopsis
"A domain-specific language for modeling convex optimization problems in Python.")
(description
"This package provides a domain-specific language for modeling convex
optimization problems in Python.")
(license #f)))
(define python-ecos
(package
(name "python-ecos")
(version "2.0.12")
(source (origin
(method url-fetch)
(uri (pypi-uri "ecos" version))
(sha256
(base32
"0kkw6db428im421y701w808p6623hxy7nlzaarak5bl77gbid27l"))))
(build-system pyproject-build-system)
(arguments
`(#:tests? #f))
(propagated-inputs (list python-numpy python-scipy))
(home-page "http://github.com/embotech/ecos")
(synopsis
"This is the Python package for ECOS: Embedded Cone Solver. See Github page for more information.")
(description
"This is the Python package for ECOS: Embedded Cone Solver. See Github page for
more information.")
(license #f)))
(define python-osqp
(package
(name "python-osqp")
(version "0.6.2")
(source (origin
(method url-fetch)
(uri (pypi-uri "osqp" version))
(sha256
(base32
"1cz4pwpz8flykcfygggdcl5j9s7sijql31b5xvzwkmkakw1n4896"))))
(build-system pyproject-build-system)
(arguments
`(#:tests? #f))
(propagated-inputs (list python-numpy python-qdldl python-scipy))
(native-inputs (list cmake))
(home-page "https://osqp.org/")
(synopsis "OSQP: The Operator Splitting QP Solver")
(description "OSQP: The Operator Splitting QP Solver")
(license license:asl2.0)))
(define python-scs
(package
(name "python-scs")
(version "3.2.3")
(source (origin
(method url-fetch)
(uri (pypi-uri "scs" version))
(sha256
(base32
"1cxlpp2fv4k5blnp56nmha8f42d3qaj5l0zjlbjklzlpgsg7ggg3"))))
(build-system pyproject-build-system)
(propagated-inputs (list python-numpy python-scipy))
(home-page "http://github.com/cvxgrp/scs")
(synopsis "scs: splitting conic solver")
(description "scs: splitting conic solver")
(license license:expat)))
(define python-qdldl
(package
(name "python-qdldl")
(version "0.1.7")
(source (origin
(method url-fetch)
(uri (pypi-uri "qdldl" version))
(sha256
(base32
"03pis1czh52v1zbfdl4nrrf6fvr8k8j8bs6cya5ff0g326fn71kc"))))
(build-system pyproject-build-system)
(propagated-inputs (list python-numpy python-scipy))
(native-inputs (list pybind11 cmake))
(home-page "https://github.com/oxfordcontrol/qdldl-python/")
(synopsis "QDLDL, a free LDL factorization routine.")
(description "QDLDL, a free LDL factorization routine.")
(license license:asl2.0)))
(packages->manifest
(list
;python-jupyter-console
;python-pygments
python-notebook
python-matplotlib
python-numpy
python-scipy
python-sympy
python-qutip
python-cvxpy
))
guix-schannels.scm
(list (channel
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(branch "master")
(commit
"754ce586e013582b0f6d28337fdc46db35395997")
(introduction
(make-channel-introduction
"9edb3f66fd807b096b48283debdcddccfea34bad"
(openpgp-fingerprint
"BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA")))))
guix-manifest.scm
(use-modules
(gnu packages)
(guix packages)
)
(use-package-modules julia python-xyz python-science)
;(use-modules (guix transformations))
;; guix time-machine -C guix-channels.scm -- shell -m guix-manifest.scm -r .guix-profile --search-paths
;; guix weather -m guix-manifest.scm
;; ~/git/guix/pre-inst-env guix shell -m guix-manifest.scm -r .guix-profile --search-paths
;; I'll want to add IJulia: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36856
(packages->manifest
(list
python-jupyter-console
python-matplotlib
python-numpy
python-pygments
python-scipy
;((options->transformation
; '((without-tests . "python-scipy"))) python-scipy)
python-sympy
;julia
))
pine64 rkdeveloptool
(use-modules
(gnu packages)
(guix packages)
(guix git-download)
(guix build-system meson)
((guix licenses) #:prefix license:)
)
(use-package-modules libusb pkg-config linux man)
(define-public rkdeveloptool
(let ((commit "cce7d2a5c4efd4e7727c440868141229354b327b")
(revision "0"))
(package
(name "rkdeveloptool")
(version (git-version "1.3" revision commit))
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool.git")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32 "0nh9592mllygycnxbw91vg58wwais7w3w62rl9gcvc4m3i909b1z"))
))
(build-system meson-build-system)
(native-inputs
(list scdoc pkg-config))
(inputs
(list libusb eudev))
(home-page "https://github.com/rockchip-linux/rkdeveloptool")
(synopsis "Read from and write to RockChicp devices over USB")
(description
"Rkdeveloptool can read from and write to RockChip devices over USB, such
as the Pinebook Pro.")
(license license:gpl2+))))
(packages->manifest
(list
rkdeveloptool
))