diff options
author | Marek Paśnikowski <marek@marekpasnikowski.pl> | 2024-07-27 11:10:24 +0200 |
---|---|---|
committer | Marek Paśnikowski <marek@marekpasnikowski.pl> | 2024-07-27 12:45:27 +0200 |
commit | 68f1aef5a6568975646913e13b678e793a48368b (patch) | |
tree | cfe90c21d29a43108a90452734f7dc11f028ae36 /suweren | |
parent | 9ffb4a5bd1d1d59cc7dc28b92f93bfeab29ddbb7 (diff) |
refactor!(update-commands): generalize the home update code
Diffstat (limited to 'suweren')
-rw-r--r-- | suweren/home.scm | 9 | ||||
-rw-r--r-- | suweren/update.scm | 16 |
2 files changed, 19 insertions, 6 deletions
diff --git a/suweren/home.scm b/suweren/home.scm index c441b6f..289ac9a 100644 --- a/suweren/home.scm +++ b/suweren/home.scm @@ -34,7 +34,9 @@ ;; update-commands #:use-module (suweren update)) -(define-public %suweren-home-services +;; string -> +;; (record service) +(define-public (%suweren-home-services system user) (let* ((packages (list gnupg librewolf)) @@ -45,7 +47,8 @@ (profile (simple-service 'default-home-packages home-profile-service-type packages)) - (shepherd (service home-shepherd-service-type))) + (shepherd (service home-shepherd-service-type)) + (update-commands* (update-commands system user))) (list bash dbus pipewire @@ -53,4 +56,4 @@ shepherd suweren-home-fontconfig-service-type suweren-home-xdg-configuration-files-extension - update-commands))) + update-commands*))) diff --git a/suweren/update.scm b/suweren/update.scm index 7c1ec35..2826b00 100644 --- a/suweren/update.scm +++ b/suweren/update.scm @@ -2,17 +2,27 @@ #:use-module (gnu home services shells) #:use-module (gnu services)) -(define-public update-commands +(define-public (update-commands system user) (let* ((allow-downgrades "--allow-downgrades ") (and "&& ") (collect-garbage "sudo guix gc -d 7d ") (pull-guix "guix pull ") (reconfigure-home (string-append "guix home delete-generations 7d ; " "guix home reconfigure -e " - "'(@ (users $USER) home)' ")) + "'((@ (users " + user + ") " + user + "-home-environment) \"" + system + "\")' ")) (reconfigure-system (string-append "sudo guix system delete-generations 7d ; " "sudo guix system reconfigure -e " - "'(@ (systems $HOSTNAME system-configuration) $HOSTNAME)' ")) + "'(@ (systems " + system + " system-configuration) " + system + ")' ")) (reupdate-system (string-append pull-guix allow-downgrades |