Skip to content

Commit

Permalink
Initial bootstrapping configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
daviwil committed Jan 23, 2022
0 parents commit 6b8d879
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build Server Image

on:
push:
branches:
- master

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2

- name: Install Guix
uses: PromyLOPh/guix-install-action@v1

- name: Build Image
run: |
image=$(guix system image --save-provenance server.scm)
cp $image server.img
export RELEASE_TAG=$(date +"%Y%m%d%H%M")
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: crafter-chat - ${{ env.RELEASE_TAG }}
tag_name: v${{ env.RELEASE_TAG }}
files: server.img
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: SystemCrafters/crafter-chat
20 changes: 20 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#+title: crafter-chat

🚧 Under Construction 🚧

* Bootstrapping the Server

Generate the base system image that can be used for installation:

#+begin_src sh

guix system image --save-provenance server.scm

#+end_src

* References

- [[https://git.savannah.gnu.org/cgit/guix/maintenance.git/tree/hydra/berlin.scm][Guix team's berlin server]]: =rsync-module= is interesting
- [[https://stumbles.id.au/getting-started-with-guix-deploy.html][Getting Started with guix deploy]]
- [[https://guix.gnu.org/cookbook/en/html_node/Running-Guix-on-a-Linode-Server.html][Running Guix on a Linode Server]]
- [[https://wiki.pantherx.org/Installation-digital-ocean/][Installing Guix on DigitalOcean]]
1 change: 1 addition & 0 deletions id_rsa.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC7uYYKlge2j6JoMrs6vxj++FeuTpcv5+UIeD0shZdWS5INR4ZZv2Gmd07QfmyPr7W2gp7pKOalvENaXYGc8iDzmWr+poOQNjHoHXFujfZe7o89HlwzRGB6WENFbO+N78j2ASRCOslTWsDYQ5abQvT5I70vIhtBVyAkxWBI00S8GOaFs2HvUmS7ROfsdTHSR6Y9T85+HLBzsWGSusysMAyl1JTiV0/qsakcpkV3WRjpMj1zwm6qSuYrdOx3RvBZ5wc4kk0j/Qm+yVqnHbUcsIS06JhManVe7SLAjSbNH65rAJha7fZRlAQ92P9zKlHjsHWvsLqrYMboPUT0y2Tk4HKJwraWjWi62xE3e7gW8ce+L+Ueky/1g80Hk4dF72yTigAmNVIJJGgle6vpWA8qW2tSzZewB4kgBjpC/WEAN05JNth5W2pNNwRg/nsCqlDAFfXr9aI9BoixcV4ugecPlz27gaibZM4FM5s2ZFqfAshDJ8874aRGjiy+pheCoqi1BQxufKkE40kT+rFVa1Oc5CvaU3xR7xLhbJyP95X7BjkE253Xjkf63k4Qn31tw0tcBp0YQKKuWdx5Px9wrWT2QdDLP/r4+g2RRyejVutmJo404DXD4mq7HZaH8c1fuOe58yAbaqbJa4GxAQLuHAfsgNrRiHccoe14iacUdg0FZB2NpQ== (none)
30 changes: 30 additions & 0 deletions server.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
(use-modules (gnu))
(use-service-modules networking ssh)
(use-package-modules bootloaders ssh)

(define %)
(operating-system
(host-name "crafter-chat")
(timezone "Etc/UTC")

(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(targets '("/dev/vda"))
(terminal-outputs '(console))))

(file-systems (cons (file-system
(mount-point "/")
(device "/dev/vda1")
(type "ext4"))
%base-file-systems))

(services
(append (list (service dhcp-client-service-type)
(service openssh-service-type
(openssh-configuration
(openssh openssh-sans-x)
(password-authentication? #f)
(permit-root-login #t)
(authorized-keys
`(("root" ,(local-file "id_rsa.pub")))))))
%base-services)))

0 comments on commit 6b8d879

Please sign in to comment.