diff options
Diffstat (limited to 'hipis.scm')
| -rwxr-xr-x | hipis.scm | 151 |
1 files changed, 0 insertions, 151 deletions
diff --git a/hipis.scm b/hipis.scm deleted file mode 100755 index 0eacf56..0000000 --- a/hipis.scm +++ /dev/null | |||
| @@ -1,151 +0,0 @@ | |||
| 1 | (use-modules (gnu) | ||
| 2 | (guix) | ||
| 3 | (gnu system) | ||
| 4 | (gnu services)) | ||
| 5 | |||
| 6 | (use-service-modules networking | ||
| 7 | ssh | ||
| 8 | cgit | ||
| 9 | version-control | ||
| 10 | certbot | ||
| 11 | web) | ||
| 12 | |||
| 13 | (define jdlugosz-ssh-pub | ||
| 14 | (local-file "./jdlugosz.pub")) | ||
| 15 | |||
| 16 | (define %nginx-deploy-hook | ||
| 17 | (program-file | ||
| 18 | "nginx-deploy-hook" | ||
| 19 | #~(let ((pid (call-with-input-file "/var/run/nginx/pid" read))) | ||
| 20 | (kill pid SIGHUP)))) | ||
| 21 | |||
| 22 | (define uuid-root "1ec6339b-4918-45d2-b77e-b32cf265265d") | ||
| 23 | (define dev-bootloader "/dev/xvda") | ||
| 24 | |||
| 25 | (define (letsencrypt-certificate domain) | ||
| 26 | (string-append "/etc/letsencrypt/live/" domain "/fullchain.pem")) | ||
| 27 | |||
| 28 | (define (letsencrypt-key domain) | ||
| 29 | (string-append "/etc/letsencrypt/live/" domain "/privkey.pem")) | ||
| 30 | |||
| 31 | (define hipis | ||
| 32 | (operating-system | ||
| 33 | (locale "en_US.utf8") | ||
| 34 | (timezone "Europe/Warsaw") | ||
| 35 | (keyboard-layout (keyboard-layout "pl")) | ||
| 36 | (host-name "hipis") | ||
| 37 | |||
| 38 | (users (cons* | ||
| 39 | (user-account | ||
| 40 | (name "jakub") | ||
| 41 | (comment "Jakub Dlugosz") | ||
| 42 | (group "users") | ||
| 43 | (home-directory "/home/jakub") | ||
| 44 | (password (crypt "Init14ll-p455w0rd#$" "$6$abc")) | ||
| 45 | (supplementary-groups '("wheel" ;; sudo | ||
| 46 | "netdev" ;; network devices | ||
| 47 | "tty" | ||
| 48 | "input"))) | ||
| 49 | (user-account | ||
| 50 | (name "fcgiwrap") | ||
| 51 | (group "fcgiwrap") | ||
| 52 | (supplementary-groups '("git"))) | ||
| 53 | %base-user-accounts)) | ||
| 54 | |||
| 55 | ;; (user-group (name "git")) | ||
| 56 | |||
| 57 | (packages (append | ||
| 58 | (specifications->packages '("emacs-no-x-toolkit" | ||
| 59 | "exfat-utils" | ||
| 60 | "git" | ||
| 61 | "nss-certs" | ||
| 62 | "nmap" | ||
| 63 | "curl")) | ||
| 64 | %base-packages)) | ||
| 65 | |||
| 66 | (services (cons* | ||
| 67 | (service openssh-service-type | ||
| 68 | (openssh-configuration | ||
| 69 | (permit-root-login 'prohibit-password) | ||
| 70 | (allow-empty-passwords? #f) | ||
| 71 | (password-authentication? #f) | ||
| 72 | (authorized-keys | ||
| 73 | `(("jakub" ,jdlugosz-ssh-pub))))) | ||
| 74 | |||
| 75 | (service static-networking-service-type | ||
| 76 | (list (static-networking | ||
| 77 | (addresses | ||
| 78 | (list (network-address | ||
| 79 | (device "eth0") | ||
| 80 | (value "195.74.91.18/26")))) | ||
| 81 | (routes | ||
| 82 | (list (network-route | ||
| 83 | (destination "default") | ||
| 84 | (gateway "195.74.91.1")))) | ||
| 85 | (name-servers '("195.74.91.4 " "193.200.50.51"))) | ||
| 86 | |||
| 87 | %loopback-static-networking)) | ||
| 88 | |||
| 89 | (service gitolite-service-type | ||
| 90 | (gitolite-configuration | ||
| 91 | (admin-pubkey jdlugosz-ssh-pub) | ||
| 92 | (rc-file | ||
| 93 | (gitolite-rc-file (umask #o0027))))) | ||
| 94 | |||
| 95 | (service certbot-service-type | ||
| 96 | (certbot-configuration | ||
| 97 | (email "me@jdlugosz.com") | ||
| 98 | (certificates | ||
| 99 | (list | ||
| 100 | (certificate-configuration | ||
| 101 | (domains '("jdlugosz.com" "git.jdlugosz.com")) | ||
| 102 | (deploy-hook %nginx-deploy-hook)))))) | ||
| 103 | |||
| 104 | (service cgit-service-type | ||
| 105 | (cgit-configuration | ||
| 106 | (enable-commit-graph? #t) | ||
| 107 | (enable-html-serving? #t) | ||
| 108 | (remove-suffix? #t) | ||
| 109 | (repository-directory "/var/lib/gitolite/repositories/public") | ||
| 110 | (nocache? #t) | ||
| 111 | (enable-log-filecount? #t) | ||
| 112 | (enable-log-linecount? #t) | ||
| 113 | (readme "CGIT README") | ||
| 114 | |||
| 115 | (nginx | ||
| 116 | (list | ||
| 117 | (nginx-server-configuration | ||
| 118 | (inherit %cgit-configuration-nginx) | ||
| 119 | (server-name '("git.jdlugosz.com")) | ||
| 120 | (listen '("443 ssl")) | ||
| 121 | (ssl-certificate (letsencrypt-certificate "jdlugosz.com")) | ||
| 122 | (ssl-certificate-key (letsencrypt-key "jdlugosz.com"))))))) | ||
| 123 | |||
| 124 | (service nginx-service-type | ||
| 125 | (nginx-configuration | ||
| 126 | (server-blocks | ||
| 127 | (list | ||
| 128 | (nginx-server-configuration | ||
| 129 | (server-name '("jdlugosz.com")) | ||
| 130 | (listen '("443 ssl")) | ||
| 131 | (ssl-certificate (letsencrypt-certificate "jdlugosz.com")) | ||
| 132 | (ssl-certificate-key (letsencrypt-key "jdlugosz.com")) | ||
| 133 | (root "/srv/http/jdlugosz.com")))))) | ||
| 134 | |||
| 135 | (modify-services %base-services | ||
| 136 | (delete static-networking-service-type)))) | ||
| 137 | |||
| 138 | (bootloader (bootloader-configuration | ||
| 139 | (bootloader grub-bootloader) | ||
| 140 | (targets (list dev-bootloader)) | ||
| 141 | (keyboard-layout keyboard-layout))) | ||
| 142 | |||
| 143 | (file-systems (cons* (file-system | ||
| 144 | (mount-point "/") | ||
| 145 | (device (uuid | ||
| 146 | uuid-root | ||
| 147 | 'ext4)) | ||
| 148 | (type "ext4")) %base-file-systems)))) | ||
| 149 | |||
| 150 | hipis | ||
| 151 | |||
