diff options
author | Marek Paśnikowski <marek@marekpasnikowski.pl> | 2024-10-07 13:55:02 +0200 |
---|---|---|
committer | Marek Paśnikowski <marek@marekpasnikowski.pl> | 2024-10-07 13:59:30 +0200 |
commit | c03f427f084aa07cfcb557b5aeac3c7f381e309b (patch) | |
tree | 342f9ab313bf05cebaa550f3997630f248e6cd94 /systems/izumi | |
parent | 8caa937d3ff325b85694b4887d6c15fd0d0ecde5 (diff) |
refactor(izumi): reimplement home configuration as a system service
Diffstat (limited to 'systems/izumi')
-rw-r--r-- | systems/izumi/home-configuration.scm | 186 | ||||
-rw-r--r-- | systems/izumi/izumi.org | 379 | ||||
-rw-r--r-- | systems/izumi/system-configuration.scm | 188 |
3 files changed, 374 insertions, 379 deletions
diff --git a/systems/izumi/home-configuration.scm b/systems/izumi/home-configuration.scm deleted file mode 100644 index 5d3e8aa..0000000 --- a/systems/izumi/home-configuration.scm +++ /dev/null @@ -1,186 +0,0 @@ -(define-module (systems izumi home-configuration)) - -(use-modules (channels) - (gnu) - (gnu home) - (gnu home services) - (gnu home services shells) - (gnu packages emacs-xyz)) - -(use-modules - (gnu) - (gnu home services) - (guix build-system emacs) - (guix git-download) - ((guix licenses) - #:prefix license:) - (guix packages)) - -(use-package-modules base emacs-xyz gawk) - -(use-modules - (gnu services) - (gnu home services) - (gnu packages password-utils) - (guix gexp)) - -(use-modules - (gnu home services shells) - (gnu services)) - -(home-environment (packages (map specification->package+output - (list "dconf-editor" - "emacs" - "emacs-org-modern" - "emacs-paredit" - "font-google-noto" - "font-google-noto-emoji" - "font-google-noto-sans-cjk" - "font-google-noto-serif-cjk" - "git" - "gnupg" - "gnome-tweaks" - "noweb" - "pinentry" - "pwgen" - "unzip" - "zip"))) - (services (append (list izumi-channels-service-type) - (list - (simple-service - 'emacs-home-profile - home-profile-service-type - (append - (list emacs-guix emacs-nix-mode) - (list - (let - ((commit* "wip-algo-tn")) - (package - (name "emacs-org-fc") - (version (git-version "0.1.2" "0" commit*)) - (source - (origin - (method git-fetch) - (uri - (git-reference - (url "https://git.marekpasnikowski.pl/org-fc.git") - (commit commit*))) - (file-name (git-file-name name version)) - (sha256 (base32 "1i8ii1garx2pdg08a12yzsd0fhwdzcpxp9m97zj8m5s275i8ccaj")))) - (build-system emacs-build-system) - (arguments - (list - #:include #~ (cons* "\\.awk$" "\\.org$" %default-include) - #:exclude #~ (cons "^test/" %default-exclude) - #:tests? #t - #:test-command - #~ - (list - "emacs" - "--batch" - "-L" "." - "-L" "tests/" - "-l" "tests/org-fc-filter-test.el" - "-l" "tests/org-fc-indexer-test.el" - "-l" "tests/org-fc-review-data-test.el" - "-f" "ert-run-tests-batch-and-exit") - #:phases - #~ - (modify-phases - %standard-phases - (add-after - 'unpack - 'qualify-paths - (lambda* - (#:key inputs - #:allow-other-keys) - (substitute* - "org-fc-awk.el" - (("\"find ") - (string-append - "\"" - (search-input-file inputs "/bin/find") - " ")) - (("\"gawk ") - (string-append - "\"" - (search-input-file inputs "/bin/gawk") - " ")) - (("\"xargs ") - (string-append - "\"" - (search-input-file inputs "/bin/xargs") - " ")))))))) - (inputs (list findutils gawk)) - (propagated-inputs (list emacs-hydra)) - (home-page "https://www.leonrische.me/fc/index.html") - (synopsis "Spaced repetition system for Emacs Org mode") - (description - (string-append - "Org-fc is a spaced-repetition system for Emacs' Org mode.\n" - "It allows you to mark headlines in a file as flashcards, turning pieces of\n" - "knowledge you want to learn into a question-answer test. These cards are\n" - "reviewed at regular interval. After each review, the next review interval is\n" - "calculated based on how well you remembered the contents of the card.\n")) - (license license:gpl3+)))))) - (simple-service 'home-files - home-files-service-type - (list (list ".config/emacs/init.el" - (local-file "home-files/emacs-configuration.el" )) - (list ".gnus" - (local-file "home-files/gnus-configuration.el")) - (list ".gitconfig" - (local-file "home-files/gitconfig")) - (list ".config/git/ignore" - ;; https://github.com/github/gitignore/blob/main/Global/Emacs.gitignore - (local-file "home-files/git-ignore.conf")))) - (simple-service - 'environment-variables - home-environment-variables-service-type - `(("EDITOR" . "emacsclient -nw")))) - (list - (let* - ((and "&& ") - (collect-garbage "sudo guix gc -d 7d ") - (configuration-prefix - "/home/marek/Publiczny/src/deployment/systems/izumi/") - (pull-guix "guix pull ") - (reconfigure-home - (string-append - "guix home delete-generations 7d ; " - "guix home reconfigure " - configuration-prefix - "home-configuration.scm ")) - (reconfigure-system - (string-append - "sudo guix system delete-generations 7d ; " - "sudo guix system reconfigure " - configuration-prefix - "system-configuration.scm ")) - (update-system - (string-append - pull-guix - and - reconfigure-system - and - reconfigure-home - and - collect-garbage))) - (simple-service - 'bash-extension - home-bash-service-type - (home-bash-extension - (aliases - `(("collect-garbage" . ,collect-garbage) - ("edit" . "$EDITOR") - ("pull-guix" . ,pull-guix) - ("reconfigure-home" . ,reconfigure-home) - ("reconfigure-system" . ,reconfigure-system) - ("update-system" . ,update-system))) - (bash-profile - (list - (mixed-text-file - "newline-prompt" - "PS1=${PS1%?}\n" - "PS1=${PS1%?}\\n'$ '\n" - "PS1=\"\\n$PS1\"")))))))))) diff --git a/systems/izumi/izumi.org b/systems/izumi/izumi.org index 1246c31..97a56d5 100644 --- a/systems/izumi/izumi.org +++ b/systems/izumi/izumi.org @@ -30,6 +30,35 @@ ( use-service-modules base certbot cgit desktop mail shepherd ssh version-control web xorg ) + (use-modules (channels) + (gnu) + (gnu home) + (gnu home services) + (gnu home services shells) + (gnu packages emacs-xyz)) + + (use-modules + (gnu) + (gnu home services) + (guix build-system emacs) + (guix git-download) + ((guix licenses) + #:prefix license:) + (guix packages)) + + (use-package-modules base emacs-xyz gawk) + + (use-modules + (gnu services) + (gnu home services) + (gnu packages password-utils) + (guix gexp)) + + (use-modules + (gnu home services shells) + (gnu services) + (gnu services guix)) + (define nginx-accounts (list (user-group (name "nginx") (system? #t)) @@ -276,7 +305,164 @@ 'etc-files etc-service-type ( list - `( "mailname" ,( plain-file "mailname" "marekpasnikowski.pl\n" ) ) ) ) ) ) ) + `( "mailname" ,( plain-file "mailname" "marekpasnikowski.pl\n" ) ) ) ) + (service guix-home-service-type + `(("marek" ,(home-environment (packages (map specification->package+output + (list "dconf-editor" + "emacs" + "emacs-org-modern" + "emacs-paredit" + "font-google-noto" + "font-google-noto-emoji" + "font-google-noto-sans-cjk" + "font-google-noto-serif-cjk" + "git" + "gnupg" + "gnome-tweaks" + "noweb" + "pinentry" + "pwgen" + "unzip" + "zip"))) + (services (append (list izumi-channels-service-type) + (list + (simple-service + 'emacs-home-profile + home-profile-service-type + (append + (list emacs-guix emacs-nix-mode) + (list + (let + ((commit* "wip-algo-tn")) + (package + (name "emacs-org-fc") + (version (git-version "0.1.2" "0" commit*)) + (source + (origin + (method git-fetch) + (uri + (git-reference + (url "https://git.marekpasnikowski.pl/org-fc.git") + (commit commit*))) + (file-name (git-file-name name version)) + (sha256 (base32 "1i8ii1garx2pdg08a12yzsd0fhwdzcpxp9m97zj8m5s275i8ccaj")))) + (build-system emacs-build-system) + (arguments + (list + #:include #~ (cons* "\\.awk$" "\\.org$" %default-include) + #:exclude #~ (cons "^test/" %default-exclude) + #:tests? #t + #:test-command + #~ + (list + "emacs" + "--batch" + "-L" "." + "-L" "tests/" + "-l" "tests/org-fc-filter-test.el" + "-l" "tests/org-fc-indexer-test.el" + "-l" "tests/org-fc-review-data-test.el" + "-f" "ert-run-tests-batch-and-exit") + #:phases + #~ + (modify-phases + %standard-phases + (add-after + 'unpack + 'qualify-paths + (lambda* + (#:key inputs + #:allow-other-keys) + (substitute* + "org-fc-awk.el" + (("\"find ") + (string-append + "\"" + (search-input-file inputs "/bin/find") + " ")) + (("\"gawk ") + (string-append + "\"" + (search-input-file inputs "/bin/gawk") + " ")) + (("\"xargs ") + (string-append + "\"" + (search-input-file inputs "/bin/xargs") + " ")))))))) + (inputs (list findutils gawk)) + (propagated-inputs (list emacs-hydra)) + (home-page "https://www.leonrische.me/fc/index.html") + (synopsis "Spaced repetition system for Emacs Org mode") + (description + (string-append + "Org-fc is a spaced-repetition system for Emacs' Org mode.\n" + "It allows you to mark headlines in a file as flashcards, turning pieces of\n" + "knowledge you want to learn into a question-answer test. These cards are\n" + "reviewed at regular interval. After each review, the next review interval is\n" + "calculated based on how well you remembered the contents of the card.\n")) + (license license:gpl3+)))))) + (simple-service 'home-files + home-files-service-type + (list (list ".config/emacs/init.el" + (local-file "home-files/emacs-configuration.el" )) + (list ".gnus" + (local-file "home-files/gnus-configuration.el")) + (list ".gitconfig" + (local-file "home-files/gitconfig")) + (list ".config/git/ignore" + ;; https://github.com/github/gitignore/blob/main/Global/Emacs.gitignore + (local-file "home-files/git-ignore.conf")))) + (simple-service + 'environment-variables + home-environment-variables-service-type + `(("EDITOR" . "emacsclient -nw")))) + (list + (let* + ((and "&& ") + (collect-garbage "sudo guix gc -d 7d ") + (configuration-prefix + "/home/marek/Publiczny/src/deployment/systems/izumi/") + (pull-guix "guix pull ") + (reconfigure-home + (string-append + "guix home delete-generations 7d ; " + "guix home reconfigure " + configuration-prefix + "home-configuration.scm ")) + (reconfigure-system + (string-append + "sudo guix system delete-generations 7d ; " + "sudo guix system reconfigure " + configuration-prefix + "system-configuration.scm ")) + (update-system + (string-append + pull-guix + and + reconfigure-system + ;; and + ;; reconfigure-home + and + collect-garbage))) + (simple-service + 'bash-extension + home-bash-service-type + (home-bash-extension + (aliases + `(("collect-garbage" . ,collect-garbage) + ("edit" . "$EDITOR") + ("pull-guix" . ,pull-guix) + ("reconfigure-home" . ,reconfigure-home) + ("reconfigure-system" . ,reconfigure-system) + ("update-system" . ,update-system))) + (bash-profile + (list + (mixed-text-file + "newline-prompt" + "PS1=${PS1%?}\n" + "PS1=${PS1%?}\\n'$ '\n" + "PS1=\"\\n$PS1\"")))))))))))))))) ( sudoers-file %sudoers-specification* ) ( swap-devices ( list @@ -316,194 +502,3 @@ match for any action send #+END_SRC -* [[https://guix.gnu.org/manual/en/html_node/Home-Configuration.html][13 Home Configuration]] - -#+BEGIN_SRC scheme :tangle home-configuration.scm - (define-module (systems izumi home-configuration)) - - (use-modules (channels) - (gnu) - (gnu home) - (gnu home services) - (gnu home services shells) - (gnu packages emacs-xyz)) - - (use-modules - (gnu) - (gnu home services) - (guix build-system emacs) - (guix git-download) - ((guix licenses) - #:prefix license:) - (guix packages)) - - (use-package-modules base emacs-xyz gawk) - - (use-modules - (gnu services) - (gnu home services) - (gnu packages password-utils) - (guix gexp)) - - (use-modules - (gnu home services shells) - (gnu services)) - - (home-environment (packages (map specification->package+output - (list "dconf-editor" - "emacs" - "emacs-org-modern" - "emacs-paredit" - "font-google-noto" - "font-google-noto-emoji" - "font-google-noto-sans-cjk" - "font-google-noto-serif-cjk" - "git" - "gnupg" - "gnome-tweaks" - "noweb" - "pinentry" - "pwgen" - "unzip" - "zip"))) - (services (append (list izumi-channels-service-type) - (list - (simple-service - 'emacs-home-profile - home-profile-service-type - (append - (list emacs-guix emacs-nix-mode) - (list - (let - ((commit* "wip-algo-tn")) - (package - (name "emacs-org-fc") - (version (git-version "0.1.2" "0" commit*)) - (source - (origin - (method git-fetch) - (uri - (git-reference - (url "https://git.marekpasnikowski.pl/org-fc.git") - (commit commit*))) - (file-name (git-file-name name version)) - (sha256 (base32 "1i8ii1garx2pdg08a12yzsd0fhwdzcpxp9m97zj8m5s275i8ccaj")))) - (build-system emacs-build-system) - (arguments - (list - #:include #~ (cons* "\\.awk$" "\\.org$" %default-include) - #:exclude #~ (cons "^test/" %default-exclude) - #:tests? #t - #:test-command - #~ - (list - "emacs" - "--batch" - "-L" "." - "-L" "tests/" - "-l" "tests/org-fc-filter-test.el" - "-l" "tests/org-fc-indexer-test.el" - "-l" "tests/org-fc-review-data-test.el" - "-f" "ert-run-tests-batch-and-exit") - #:phases - #~ - (modify-phases - %standard-phases - (add-after - 'unpack - 'qualify-paths - (lambda* - (#:key inputs - #:allow-other-keys) - (substitute* - "org-fc-awk.el" - (("\"find ") - (string-append - "\"" - (search-input-file inputs "/bin/find") - " ")) - (("\"gawk ") - (string-append - "\"" - (search-input-file inputs "/bin/gawk") - " ")) - (("\"xargs ") - (string-append - "\"" - (search-input-file inputs "/bin/xargs") - " ")))))))) - (inputs (list findutils gawk)) - (propagated-inputs (list emacs-hydra)) - (home-page "https://www.leonrische.me/fc/index.html") - (synopsis "Spaced repetition system for Emacs Org mode") - (description - (string-append - "Org-fc is a spaced-repetition system for Emacs' Org mode.\n" - "It allows you to mark headlines in a file as flashcards, turning pieces of\n" - "knowledge you want to learn into a question-answer test. These cards are\n" - "reviewed at regular interval. After each review, the next review interval is\n" - "calculated based on how well you remembered the contents of the card.\n")) - (license license:gpl3+)))))) - (simple-service 'home-files - home-files-service-type - (list (list ".config/emacs/init.el" - (local-file "home-files/emacs-configuration.el" )) - (list ".gnus" - (local-file "home-files/gnus-configuration.el")) - (list ".gitconfig" - (local-file "home-files/gitconfig")) - (list ".config/git/ignore" - ;; https://github.com/github/gitignore/blob/main/Global/Emacs.gitignore - (local-file "home-files/git-ignore.conf")))) - (simple-service - 'environment-variables - home-environment-variables-service-type - `(("EDITOR" . "emacsclient -nw")))) - (list - (let* - ((and "&& ") - (collect-garbage "sudo guix gc -d 7d ") - (configuration-prefix - "/home/marek/Publiczny/src/deployment/systems/izumi/") - (pull-guix "guix pull ") - (reconfigure-home - (string-append - "guix home delete-generations 7d ; " - "guix home reconfigure " - configuration-prefix - "home-configuration.scm ")) - (reconfigure-system - (string-append - "sudo guix system delete-generations 7d ; " - "sudo guix system reconfigure " - configuration-prefix - "system-configuration.scm ")) - (update-system - (string-append - pull-guix - and - reconfigure-system - and - reconfigure-home - and - collect-garbage))) - (simple-service - 'bash-extension - home-bash-service-type - (home-bash-extension - (aliases - `(("collect-garbage" . ,collect-garbage) - ("edit" . "$EDITOR") - ("pull-guix" . ,pull-guix) - ("reconfigure-home" . ,reconfigure-home) - ("reconfigure-system" . ,reconfigure-system) - ("update-system" . ,update-system))) - (bash-profile - (list - (mixed-text-file - "newline-prompt" - "PS1=${PS1%?}\n" - "PS1=${PS1%?}\\n'$ '\n" - "PS1=\"\\n$PS1\"")))))))))) -#+END_SRC - diff --git a/systems/izumi/system-configuration.scm b/systems/izumi/system-configuration.scm index 577a6f0..502ec90 100644 --- a/systems/izumi/system-configuration.scm +++ b/systems/izumi/system-configuration.scm @@ -20,6 +20,35 @@ ( use-service-modules base certbot cgit desktop mail shepherd ssh version-control web xorg ) +(use-modules (channels) + (gnu) + (gnu home) + (gnu home services) + (gnu home services shells) + (gnu packages emacs-xyz)) + +(use-modules + (gnu) + (gnu home services) + (guix build-system emacs) + (guix git-download) + ((guix licenses) + #:prefix license:) + (guix packages)) + +(use-package-modules base emacs-xyz gawk) + +(use-modules + (gnu services) + (gnu home services) + (gnu packages password-utils) + (guix gexp)) + +(use-modules + (gnu home services shells) + (gnu services) + (gnu services guix)) + (define nginx-accounts (list (user-group (name "nginx") (system? #t)) @@ -266,7 +295,164 @@ 'etc-files etc-service-type ( list - `( "mailname" ,( plain-file "mailname" "marekpasnikowski.pl\n" ) ) ) ) ) ) ) + `( "mailname" ,( plain-file "mailname" "marekpasnikowski.pl\n" ) ) ) ) + (service guix-home-service-type + `(("marek" ,(home-environment (packages (map specification->package+output + (list "dconf-editor" + "emacs" + "emacs-org-modern" + "emacs-paredit" + "font-google-noto" + "font-google-noto-emoji" + "font-google-noto-sans-cjk" + "font-google-noto-serif-cjk" + "git" + "gnupg" + "gnome-tweaks" + "noweb" + "pinentry" + "pwgen" + "unzip" + "zip"))) + (services (append (list izumi-channels-service-type) + (list + (simple-service + 'emacs-home-profile + home-profile-service-type + (append + (list emacs-guix emacs-nix-mode) + (list + (let + ((commit* "wip-algo-tn")) + (package + (name "emacs-org-fc") + (version (git-version "0.1.2" "0" commit*)) + (source + (origin + (method git-fetch) + (uri + (git-reference + (url "https://git.marekpasnikowski.pl/org-fc.git") + (commit commit*))) + (file-name (git-file-name name version)) + (sha256 (base32 "1i8ii1garx2pdg08a12yzsd0fhwdzcpxp9m97zj8m5s275i8ccaj")))) + (build-system emacs-build-system) + (arguments + (list + #:include #~ (cons* "\\.awk$" "\\.org$" %default-include) + #:exclude #~ (cons "^test/" %default-exclude) + #:tests? #t + #:test-command + #~ + (list + "emacs" + "--batch" + "-L" "." + "-L" "tests/" + "-l" "tests/org-fc-filter-test.el" + "-l" "tests/org-fc-indexer-test.el" + "-l" "tests/org-fc-review-data-test.el" + "-f" "ert-run-tests-batch-and-exit") + #:phases + #~ + (modify-phases + %standard-phases + (add-after + 'unpack + 'qualify-paths + (lambda* + (#:key inputs + #:allow-other-keys) + (substitute* + "org-fc-awk.el" + (("\"find ") + (string-append + "\"" + (search-input-file inputs "/bin/find") + " ")) + (("\"gawk ") + (string-append + "\"" + (search-input-file inputs "/bin/gawk") + " ")) + (("\"xargs ") + (string-append + "\"" + (search-input-file inputs "/bin/xargs") + " ")))))))) + (inputs (list findutils gawk)) + (propagated-inputs (list emacs-hydra)) + (home-page "https://www.leonrische.me/fc/index.html") + (synopsis "Spaced repetition system for Emacs Org mode") + (description + (string-append + "Org-fc is a spaced-repetition system for Emacs' Org mode.\n" + "It allows you to mark headlines in a file as flashcards, turning pieces of\n" + "knowledge you want to learn into a question-answer test. These cards are\n" + "reviewed at regular interval. After each review, the next review interval is\n" + "calculated based on how well you remembered the contents of the card.\n")) + (license license:gpl3+)))))) + (simple-service 'home-files + home-files-service-type + (list (list ".config/emacs/init.el" + (local-file "home-files/emacs-configuration.el" )) + (list ".gnus" + (local-file "home-files/gnus-configuration.el")) + (list ".gitconfig" + (local-file "home-files/gitconfig")) + (list ".config/git/ignore" + ;; https://github.com/github/gitignore/blob/main/Global/Emacs.gitignore + (local-file "home-files/git-ignore.conf")))) + (simple-service + 'environment-variables + home-environment-variables-service-type + `(("EDITOR" . "emacsclient -nw")))) + (list + (let* + ((and "&& ") + (collect-garbage "sudo guix gc -d 7d ") + (configuration-prefix + "/home/marek/Publiczny/src/deployment/systems/izumi/") + (pull-guix "guix pull ") + (reconfigure-home + (string-append + "guix home delete-generations 7d ; " + "guix home reconfigure " + configuration-prefix + "home-configuration.scm ")) + (reconfigure-system + (string-append + "sudo guix system delete-generations 7d ; " + "sudo guix system reconfigure " + configuration-prefix + "system-configuration.scm ")) + (update-system + (string-append + pull-guix + and + reconfigure-system + ;; and + ;; reconfigure-home + and + collect-garbage))) + (simple-service + 'bash-extension + home-bash-service-type + (home-bash-extension + (aliases + `(("collect-garbage" . ,collect-garbage) + ("edit" . "$EDITOR") + ("pull-guix" . ,pull-guix) + ("reconfigure-home" . ,reconfigure-home) + ("reconfigure-system" . ,reconfigure-system) + ("update-system" . ,update-system))) + (bash-profile + (list + (mixed-text-file + "newline-prompt" + "PS1=${PS1%?}\n" + "PS1=${PS1%?}\\n'$ '\n" + "PS1=\"\\n$PS1\"")))))))))))))))) ( sudoers-file %sudoers-specification* ) ( swap-devices ( list |