aboutsummaryrefslogtreecommitdiff
path: root/.guix/guix-na/config/balg02.scm
blob: b52f4be9ed0de6736092b92962bf687eceeb8651 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
;; (C) Copyright Collin J. Doering 2024
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

;; File: balg02.scm
;; Author: Collin J. Doering <collin@rekahsoft.ca>
;; Date: Feb 24, 2024

(define-module (guix-na config balg02)
  #:use-module (gnu)
  #:use-module (gnu system)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages shells)
  #:use-module (gnu services base)
  #:use-module (gnu services cuirass)
  #:use-module (gnu services networking)
  #:use-module (gnu services ssh)
  #:use-module (gnu services web)
  #:export (balg02 %system))

(define %automation-user "auto")

(define (balg02 disk)
  (operating-system
   (host-name "balg02")
   (timezone "US/Central")
   (locale "en_US.utf8")
   (keyboard-layout (keyboard-layout "us"))

   (bootloader (bootloader-configuration
                (bootloader grub-bootloader)
                (terminal-inputs '(console serial_1))
                (terminal-outputs '(console serial_1))
                (serial-unit 1)
                (serial-speed 115200)
                (targets `(,disk))))

   (file-systems (append
                  (list (file-system
                         (device (file-system-label "root"))
                         (mount-point "/")
                         (type "btrfs")
                         (options "subvol=@,compress=zstd"))
                        (file-system
                         (device (file-system-label "root"))
                         (mount-point "/swap")
                         (type "btrfs")
                         (options "subvol=@swap")))
                  %base-file-systems))

   (swap-devices
    (list (swap-space
           (target "/swap/swapfile")
           (dependencies (filter (file-system-mount-point-predicate "/swap")
                                 file-systems)))))

   (users (cons* (user-account
                  (name %automation-user)
                  (comment "Automation User")
                  (group "users")
	          (shell #~(string-append #$bash "/bin/bash"))
                  (supplementary-groups
                   '("wheel"))
                  (home-directory "/home/auto"))
                 (user-account
                  (name "collin")
                  (comment "Admin user")
                  (group "users")
	          (shell #~(string-append #$zsh "/bin/zsh"))
                  (supplementary-groups
                   '("wheel"))
                  (home-directory "/home/collin"))
                 %base-user-accounts))

   (packages
    (append
     (map specification->package
          '("nss-certs"
            "recutils"
            "openssh"
            "tmux"
            "emacs"
            "emacs-guix"))
     %base-packages))

   (services
    (append
     (list
      (service openssh-service-type
	       (openssh-configuration
		(password-authentication? #f)
		(authorized-keys
		 `(("auto" ,(local-file "../../../.pubkeys/deploy-key.pub"))
                   ("collin" ,(local-file "../../../.pubkeys/collin.pub"))
		   ("root" ,(local-file "../../../.pubkeys/collin.pub"))))))
      (service static-networking-service-type
               (list (static-networking
                      (addresses
                       (list (network-address
                              (device "eno8303")
                              (value "216.37.76.55/24"))))
                      (routes
                       (list (network-route
                              (destination "default")
                              (gateway "216.37.76.1"))))
                      (name-servers '("216.37.64.2" "216.37.64.3")))))
      (service ntp-service-type))
     %base-services))))

(define %system (balg02 "/dev/sda"))