Skip to content

Commit

Permalink
fix: misc
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan4yin committed Jan 11, 2024
1 parent 6210fe9 commit 8e98232
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ pull:
echo "Pulling all channel's git repositories..."
echo "Based on the gap between the current commit and the latest commit of guix's official repo, this operation may take a while..."
guix pull --channels=./channels.scm
guix describe --format=channels > ./channels.scm
# guix describe --format=channels > ./channels.scm

31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,34 @@ $14 = (1 2 3 (4 5 6))
scheme@(guile-user) [1]> (cons* 1 2 3 (list 4 5 6))
$15 = (1 2 3 4 5 6)
```
### 2. How to install package vai `config.scm`?
1. `guix search <package-name>` to find the package's location.
1. For example, `guix search kitty` will show the package's location is `gnu/packages/terminals.scm`.
1. add `(use-package-modules terminals)` to the top of `config.scm`.
1. add `kitty` to the `packages` list in `config.scm`.
### 3. Documentation?
1. docs for `use-modules`: it's provided by guile, see <https://www.gnu.org/software/guile/manual/html_node/Using-Modules.html>
1. docs for `use-service-modules`, `use-package-modules` & `use-system-modules`: No docs for them. But you can read their definition in source code: <https://git.savannah.gnu.org/cgit/guix.git/tree/gnu.scm#n143>
1. Source code: <https://git.savannah.gnu.org/cgit/guix.git/tree/>
### 4. Why `guix pull` so slow?(stuck in `computing guix derivation`)
> https://guix.gnu.org/manual/en/html_node/Channels-with-Substitutes.html
When running `guix pull`, Guix will first compile the definitions of every available package. This is an expensive operation for which substitutes (see Substitutes) may be available.
As for nonguix, you can add its official substitutes to speed up the `guix pull` process, search 'substitutes' in <https://gitlab.com/nonguix/nonguix> for details.
> In NixOS, `nix` has no compilation phase and is a fully interpreted language, so `nix flake update` is much faster than `guix pull`.
The substitutes you added into `config.scm` will only be available after the first `guix system reconfigure` finished!
To speed up the first reconfigure, see nonuix's official README for details.
#### 5. `guix system reconfigure` so slow?(stuck in `build phase`)
Same as above, you can add nonguix's substitutes to speed up the `guix system reconfigure` process.
26 changes: 17 additions & 9 deletions config.scm
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
;; used in this configuration.
(use-modules (gnu) (gnu system nss))
(use-service-modules cups desktop networking ssh xorg)
(use-package-modules bootloaders certs emacs emacs-xyz ratpoison suckless wm
xorg)

;; Import nonfree linux module.
(use-modules (nongnu packages linux)
Expand Down Expand Up @@ -43,15 +41,16 @@
;; for packages and 'guix install PACKAGE' to install a package.
;; Add a bunch of window managers; we can choose one at
;; the log-in screen with F1.
(packages (append (list
(packages (append (map specification->package '(
"tcpdump"
;; window managers
ratpoison i3-wm i3status dmenu
emacs emacs-exwm emacs-desktop-environment
make neovim git kitty ncurses-with-tinfo
"ratpoison" "i3-wm" "i3status" "dmenu"
"emacs" "emacs-exwm" "emacs-desktop-environment"
"make" "neovim" "git" "kitty" "ncurses-with-tinfo"
;; terminal emulator
xterm
"xterm"
;; for HTTPS access
nss-certs)
"nss-certs"))
%base-packages))

;; Below is the list of system services. To search for available
Expand All @@ -72,7 +71,16 @@
(guix-service-type
config => (guix-configuration
(inherit config)
(substitute-urls '("https://mirror.sjtu.edu.cn/guix/" "https://ci.guix.gnu.org")))))))
(substitute-urls '(
;; official substitute's mirror in China
"https://mirror.sjtu.edu.cn/guix/"
;; nonguix's official substitute
"https://substitutes.nonguix.org"
;; official substitute
"https://ci.guix.gnu.org")
(authorized-keys
(append (list (local-file "./signing-key.pub"))
%default-authorized-guix-keys)))))))

(bootloader (bootloader-configuration
(bootloader grub-bootloader)
Expand Down
6 changes: 6 additions & 0 deletions signing-key.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(public-key
(ecc
(curve Ed25519)
(q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#)
)
)

0 comments on commit 8e98232

Please sign in to comment.