Compare commits
6 Commits
168d45ed8a
...
issue51
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
850070f987 | ||
|
|
d242562544 | ||
| d8d910f5fd | |||
| a4f6b77e30 | |||
| 6aa6f2e171 | |||
| d9bb933891 |
@@ -114,6 +114,15 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
lucia = nixosSystem {
|
||||||
|
system = "aarch64-linux";
|
||||||
|
specialArgs.inputs = inputs;
|
||||||
|
modules = defaultModules ++ [
|
||||||
|
./lucia/configuration.nix
|
||||||
|
./lucia/hardware_configuration.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
fanny = nixosSystem {
|
fanny = nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs.inputs = inputsMod;
|
specialArgs.inputs = inputsMod;
|
||||||
@@ -152,12 +161,12 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
lucia = nixosSystem {
|
uptimekuma = nixosSystem {
|
||||||
system = "aarch64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs.inputs = inputs;
|
specialArgs.inputs = inputs;
|
||||||
modules = defaultModules ++ [
|
specialArgs.self = self;
|
||||||
./lucia/configuration.nix
|
modules = makeMicroVM "uptimekuma" "10.0.0.12" "D0:E5:CA:F0:D7:E8" [
|
||||||
./lucia/hardware_configuration.nix
|
./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" = {
|
services.nginx.virtualHosts."tasklist.malobeo.org" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME= true;
|
enableACME= true;
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ in
|
|||||||
services.malobeo.microvm.enableHostBridge = true;
|
services.malobeo.microvm.enableHostBridge = true;
|
||||||
services.malobeo.microvm.deployHosts = [ "infradocs" ];
|
services.malobeo.microvm.deployHosts = [ "infradocs" ];
|
||||||
|
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
firewall = {
|
firewall = {
|
||||||
allowedTCPPorts = [ 80 ];
|
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?
|
||||||
|
}
|
||||||
|
|
||||||
@@ -20,6 +20,7 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
|
|||||||
let
|
let
|
||||||
sops = sops-nix.packages."${pkgs.system}";
|
sops = sops-nix.packages."${pkgs.system}";
|
||||||
microvmpkg = microvm.packages."${pkgs.system}";
|
microvmpkg = microvm.packages."${pkgs.system}";
|
||||||
|
installed = builtins.attrNames self.packages."${pkgs.system}".scripts;
|
||||||
in
|
in
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
sopsPGPKeyDirs = [
|
sopsPGPKeyDirs = [
|
||||||
@@ -37,11 +38,13 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
|
|||||||
pkgs.mdbook
|
pkgs.mdbook
|
||||||
microvmpkg.microvm
|
microvmpkg.microvm
|
||||||
];
|
];
|
||||||
|
packages = builtins.map (pkgName: self.packages."${pkgs.system}".scripts.${pkgName}) installed;
|
||||||
|
shellHook = ''echo "Available scripts: ${builtins.concatStringsSep " " installed}"'';
|
||||||
};
|
};
|
||||||
|
|
||||||
packages = {
|
packages = {
|
||||||
remote-install = pkgs.writeShellScriptBin "remote-install" (builtins.readFile ./scripts/remote-install-encrypt.sh);
|
scripts.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);
|
scripts.boot-unlock = pkgs.writeShellScriptBin "boot-unlock" (builtins.readFile ./scripts/unlock-boot.sh);
|
||||||
docs = pkgs.stdenv.mkDerivation {
|
docs = pkgs.stdenv.mkDerivation {
|
||||||
name = "malobeo-docs";
|
name = "malobeo-docs";
|
||||||
phases = [ "buildPhase" ];
|
phases = [ "buildPhase" ];
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
set -o errexit
|
set -o errexit
|
||||||
set -o nounset
|
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
if [ $# -lt 2 ]; then
|
if [ $# -lt 2 ]; then
|
||||||
@@ -9,6 +8,21 @@ if [ $# -lt 2 ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
hostname=$1
|
||||||
ipaddress=$2
|
ipaddress=$2
|
||||||
|
|
||||||
|
|||||||
@@ -4,19 +4,33 @@ set -o pipefail
|
|||||||
sshoptions="-o StrictHostKeyChecking=no -o ServerAliveInterval=1 -o ServerAliveCountMax=1 -p 222 -T"
|
sshoptions="-o StrictHostKeyChecking=no -o ServerAliveInterval=1 -o ServerAliveCountMax=1 -p 222 -T"
|
||||||
HOSTNAME=$1
|
HOSTNAME=$1
|
||||||
|
|
||||||
echo
|
if [ ! -e flake.nix ]
|
||||||
diskkey=$(sops -d machines/$HOSTNAME/disk.key)
|
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 ]
|
if [ $# = 1 ]
|
||||||
then
|
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" #storage
|
||||||
|
|
||||||
echo "$diskkey" | ssh $sshoptions root@$HOSTNAME-initrd "systemd-tty-ask-password-agent" #root
|
echo "$diskkey" | ssh $sshoptions root@$HOSTNAME-initrd "systemd-tty-ask-password-agent" #root
|
||||||
|
|
||||||
elif [ $# = 2 ]
|
elif [ $# = 2 ]
|
||||||
then
|
then
|
||||||
|
diskkey=$(sops -d machines/$HOSTNAME/disk.key)
|
||||||
IP=$2
|
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" #storage
|
||||||
|
|
||||||
echo "$diskkey" | ssh $sshoptions root@$IP "systemd-tty-ask-password-agent" #root
|
echo "$diskkey" | ssh $sshoptions root@$IP "systemd-tty-ask-password-agent" #root
|
||||||
|
|||||||
Reference in New Issue
Block a user