diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..56175f9 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/README.org b/README.org new file mode 100644 index 0000000..16a3f88 --- /dev/null +++ b/README.org @@ -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]] diff --git a/id_rsa.pub b/id_rsa.pub new file mode 100644 index 0000000..012f13b --- /dev/null +++ b/id_rsa.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC7uYYKlge2j6JoMrs6vxj++FeuTpcv5+UIeD0shZdWS5INR4ZZv2Gmd07QfmyPr7W2gp7pKOalvENaXYGc8iDzmWr+poOQNjHoHXFujfZe7o89HlwzRGB6WENFbO+N78j2ASRCOslTWsDYQ5abQvT5I70vIhtBVyAkxWBI00S8GOaFs2HvUmS7ROfsdTHSR6Y9T85+HLBzsWGSusysMAyl1JTiV0/qsakcpkV3WRjpMj1zwm6qSuYrdOx3RvBZ5wc4kk0j/Qm+yVqnHbUcsIS06JhManVe7SLAjSbNH65rAJha7fZRlAQ92P9zKlHjsHWvsLqrYMboPUT0y2Tk4HKJwraWjWi62xE3e7gW8ce+L+Ueky/1g80Hk4dF72yTigAmNVIJJGgle6vpWA8qW2tSzZewB4kgBjpC/WEAN05JNth5W2pNNwRg/nsCqlDAFfXr9aI9BoixcV4ugecPlz27gaibZM4FM5s2ZFqfAshDJ8874aRGjiy+pheCoqi1BQxufKkE40kT+rFVa1Oc5CvaU3xR7xLhbJyP95X7BjkE253Xjkf63k4Qn31tw0tcBp0YQKKuWdx5Px9wrWT2QdDLP/r4+g2RRyejVutmJo404DXD4mq7HZaH8c1fuOe58yAbaqbJa4GxAQLuHAfsgNrRiHccoe14iacUdg0FZB2NpQ== (none) \ No newline at end of file diff --git a/server.scm b/server.scm new file mode 100644 index 0000000..baed7a6 --- /dev/null +++ b/server.scm @@ -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)))