diff options
Diffstat (limited to 'src/jd/host.scm')
| -rw-r--r-- | src/jd/host.scm | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/jd/host.scm b/src/jd/host.scm new file mode 100644 index 0000000..4e573e4 --- /dev/null +++ b/src/jd/host.scm | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | (define-module (jd host) | ||
| 2 | #:use-module (rde features base) | ||
| 3 | #:use-module (rde features system) | ||
| 4 | #:use-module (rde features wm) | ||
| 5 | #:use-module (gnu system file-systems) | ||
| 6 | #:use-module (gnu system mapped-devices) | ||
| 7 | #:use-module (ice-9 match)) | ||
| 8 | |||
| 9 | (define mapped-devices | ||
| 10 | (list (mapped-device | ||
| 11 | (source (uuid "3fcc2e44-77bb-4a62-bbdc-f8c646fccbd2")) | ||
| 12 | (target "enc") | ||
| 13 | (type luks-device-mapping)))) | ||
| 14 | |||
| 15 | (define btrfs-subvolumes | ||
| 16 | (map (match-lambda | ||
| 17 | ((subvol . mount-point) | ||
| 18 | (file-system | ||
| 19 | (type "btrfs") | ||
| 20 | (device "/dev/mapper/enc") | ||
| 21 | (mount-point mount-point) | ||
| 22 | (options (format #f "subvol=~a" subvol)) | ||
| 23 | (dependencies mapped-devices)))) | ||
| 24 | '((@ . "/") | ||
| 25 | (@boot . "/boot") | ||
| 26 | (@gnu . "/gnu") | ||
| 27 | (@nix . "/nix") | ||
| 28 | (@home . "/home") | ||
| 29 | (@data . "/data") | ||
| 30 | (@var-log . "/var/log")))) | ||
| 31 | |||
| 32 | (define data-fs | ||
| 33 | (car | ||
| 34 | (filter | ||
| 35 | (lambda (x) (equal? (file-system-mount-point x) "/data")) | ||
| 36 | btrfs-subvolumes))) | ||
| 37 | |||
| 38 | (define file-systems | ||
| 39 | (append | ||
| 40 | btrfs-subvolumes | ||
| 41 | (list | ||
| 42 | (file-system | ||
| 43 | (device "/data/system/var/lib") | ||
| 44 | (type "none") | ||
| 45 | (mount-point "/var/lib") | ||
| 46 | (flags '(bind-mount)) | ||
| 47 | (dependencies (list data-fs))) | ||
| 48 | (file-system | ||
| 49 | (mount-point "/boot/efi") | ||
| 50 | (type "vfat") | ||
| 51 | (device (uuid "82F1-2D6E" 'fat32)))))) | ||
| 52 | |||
| 53 | (define-public %host-features | ||
| 54 | (list | ||
| 55 | (feature-host-info | ||
| 56 | #:host-name "berserker" | ||
| 57 | #:timezone "Europe/Warsaw" | ||
| 58 | #:issue "Greetings, wandering soul, craving the tapping keystrokes?") | ||
| 59 | (feature-file-systems | ||
| 60 | #:mapped-devices mapped-devices | ||
| 61 | #:file-systems file-systems) | ||
| 62 | (feature-kanshi | ||
| 63 | #:extra-config | ||
| 64 | `((profile laptop ((output eDP-1 enable))) | ||
| 65 | (profile docked ((output eDP-1 disable) | ||
| 66 | (output DP-3 enable))) | ||
| 67 | (profile docked ((output eDP-1 disable) | ||
| 68 | (output DP-4 enable))) | ||
| 69 | (profile docked ((output eDP-1 disable) | ||
| 70 | (output DP-6 enable))))) | ||
| 71 | (feature-hidpi))) | ||
