diff options
| author | brian cully <bjc@spork.org> | 2026-03-10 11:25:19 -0400 |
|---|---|---|
| committer | brian cully <bjc@spork.org> | 2026-03-10 12:07:27 -0400 |
| commit | 55ff45523e7a8309bba9d14bc08e3f5af6528669 (patch) | |
| tree | a6ce9f58e3040f48f8396a07cc26d2281c5187ac | |
| download | guix-impermanence-init-55ff45523e7a8309bba9d14bc08e3f5af6528669.tar.gz guix-impermanence-init-55ff45523e7a8309bba9d14bc08e3f5af6528669.zip | |
guix system config for tmpfs-mounted /
| -rw-r--r-- | .dir-locals.el | 4 | ||||
| -rw-r--r-- | configuration.scm | 144 | ||||
| -rw-r--r-- | readme.org | 27 |
3 files changed, 175 insertions, 0 deletions
diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 0000000..158d4ec --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,4 @@ +;;; Directory Local Variables -*- no-byte-compile: t -*- +;;; For more information see (info "(emacs) Directory Variables") + +((nil . ((compile-command . "guix system build ./config.scm")))) diff --git a/configuration.scm b/configuration.scm new file mode 100644 index 0000000..10c2023 --- /dev/null +++ b/configuration.scm @@ -0,0 +1,144 @@ +(use-modules (gnu)) +(use-service-modules virtualization cups desktop networking ssh xorg) + +(define rootfs + (file-system + (mount-point "/") + (needed-for-boot? #t) + (device "tmpfs") + (type "tmpfs") + (check? #f))) + +(define gnufs + (file-system + (mount-point "/gnu") + (needed-for-boot? #t) + (create-mount-point? #t) + (type "btrfs") + (device (file-system-label "root")) + (options "subvol=/gnu,compress=zstd,discard=async"))) + +(define persistfs + (file-system + (mount-point "/persist") + (needed-for-boot? #t) + (create-mount-point? #t) + (type "btrfs") + (device (file-system-label "root")) + (options "subvol=/persist,compress=zstd,discard=async"))) + +(define etcfs + (file-system + (mount-point "/etc") + (needed-for-boot? #t) + (create-mount-point? #t) + (type "btrfs") + (device (file-system-label "root")) + (options "subvol=/persist/etc,compress=zstd,discard=async"))) + +(define varfs + (file-system + (mount-point "/var") + (needed-for-boot? #t) + (create-mount-point? #t) + (type "btrfs") + (device (file-system-label "root")) + (options "subvol=/persist/var,compress=zstd,discard=async"))) + +(define bootfs + (file-system + (mount-point "/boot") + (create-mount-point? #t) + (type "btrfs") + (device (file-system-label "root")) + (options "subvol=/persist/boot,compress=zstd,discard=async"))) + +(define homefs + (file-system + (mount-point "/home") + (create-mount-point? #t) + (type "btrfs") + (device (file-system-label "root")) + (options "subvol=/persist/home,compress=zstd,discard=async"))) + +(define my-file-systems + (list + + rootfs + gnufs + persistfs + + etcfs + varfs + + bootfs + homefs + + (file-system + (mount-point "/boot/efi") + (create-mount-point? #t) + (dependencies (list bootfs)) + (device (file-system-label "ESP")) + (type "vfat")) + + (file-system + (mount-point "/root") + (create-mount-point? #t) + (dependencies (list homefs)) + (type "none") + (device "/home/root") + (flags '(bind-mount))) + + (file-system + (mount-point "/tmp") + (create-mount-point? "1777") + (device "tmpfs") + (type "tmpfs") + (flags '(no-suid no-dev)) + (check? #f)) + + (file-system + (mount-point "/var/guix/temproots") + (create-mount-point? #t) + (device "tmpfs") + (type "tmpfs") + (flags '(no-suid no-dev)) + (check? #f)))) + +(operating-system + (locale "en_US.utf8") + (timezone "America/New_York") + (keyboard-layout (keyboard-layout "us" "altgr-intl")) + (host-name "guixinit") + + (users + (cons* + (user-account + (name "bjc") + (comment "bjc") + (group "users") + (home-directory "/home/bjc") + (supplementary-groups '("wheel" "netdev" "audio" "video"))) + %base-user-accounts)) + + (services + (append + (list + (service openssh-service-type) + (service gnome-desktop-service-type) + (set-xorg-configuration + (xorg-configuration (keyboard-layout keyboard-layout)))) + %desktop-services)) + + (bootloader + (bootloader-configuration + (bootloader grub-efi-bootloader) + (targets (list "/boot/efi")) + (keyboard-layout keyboard-layout))) + + (swap-devices '()) + + (file-systems + (append + my-file-systems + %base-file-systems))) diff --git a/readme.org b/readme.org new file mode 100644 index 0000000..5596abc --- /dev/null +++ b/readme.org @@ -0,0 +1,27 @@ +* partition disk +gpt, 3 partitions: + - 1 :: esp 2GB + - 2 :: swap 8GB + - 3 :: linux-fs rest + +* create filesystems +: mkfs.vfat -L ESP -F 32 /dev/vda1 + +: mkfs.btrfs -L root /dev/vda3 +: btrfs subvol create /dev/vda3 /gnu +: btrfs subvol create /dev/vda3 /persist +: btrfs subvol create /dev/vda3 /persist/etc +: btrfs subvol create /dev/vda3 /persist/var +: btrfs subvol create /dev/vda3 /persist/home +: btrfs subvol create /dev/vda3 /persist/boot + +* mount filesystems +: mkdir /mnt +: mount -t tmpfs tmpfs /mnt +: mount -m -t btrfs -o subvol=/gnu LABEL=root /mnt/gnu +: mount -m -t btrfs -o subvol=/persist LABEL=root /mnt/persist +: mount -m -t btrfs -o subvol=/persist/etc LABEL=root /mnt/etc +: mount -m -t btrfs -o subvol=/persist/var LABEL=root /mnt/var +: mount -m -t btrfs -o subvol=/persist/home LABEL=root /mnt/home +: mount -m -t btrfs -o subvol=/persist/boot LABEL=root /mnt/boot +: mount -m -t vfat LABEL=ESP /mnt/boot/efi |
