From ab062e6c30616a80b3246efca421e3d40d479201 Mon Sep 17 00:00:00 2001 From: Marek Paśnikowski Date: Tue, 10 Jan 2023 21:13:36 +0100 Subject: Refactor Filesystems --- aisaka.org | 145 ++++++++++++++++++++++++++++++----------------- emacs.el | 8 ++- system-configuration.scm | 94 +++++++++++++++--------------- 3 files changed, 146 insertions(+), 101 deletions(-) diff --git a/aisaka.org b/aisaka.org index 5950470..4bb8ccf 100644 --- a/aisaka.org +++ b/aisaka.org @@ -1,11 +1,64 @@ -:PROPERTIES: -:header-args: :noweb -:END: #+title: Configuration of the Aisaka computer -*- mode: org -*- #+startup: overview #+property: header-args:scheme :noweb yes #+property: header-args:scheme+ :noweb-prefix no +* TODO File Systems + +This system has a very simple file system - a boot partition, main partition +for everything else and swap. The main partition is encrypted. + +** Mapped Devices + +Data encryption layer, password protected. The LUKS encryption type is +used. + +#+name: luks +#+begin_src scheme + (mapped-device + (source (uuid "887ac37f-2919-41a0-a62a-e1ff5ea2d6cc")) + (target "aisaka-root") + (type luks-device-mapping)) +#+end_src + +** File Systems + +The data is split into an unencrypted boot partition and encrypted root +filesystem. + +*** Root File System + +The root filesystem is mounted on the encryption layer. Its type is +BTRFS. + +#+name: rootfs +#+begin_src scheme + (file-system + (mount-point "/") + (device "/dev/mapper/aisaka-root") + (type "btrfs") + (dependencies mapped-devices)) +#+end_src + +*** Boot File System + +The boot partition is on EXT4 filesystem. + +#+name: bootfs +#+begin_src scheme + (file-system + (mount-point "/boot") + (device (uuid "4f77b5fc-56ad-43ae-b6ec-e5adc8c48587")) + (type "ext4")) +#+end_src + +** TODO Swap Devices + +#+name: swap +#+begin_src scheme + (swap-space (target (uuid "73bed3f9-be07-40ad-a228-577cd24f2e1d"))) +#+end_src + * TODO LIBREBOOT The first layer of computing is the firmware. The Lenovo Thinkpad X200 has @@ -153,65 +206,55 @@ The Sway Window Manager consists of Sway packages and relevant configurations. (define keyboard-layout (keyboard-layout "pl")) - (define mapped-devices - `(,(mapped-device (source (uuid "887ac37f-2919-41a0-a62a-e1ff5ea2d6cc")) - (target "aisaka-root") - (type luks-device-mapping)))) - (operating-system (locale "pl_PL.utf8") (timezone "Europe/Warsaw") (keyboard-layout keyboard-layout) (host-name "aisaka") (users (cons* (user-account (name "marek") - (comment "Marek Paśnikowski") - (group "users") - (home-directory "/home/marek") - (supplementary-groups '("audio" - "netdev" - "tor" - "video" - "wheel"))) - %base-user-accounts)) + (comment "Marek Paśnikowski") + (group "users") + (home-directory "/home/marek") + (supplementary-groups '("audio" + "netdev" + "tor" + "video" + "wheel"))) + %base-user-accounts)) (packages (append (map (compose list - specification->package+output) - '("netcat-openbsd" - "nss-certs" - "trezord" - "trezord-udev-rules")) - %base-packages)) + specification->package+output) + '("netcat-openbsd" + "nss-certs" + "trezord" + "trezord-udev-rules")) + %base-packages)) (services (cons* ssh-service - (service cups-service-type - (cups-configuration (extensions `(,cups-filters - ,epson-inkjet-printer-escpr)) - (web-interface? #t))) - (service tor-service-type - (tor-configuration (config-file (local-file "torrc")) - (control-socket? #t))) - (udev-rules-service 'trezord trezord-udev-rules) - (modify-services %desktop-services - (elogind-service-type - configuration => - (elogind-configuration - (inherit configuration) - (handle-lid-switch 'ignore))) - (delete gdm-service-type)))) + (service cups-service-type + (cups-configuration (extensions `(,cups-filters + ,epson-inkjet-printer-escpr)) + (web-interface? #t))) + (service tor-service-type + (tor-configuration (config-file (local-file "torrc")) + (control-socket? #t))) + (udev-rules-service 'trezord trezord-udev-rules) + (modify-services %desktop-services + (elogind-service-type + configuration => + (elogind-configuration + (inherit configuration) + (handle-lid-switch 'ignore))) + (delete gdm-service-type)))) (bootloader (bootloader-configuration (bootloader grub-bootloader) - (targets '("/dev/sda")) - (keyboard-layout keyboard-layout))) + (targets '("/dev/sda")) + (keyboard-layout keyboard-layout))) (swap-devices - `(,(swap-space (target (uuid "73bed3f9-be07-40ad-a228-577cd24f2e1d"))))) - (mapped-devices mapped-devices) + `(,<>)) + (mapped-devices + `(,<>)) (file-systems - (cons* (file-system - (mount-point "/") - (device "/dev/mapper/aisaka-root") - (type "btrfs") - (dependencies mapped-devices)) - (file-system (mount-point "/boot") - (device (uuid "4f77b5fc-56ad-43ae-b6ec-e5adc8c48587")) - (type "ext4")) - %base-file-systems))) + (append %base-file-systems + `(,<> + ,<>)))) #+end_src ** TODO Home configuration diff --git a/emacs.el b/emacs.el index 4a9b21a..fb09290 100644 --- a/emacs.el +++ b/emacs.el @@ -29,9 +29,11 @@ ;; Prepare Literate Programming ;; (require 'org-auto-tangle) (add-hook 'org-mode-hook 'org-auto-tangle-mode) -(setq-default org-confirm-babel-evaluate nil - org-src-fontify-natively t - org-src-tab-acts-natively t) +(setq-default + org-startup-indented t + org-confirm-babel-evaluate nil + org-src-fontify-natively t + org-src-tab-acts-natively t) (org-babel-do-load-languages 'org-babel-load-languages '((emacs-lisp . t) (scheme . t ) (shell . t ))) diff --git a/system-configuration.scm b/system-configuration.scm index bd8fd8d..d4a8dc6 100644 --- a/system-configuration.scm +++ b/system-configuration.scm @@ -15,62 +15,62 @@ (define keyboard-layout (keyboard-layout "pl")) -(define mapped-devices - `(,(mapped-device (source (uuid "887ac37f-2919-41a0-a62a-e1ff5ea2d6cc")) - (target "aisaka-root") - (type luks-device-mapping)))) - (operating-system (locale "pl_PL.utf8") (timezone "Europe/Warsaw") (keyboard-layout keyboard-layout) (host-name "aisaka") (users (cons* (user-account (name "marek") - (comment "Marek Paśnikowski") - (group "users") - (home-directory "/home/marek") - (supplementary-groups '("audio" - "netdev" - "tor" - "video" - "wheel"))) - %base-user-accounts)) + (comment "Marek Paśnikowski") + (group "users") + (home-directory "/home/marek") + (supplementary-groups '("audio" + "netdev" + "tor" + "video" + "wheel"))) + %base-user-accounts)) (packages (append (map (compose list - specification->package+output) - '("netcat-openbsd" - "nss-certs" - "trezord" - "trezord-udev-rules")) - %base-packages)) + specification->package+output) + '("netcat-openbsd" + "nss-certs" + "trezord" + "trezord-udev-rules")) + %base-packages)) (services (cons* ssh-service - (service cups-service-type - (cups-configuration (extensions `(,cups-filters - ,epson-inkjet-printer-escpr)) - (web-interface? #t))) - (service tor-service-type - (tor-configuration (config-file (local-file "torrc")) - (control-socket? #t))) - (udev-rules-service 'trezord trezord-udev-rules) - (modify-services %desktop-services - (elogind-service-type - configuration => - (elogind-configuration - (inherit configuration) - (handle-lid-switch 'ignore))) - (delete gdm-service-type)))) + (service cups-service-type + (cups-configuration (extensions `(,cups-filters + ,epson-inkjet-printer-escpr)) + (web-interface? #t))) + (service tor-service-type + (tor-configuration (config-file (local-file "torrc")) + (control-socket? #t))) + (udev-rules-service 'trezord trezord-udev-rules) + (modify-services %desktop-services + (elogind-service-type + configuration => + (elogind-configuration + (inherit configuration) + (handle-lid-switch 'ignore))) + (delete gdm-service-type)))) (bootloader (bootloader-configuration (bootloader grub-bootloader) - (targets '("/dev/sda")) - (keyboard-layout keyboard-layout))) + (targets '("/dev/sda")) + (keyboard-layout keyboard-layout))) (swap-devices `(,(swap-space (target (uuid "73bed3f9-be07-40ad-a228-577cd24f2e1d"))))) - (mapped-devices mapped-devices) + (mapped-devices + `(,(mapped-device + (source (uuid "887ac37f-2919-41a0-a62a-e1ff5ea2d6cc")) + (target "aisaka-root") + (type luks-device-mapping)))) (file-systems - (cons* (file-system - (mount-point "/") - (device "/dev/mapper/aisaka-root") - (type "btrfs") - (dependencies mapped-devices)) - (file-system (mount-point "/boot") - (device (uuid "4f77b5fc-56ad-43ae-b6ec-e5adc8c48587")) - (type "ext4")) - %base-file-systems))) + (append %base-file-systems + `(,(file-system + (mount-point "/") + (device "/dev/mapper/aisaka-root") + (type "btrfs") + (dependencies mapped-devices)) + ,(file-system + (mount-point "/boot") + (device (uuid "4f77b5fc-56ad-43ae-b6ec-e5adc8c48587")) + (type "ext4")))))) -- cgit v1.2.3