diff options
author | EuAndreh <eu@euandre.org> | 2019-05-30 23:40:57 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2019-05-30 23:42:37 -0300 |
commit | e3c6aba94e7a162aa5f1b8b0a7658081cab6687a (patch) | |
tree | 96c4d030bcb0b0b41c7d1a304fd3fe0219a4431d | |
parent | TODOs.org (diff) | |
download | dotfiles-e3c6aba94e7a162aa5f1b8b0a7658081cab6687a.tar.gz dotfiles-e3c6aba94e7a162aa5f1b8b0a7658081cab6687a.tar.xz |
Publish contents for public/ folder
-rw-r--r-- | .build.yml | 7 | ||||
-rw-r--r-- | TODOs.org | 9 | ||||
-rw-r--r-- | bash/fake-symlinks.sh | 2 | ||||
-rw-r--r-- | default.nix | 8 | ||||
-rw-r--r-- | env.sh | 6 | ||||
-rw-r--r-- | nixos/utils.nix | 12 | ||||
l--------- | public/configuration.nix | 1 | ||||
l--------- | public/hardware-configuration.nix | 1 | ||||
-rw-r--r-- | public/install-nixos.sh | 7 |
9 files changed, 48 insertions, 5 deletions
@@ -7,7 +7,14 @@ triggers: to: EuAndreh <ci@euandre.org> sources: - https://git.sr.ht/~euandreh/dotfiles +secrets: + - 7159f943-811f-402d-bb6d-37cd764dc728 tasks: - tests: | cd dotfiles/ nix-build -A test + - docs: | + cd dotfiles/ + nix-build -A publishScript + source env.sh + ./result/bin/publish.sh @@ -7,17 +7,18 @@ Create =burn-nixos.sh= with something like: NIXOS_URL='https://releases.nixos.org/nixos/19.03/nixos-19.03.172764.50d5d73e22b/nixos-graphical-19.03.172764.50d5d73e22b-x86_64-linux.iso' burn-nixos.sh "$NIXOS_URL" /dev/sdb #+END_SOURCE -*** TODO Installation phase -**** TODO Make disk partitioning declarative -**** TODO Choose proper tool +*** DOING Installation phase +**** DOING Choose proper tool =fdisk=? =gdisk=? =gparted=? Why? Why not? +**** TODO Make disk partitioning declarative **** TODO Always use UEFI and GPT (which I think is better) **** TODO Parameterize the disk to be partitioned So I can give the installation script an argument and reuse later on the program. Something like: #+BEGIN_SOURCE shell $ wget -qO- https://euandre.org/install-nixos.sh | sh -s /dev/sda #+END_SOURCE -**** TODO Publish =install-nixos.sh= in CI run +**** DONE Publish =install-nixos.sh= in CI run +CLOSED: [2019-05-30 Thu 23:42] Add =publishScript= derivation and run it in builds.sr.ht. *** TODO Setup phase **** TODO Fix bootstrap order of installing and importing packages diff --git a/bash/fake-symlinks.sh b/bash/fake-symlinks.sh index 55ec8d4..06f1243 100644 --- a/bash/fake-symlinks.sh +++ b/bash/fake-symlinks.sh @@ -5,7 +5,7 @@ if [[ -n "$GITHUB_TOKEN" ]]; then fi -SRHT_REPOS=(website cement) +SRHT_REPOS=(website cement dotfiles) SRHT_REPOS_PATH="$HOME/dev/libre" for repo in "${SRHT_REPOS[@]}"; do diff --git a/default.nix b/default.nix index 42dc0f0..1418ecb 100644 --- a/default.nix +++ b/default.nix @@ -15,6 +15,13 @@ in rec { touch $out ''; }); + docs = utils.baseTask.overrideAttrs (baseAttrs: { + name = "${baseAttrs.name}-docs"; + buildPhase = '' + mkdir $out + cp -Lr public/* $out/ + ''; + }); }; utils = import ./nixos/utils.nix { pkgs = pkgs; @@ -27,4 +34,5 @@ in rec { (utils.fixme [ "default.nix" "utils.nix" ]) subtasks.uniqueFeeds ]; + publishScript = utils.publishScript subtasks.docs; } @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" + +export SERVER_URL=root@euandre.org +export DOCS_SERVER_PATH="/home/user-data/www/default/dotfiles/" diff --git a/nixos/utils.nix b/nixos/utils.nix index 6aea0dc..7c76882 100644 --- a/nixos/utils.nix +++ b/nixos/utils.nix @@ -70,4 +70,16 @@ in rec { touch $out ''; }); + publishScript = docsDerivation: pkgs.writeShellScriptBin "publish.sh" '' + set -euo pipefail + ${pkgs.rsync}/bin/rsync --verbose \ + --copy-links \ + --progress \ + --stats \ + --update \ + --recursive \ + --rsh="ssh -o StrictHostKeyChecking=no" \ + ${docsDerivation}/ \ + "$SERVER_URL:$DOCS_SERVER_PATH" + ''; } diff --git a/public/configuration.nix b/public/configuration.nix new file mode 120000 index 0000000..f0b535b --- /dev/null +++ b/public/configuration.nix @@ -0,0 +1 @@ +../nixos/configuration.nix
\ No newline at end of file diff --git a/public/hardware-configuration.nix b/public/hardware-configuration.nix new file mode 120000 index 0000000..6ebf69f --- /dev/null +++ b/public/hardware-configuration.nix @@ -0,0 +1 @@ +../nixos/hardware-configuration.nix
\ No newline at end of file diff --git a/public/install-nixos.sh b/public/install-nixos.sh new file mode 100644 index 0000000..fbb826e --- /dev/null +++ b/public/install-nixos.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +# download nix files before starting +# generate local nix-file: get input for hostName + +# fdisk |