This commit is contained in:
ari committed 2026-03-21 22:26:09 -04:00
1 parent c24749e281
commit d67dbd92d0
4 files changed
+64 -25

No files matched your search

+9 -5
View File
@@ -20,6 +20,10 @@ def main [] {
help main
}
def "main profiles" [] {
valid_profiles | print
}
# Build configuration
def "main build" [] {
nh os build | print
@@ -56,10 +60,10 @@ def "main update" [input_name:string = ""] {
def "main remote" [cmd:string, target:string = ""] {
mut target_host = $"root@($target).lab.internal"
mut profile = $"hl-($target)"
if not (is-valid-profile $profile) {
print $"Invalid Profile ($profile), please select one of:"
return valid_profiles
}
# if not (is-valid-profile $profile) {
# print $"Invalid Profile ($profile), please select one of:"
# return valid_profiles
# }
$"Using [($profile)]" | print
const valid_cmds = [
"test" , "dry-activate" , "run" , "switch" , "build"
@@ -69,7 +73,7 @@ def "main remote" [cmd:string, target:string = ""] {
return $valid_cmds
}
$"($cmd) on ($target_host) with ($profile)" | print
mut runcmd = $"nixos-rebuild ($cmd) --target-host ($target_host) --use-remote-sudo --flake .#($profile)"
mut runcmd = $"nixos-rebuild ($cmd) --target-host ($target_host) --sudo --flake .#($profile)"
$runcmd | print
bash -c $runcmd
}
+21 -5
View File
@@ -2,7 +2,11 @@
let
ports = {
nixServe = 5000;
lockdPort = 4001;
mountdPort = 4002;
statdPort = 4000;
};
openPorts = builtins.attrValues ports;
in
{
skyg = {
@@ -16,11 +20,23 @@ in
enable = true;
};
};
services.nix-serve = {
enable = true;
secretKeyFile = "/home/ari/cache-keys/bigbox2.lab.internal.private";
port = ports.nixServe;
};
# services.nix-serve = {
# enable = true;
# secretKeyFile = "/home/ari/cache-keys/bigbox2.lab.internal.private";
# port = ports.nixServe;
# };
# firmware updater
services.fwupd.enable = true;
services.nfs.server = {
enable = true;
lockdPort = ports.lockdPort;
mountdPort = ports.mountdPort;
statdPort = ports.statdPort;
extraNfsdConfig = '''';
exports = ''
/data/fourTerra 10.0.0.0/16(rw,wdelay,insecure,no_root_squash,no_subtree_check,sec=sys,rw,insecure,no_root_squash,no_all_squash)
'';
};
networking.firewall.allowedUDPPorts = openPorts;
networking.firewall.allowedTCPPorts = openPorts;
}
+1 -1
View File
@@ -1,6 +1,6 @@
{ pkgs, ... }:
let
openPorts = [
openPorts = [
# nfs
111
2049
+33 -14
View File
@@ -4,19 +4,38 @@
}:
let
cfg = config.skyg.networkDrives;
makeCommonOption = {defaultHost, enabledByDefault ? true} : lib.mkOption {
type = lib.types.submodule {
options = {
enabled = lib.mkOption {
type = lib.types.bool;
default = enabledByDefault;
};
host = lib.mkOption {
type = lib.types.str;
default = defaultHost;
};
};
};
default = {
enabled = enabledByDefault;
host = defaultHost;
};
};
in
{
options = {
skyg.networkDrives = {
enable = lib.mkEnableOption
"Network Drives";
tnasHost = lib.mkOption {
type = lib.types.str;
default = "tnas1.lab.internal";
tnas1 = makeCommonOption {
defaultHost = "tnas1.lab.internal";
};
terraHost = lib.mkOption {
type = lib.types.str;
default = "terra1.lab.internal";
terra1 = makeCommonOption {
defaultHost = "terra1.lab.internal";
};
bigBox2 = makeCommonOption {
defaultHost = "bigbox2.lab.internal";
};
options = lib.mkOption {
type = lib.types.listOf lib.types.str;
@@ -30,26 +49,26 @@ in
};
};
config = lib.mkIf cfg.enable {
fileSystems."/torrents" = {
device = "${cfg.tnasHost}:/mnt/EightTerra/DownloadedTorrents";
fileSystems."/torrents" = lib.mkIf cfg.tnas1.enabled {
device = "${cfg.tnas1.host}:/mnt/EightTerra/DownloadedTorrents";
fsType = "nfs";
options = cfg.options;
};
fileSystems."/mnt/EightTerra/k3s-cluster" = {
device = "${cfg.tnasHost}:/mnt/EightTerra/k3s-cluster";
fileSystems."/mnt/EightTerra/k3s-cluster" = lib.mkIf cfg.tnas1.enabled {
device = "${cfg.tnas1.host}:/mnt/EightTerra/k3s-cluster";
fsType = "nfs";
options = cfg.options;
};
fileSystems."/mnt/OneT/NVR" = {
device = "${cfg.tnasHost}:/mnt/OneT/NVR";
fileSystems."/mnt/OneT/NVR" = lib.mkIf cfg.tnas1.enabled {
device = "${cfg.tnas1.host}:/mnt/OneT/NVR";
fsType = "nfs";
options = cfg.options;
};
fileSystems."/mnt/terra1/Data/apps" = {
device = "${cfg.terraHost}:/mnt/Data/apps";
fileSystems."/mnt/terra1/Data/apps" = lib.mkIf cfg.terra1.enabled {
device = "${cfg.terra1.host}:/mnt/Data/apps";
fsType = "nfs";
options = cfg.options;
};