Created: June 7, 2020

Last modified: May 18, 2023

guix configuration

error-success-sticker.svg

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://git.sr.ht/~akyle/guix-emacs-latest")
       (branch "main")
       (commit
        "9f70c47793241aefb34c7c3215005ed5737fc5f6")
       (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 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 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)
 (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
    my-emacs-next-pgtk
    )))

 (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))))
   )
  )
 )

server config

;; Do not edit this file directly!
;; This file was generated by running ~org-babel-tangle~ on dotfiles.org
(use-modules (gnu))
(use-modules (guix packages))
(use-modules ((guix licenses) #:prefix license:))
(use-modules (guix build-system copy))
(use-service-modules linux networking ssh virtualization nfs)
(use-package-modules disk certs wget version-control rsync compression ssh
                     admin vim tmux python)

(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/")))

(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 nss-certs wget git rsync rrsync 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)))
     (service nfs-service-type
              (nfs-configuration
               (exports
                '(("/data"
                   "localhost(rw,insecure,no_subtree_check,crossmnt,fsid=0,all_squash,anonuid=1000,anongid=998)")))))
     (service qemu-binfmt-service-type
              (qemu-binfmt-configuration
               (platforms (lookup-qemu-platforms "aarch64"))))
     )
    (modify-services %base-services
      (guix-service-type config =>
                         (guix-configuration
                          (inherit config)
                          (extra-options '("--gc-keep-derivations=yes"
                                           "--gc-keep-outputs=yes")))))
    )))

on macos need to add to /etc/nfs.conf nfs.client.mount.options = vers=4

ssh -L 2049:localhost:2049 spot

Backlinks: