Skip to content

Commit

Permalink
make it boot into the actual thing
Browse files Browse the repository at this point in the history
  • Loading branch information
fkz committed Sep 21, 2023
1 parent c057d1d commit 9b3a8fd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ jobs:
steps:
- uses: 3bit/setup-hcloud@v2
- run: |
echo '#cloud-config' > user-data.txt
echo 'runcmd:' >> user-data.txt
echo ' - curl https://raw.githubusercontent.com/XertDev/nixos-infect/stable/nixos-infect | PROVIDER=hetznercloud NIX_CHANNEL=nixos-22.05 bash -x 2>&1 | tee /tmp/infect.log' >> user-data.txt
echo ' - cd /etc/nixos/ && curl "https://github.com/potsdam-pnp/runner/archive/refs/heads/main.tar.gz" | tar zxvf - --strip 1' >> user-data.txt
curl https://raw.githubusercontent.com/potsdam-pnp/runner/main/.github/workflows/user-data.txt > user-data.txt
hcloud server create \
--image ubuntu-22.04 \
--name runner \
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/user-data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#cloud-config
write_files:
path: /etc/nixos/extra.nix
content: |
{
systemd.services.rebuildToActualNix = {
wantedBy = ["multi-user.target"];
script = ''
cd /etc/nixos/ && curl "https://github.com/potsdam-pnp/runner/archive/refs/heads/main.tar.gz" | tar zxvf - --strip 1
nixos-rebuild switch --flake /etc/nixosgi
'';
};
}
runcmd:
- curl https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | NIXOS_IMPORT=./extra.nix PROVIDER=hetznercloud NIX_CHANNEL=nixos-22.05 bash -x 2>&1 | tee /tmp/infect.log

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";

outputs = {self, nixpkgs }: {
nixosConfigurations.potsdam-pnp = nixpkgs.lib.nixosSystem {
nixosConfigurations.runner = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";

modules = [ ./networking.nix ./hardware-configuration.nix ./runner.nix ];
Expand Down

0 comments on commit 9b3a8fd

Please sign in to comment.