From 19c1df33cc99e1a1fa97407bdbd1235d7871b456 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sat, 23 Jan 2016 06:56:17 +0100 Subject: [PATCH] Add oswald --- hosts/oswald/system.scm | 101 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 hosts/oswald/system.scm diff --git a/hosts/oswald/system.scm b/hosts/oswald/system.scm new file mode 100644 index 0000000..34280b6 --- /dev/null +++ b/hosts/oswald/system.scm @@ -0,0 +1,101 @@ +(define-module (hosts oswald system) + #:use-module (gnu) + #:use-module (gnu bootloader u-boot) + #:use-module (gnu packages bootloaders) + #:use-module (gnu packages certs) + #:use-module (gnu packages linux) + #:use-module (gnu packages rsync) + #:use-module (gnu services admin) + #:use-module (gnu services networking) + #:use-module (gnu services ssh) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (srfi srfi-26) + #:use-module (services chrony)) + +;; Use a lower DDR frequency to avoid random segfaults. +;; See . +(define u-boot-rock64-rk3328/666 + (package + (inherit u-boot-rock64-rk3328) + (arguments + (substitute-keyword-arguments (package-arguments u-boot-rock64-rk3328) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'change-ddr-clock + (lambda _ + (substitute* "arch/arm/dts/rk3328-rock64-u-boot.dtsi" + (("rk3328-sdram-lpddr3-1600.dtsi") "rk3328-sdram-lpddr3-666.dtsi")))))))))) + +(define chrony-config "\ +pool pool.ntp.org iburst +makestep 1.0 3 +driftfile /var/lib/chrony/drift +") + +(operating-system + (host-name "oswald") + (timezone "Europe/Ljubljana") + (locale "en_US.utf8") + + (kernel linux-libre-arm64-generic) + (kernel-arguments '("mitigations=auto")) + (initrd-modules '()) + + (bootloader + (bootloader-configuration + (bootloader + (bootloader + (inherit u-boot-rock64-rk3328-bootloader) + (package u-boot-rock64-rk3328/666))) + (targets '("/dev/disk/by-id/mmc-A3A442_0xe236282f")))) + + (file-systems + (cons* + (file-system + (mount-point "/") + (type "ext4") + (device (uuid "75c144d6-1693-4245-8375-b678d0c8ba9b"))) + %base-file-systems)) + + (swap-devices (list (swap-space (target "/swap")))) + + (users + (cons* + (user-account + (name "timotej") + (comment "Timotej Lazar") + (group "users") + (supplementary-groups '("wheel" "netdev" "kvm")) + (home-directory "/home/timotej")) + %base-user-accounts)) + + (packages + (cons* nss-certs rsync %base-packages)) + + (services + (cons* + (service static-networking-service-type + (list (static-networking + (addresses (list (network-address + (device "eth0") + (value "192.168.0.3/24")))) + (routes (list (network-route + (destination "default") + (gateway "192.168.0.1")))) + (name-servers '("193.2.1.66" "193.2.1.72"))))) + + (service chrony-service-type + (chrony-configuration + (config-file (plain-file "chrony.conf" chrony-config)) + (syscall-filter "1"))) + + (service openssh-service-type + (openssh-configuration + (password-authentication? #f))) + + (service unattended-upgrade-service-type + (unattended-upgrade-configuration + (channels #~(load "/run/current-system/channels.scm")))) + + %base-services)))