summaryrefslogtreecommitdiffstats
path: root/src/jd/host.scm
blob: 1bd5c307c9b76a70d37b9e32a7c16f7a2eb8b4c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
(define-module (jd host)
  #:use-module (rde features base)
  #:use-module (rde features system)
  #:use-module (rde features wm)
  #:use-module (gnu system file-systems)
  #:use-module (gnu system mapped-devices)
  #:use-module (ice-9 match))

(define mapped-devices
  (list (mapped-device
         (source (uuid "3fcc2e44-77bb-4a62-bbdc-f8c646fccbd2"))
         (target "enc")
         (type luks-device-mapping))))

(define btrfs-subvolumes
  (map (match-lambda
         ((subvol . mount-point)
          (file-system
           (type "btrfs")
           (device "/dev/mapper/enc")
           (mount-point mount-point)
           (options (format #f "subvol=~a" subvol))
           (dependencies mapped-devices))))
       '((@ . "/")
         (@boot . "/boot")
         (@gnu  . "/gnu")
         (@nix  . "/nix")
         (@home . "/home")
         (@data . "/data")
         (@var-log . "/var/log"))))

(define data-fs
  (car
   (filter
    (lambda (x) (equal? (file-system-mount-point x) "/data"))
    btrfs-subvolumes)))

(define file-systems
  (append
   btrfs-subvolumes
   (list
    (file-system
     (device "/data/system/var/lib")
     (type "none")
     (mount-point "/var/lib")
     (flags '(bind-mount))
     (dependencies (list data-fs)))
    (file-system
     (mount-point "/boot/efi")
     (type "vfat")
     (device (uuid "82F1-2D6E" 'fat32))))))

(define-public %host-features
  (list
   (feature-host-info
    #:host-name "berserker"
    #:timezone  "Europe/Warsaw")
   (feature-file-systems
    #:mapped-devices mapped-devices
    #:file-systems   file-systems)
   (feature-kanshi
    #:extra-config
    `((profile laptop ((output eDP-1 enable)))
      (profile docked ((output eDP-1 disable)
                       (output DP-3  enable)))
      (profile docked ((output eDP-1 disable)
                       (output DP-4  enable)))))
   (feature-hidpi)))