Compare commits
13 Commits
168d45ed8a
...
better-wor
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52824e39ee | ||
|
|
8793120436 | ||
|
|
950ada1e10 | ||
|
|
1e269966ff | ||
|
|
3861daaf76 | ||
|
|
3a332e77d1 | ||
|
|
79c311b45d | ||
|
|
850070f987 | ||
|
|
d242562544 | ||
| d8d910f5fd | |||
| a4f6b77e30 | |||
| 6aa6f2e171 | |||
| d9bb933891 |
@@ -1,9 +1,8 @@
|
||||
name: "Evaluate Hydra Jobs"
|
||||
name: "Check flake syntax"
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
jobs:
|
||||
eval-hydra-jobs:
|
||||
flake-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -11,5 +10,5 @@ jobs:
|
||||
run: |
|
||||
apt update -y
|
||||
apt install sudo -y
|
||||
- uses: cachix/install-nix-action@v27
|
||||
- run: nix eval --no-update-lock-file --accept-flake-config .\#hydraJobs
|
||||
- uses: cachix/install-nix-action@v30
|
||||
- run: nix flake check --no-update-lock-file --accept-flake-config .
|
||||
@@ -3,6 +3,7 @@
|
||||
, nixpkgs
|
||||
, sops-nix
|
||||
, inputs
|
||||
, microvm
|
||||
, nixos-hardware
|
||||
, home-manager
|
||||
, ...
|
||||
@@ -34,15 +35,14 @@ let
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
sops-nix.nixosModules.sops
|
||||
microvm.nixosModules.microvm
|
||||
];
|
||||
}
|
||||
];
|
||||
defaultModules = baseModules;
|
||||
|
||||
makeMicroVM = hostName: ipv4Addr: macAddr: modules: [
|
||||
inputs.microvm.nixosModules.microvm
|
||||
{
|
||||
microvm = {
|
||||
hypervisor = "cloud-hypervisor";
|
||||
@@ -114,6 +114,15 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
lucia = nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
specialArgs.inputs = inputs;
|
||||
modules = defaultModules ++ [
|
||||
./lucia/configuration.nix
|
||||
./lucia/hardware_configuration.nix
|
||||
];
|
||||
};
|
||||
|
||||
fanny = nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs.inputs = inputsMod;
|
||||
@@ -152,12 +161,12 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
lucia = nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
uptimekuma = nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs.inputs = inputs;
|
||||
modules = defaultModules ++ [
|
||||
./lucia/configuration.nix
|
||||
./lucia/hardware_configuration.nix
|
||||
specialArgs.self = self;
|
||||
modules = makeMicroVM "uptimekuma" "10.0.0.12" "D0:E5:CA:F0:D7:E8" [
|
||||
./uptimekuma/configuration.nix
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
@@ -43,6 +43,16 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."status.malobeo.org" = {
|
||||
forceSSL = true;
|
||||
enableACME= true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://10.0.0.12";
|
||||
extraConfig = ''
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."tasklist.malobeo.org" = {
|
||||
forceSSL = true;
|
||||
enableACME= true;
|
||||
|
||||
@@ -55,7 +55,6 @@ in
|
||||
services.malobeo.microvm.enableHostBridge = true;
|
||||
services.malobeo.microvm.deployHosts = [ "infradocs" ];
|
||||
|
||||
|
||||
networking = {
|
||||
firewall = {
|
||||
allowedTCPPorts = [ 80 ];
|
||||
|
||||
37
machines/uptimekuma/configuration.nix
Normal file
37
machines/uptimekuma/configuration.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
networking = {
|
||||
hostName = mkDefault "uptimekuma";
|
||||
useDHCP = false;
|
||||
nameservers = [ "1.1.1.1" ];
|
||||
};
|
||||
|
||||
imports = [
|
||||
../modules/malobeo_user.nix
|
||||
../modules/sshd.nix
|
||||
];
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 80 ];
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts."status.malobeo.org" = {
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:3001";
|
||||
extraConfig = ''
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
services.uptime-kuma = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
system.stateVersion = "22.11"; # Did you read the comment?
|
||||
}
|
||||
|
||||
10
outputs.nix
10
outputs.nix
@@ -20,6 +20,7 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
|
||||
let
|
||||
sops = sops-nix.packages."${pkgs.system}";
|
||||
microvmpkg = microvm.packages."${pkgs.system}";
|
||||
installed = builtins.attrNames self.legacyPackages."${pkgs.system}".scripts;
|
||||
in
|
||||
pkgs.mkShell {
|
||||
sopsPGPKeyDirs = [
|
||||
@@ -37,11 +38,14 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
|
||||
pkgs.mdbook
|
||||
microvmpkg.microvm
|
||||
];
|
||||
packages = builtins.map (pkgName: self.legacyPackages."${pkgs.system}".scripts.${pkgName}) installed;
|
||||
shellHook = ''echo "Available scripts: ${builtins.concatStringsSep " " installed}"'';
|
||||
};
|
||||
legacyPackages = {
|
||||
scripts.remote-install = pkgs.writeShellScriptBin "remote-install" (builtins.readFile ./scripts/remote-install-encrypt.sh);
|
||||
scripts.boot-unlock = pkgs.writeShellScriptBin "boot-unlock" (builtins.readFile ./scripts/unlock-boot.sh);
|
||||
};
|
||||
|
||||
packages = {
|
||||
remote-install = pkgs.writeShellScriptBin "remote-install" (builtins.readFile ./scripts/remote-install-encrypt.sh);
|
||||
boot-unlock = pkgs.writeShellScriptBin "boot-unlock" (builtins.readFile ./scripts/unlock-boot.sh);
|
||||
docs = pkgs.stdenv.mkDerivation {
|
||||
name = "malobeo-docs";
|
||||
phases = [ "buildPhase" ];
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
@@ -9,6 +8,21 @@ if [ $# -lt 2 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -e flake.nix ]
|
||||
then
|
||||
echo "flake.nix not found. Searching down."
|
||||
while [ ! -e flake.nix ]
|
||||
do
|
||||
if [ $PWD = "/" ]
|
||||
then
|
||||
echo "Found root. Aborting."
|
||||
exit 1
|
||||
else
|
||||
cd ..
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
hostname=$1
|
||||
ipaddress=$2
|
||||
|
||||
|
||||
@@ -4,19 +4,33 @@ set -o pipefail
|
||||
sshoptions="-o StrictHostKeyChecking=no -o ServerAliveInterval=1 -o ServerAliveCountMax=1 -p 222 -T"
|
||||
HOSTNAME=$1
|
||||
|
||||
echo
|
||||
diskkey=$(sops -d machines/$HOSTNAME/disk.key)
|
||||
if [ ! -e flake.nix ]
|
||||
then
|
||||
echo "flake.nix not found. Searching down."
|
||||
while [ ! -e flake.nix ]
|
||||
do
|
||||
if [ $PWD = "/" ]
|
||||
then
|
||||
echo "Found root. Aborting."
|
||||
exit 1
|
||||
else
|
||||
cd ..
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
echo
|
||||
if [ $# = 1 ]
|
||||
then
|
||||
diskkey=$(sops -d machines/$HOSTNAME/disk.key)
|
||||
echo "$diskkey" | ssh $sshoptions root@$HOSTNAME-initrd "systemd-tty-ask-password-agent" #storage
|
||||
|
||||
echo "$diskkey" | ssh $sshoptions root@$HOSTNAME-initrd "systemd-tty-ask-password-agent" #root
|
||||
|
||||
elif [ $# = 2 ]
|
||||
then
|
||||
diskkey=$(sops -d machines/$HOSTNAME/disk.key)
|
||||
IP=$2
|
||||
|
||||
echo "$diskkey" | ssh $sshoptions root@$IP "systemd-tty-ask-password-agent" #storage
|
||||
|
||||
echo "$diskkey" | ssh $sshoptions root@$IP "systemd-tty-ask-password-agent" #root
|
||||
|
||||
Reference in New Issue
Block a user