latest
This commit is contained in:
1 parent
c24749e281
commit
d67dbd92d0
4 files changed
+64
-25
No files matched your search
@@ -20,6 +20,10 @@ def main [] {
|
|||||||
help main
|
help main
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def "main profiles" [] {
|
||||||
|
valid_profiles | print
|
||||||
|
}
|
||||||
|
|
||||||
# Build configuration
|
# Build configuration
|
||||||
def "main build" [] {
|
def "main build" [] {
|
||||||
nh os build | print
|
nh os build | print
|
||||||
@@ -56,10 +60,10 @@ def "main update" [input_name:string = ""] {
|
|||||||
def "main remote" [cmd:string, target:string = ""] {
|
def "main remote" [cmd:string, target:string = ""] {
|
||||||
mut target_host = $"root@($target).lab.internal"
|
mut target_host = $"root@($target).lab.internal"
|
||||||
mut profile = $"hl-($target)"
|
mut profile = $"hl-($target)"
|
||||||
if not (is-valid-profile $profile) {
|
# if not (is-valid-profile $profile) {
|
||||||
print $"Invalid Profile ($profile), please select one of:"
|
# print $"Invalid Profile ($profile), please select one of:"
|
||||||
return valid_profiles
|
# return valid_profiles
|
||||||
}
|
# }
|
||||||
$"Using [($profile)]" | print
|
$"Using [($profile)]" | print
|
||||||
const valid_cmds = [
|
const valid_cmds = [
|
||||||
"test" , "dry-activate" , "run" , "switch" , "build"
|
"test" , "dry-activate" , "run" , "switch" , "build"
|
||||||
@@ -69,7 +73,7 @@ def "main remote" [cmd:string, target:string = ""] {
|
|||||||
return $valid_cmds
|
return $valid_cmds
|
||||||
}
|
}
|
||||||
$"($cmd) on ($target_host) with ($profile)" | print
|
$"($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
|
$runcmd | print
|
||||||
bash -c $runcmd
|
bash -c $runcmd
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-5
@@ -2,7 +2,11 @@
|
|||||||
let
|
let
|
||||||
ports = {
|
ports = {
|
||||||
nixServe = 5000;
|
nixServe = 5000;
|
||||||
|
lockdPort = 4001;
|
||||||
|
mountdPort = 4002;
|
||||||
|
statdPort = 4000;
|
||||||
};
|
};
|
||||||
|
openPorts = builtins.attrValues ports;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
skyg = {
|
skyg = {
|
||||||
@@ -16,11 +20,23 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services.nix-serve = {
|
# services.nix-serve = {
|
||||||
enable = true;
|
# enable = true;
|
||||||
secretKeyFile = "/home/ari/cache-keys/bigbox2.lab.internal.private";
|
# secretKeyFile = "/home/ari/cache-keys/bigbox2.lab.internal.private";
|
||||||
port = ports.nixServe;
|
# port = ports.nixServe;
|
||||||
};
|
# };
|
||||||
# firmware updater
|
# firmware updater
|
||||||
services.fwupd.enable = true;
|
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
@@ -1,6 +1,6 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
let
|
let
|
||||||
openPorts = [
|
openPorts = [
|
||||||
# nfs
|
# nfs
|
||||||
111
|
111
|
||||||
2049
|
2049
|
||||||
|
|||||||
+33
-14
@@ -4,19 +4,38 @@
|
|||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.skyg.networkDrives;
|
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
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
skyg.networkDrives = {
|
skyg.networkDrives = {
|
||||||
enable = lib.mkEnableOption
|
enable = lib.mkEnableOption
|
||||||
"Network Drives";
|
"Network Drives";
|
||||||
tnasHost = lib.mkOption {
|
tnas1 = makeCommonOption {
|
||||||
type = lib.types.str;
|
defaultHost = "tnas1.lab.internal";
|
||||||
default = "tnas1.lab.internal";
|
|
||||||
};
|
};
|
||||||
terraHost = lib.mkOption {
|
terra1 = makeCommonOption {
|
||||||
type = lib.types.str;
|
defaultHost = "terra1.lab.internal";
|
||||||
default = "terra1.lab.internal";
|
};
|
||||||
|
bigBox2 = makeCommonOption {
|
||||||
|
defaultHost = "bigbox2.lab.internal";
|
||||||
};
|
};
|
||||||
options = lib.mkOption {
|
options = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
@@ -30,26 +49,26 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
fileSystems."/torrents" = {
|
fileSystems."/torrents" = lib.mkIf cfg.tnas1.enabled {
|
||||||
device = "${cfg.tnasHost}:/mnt/EightTerra/DownloadedTorrents";
|
device = "${cfg.tnas1.host}:/mnt/EightTerra/DownloadedTorrents";
|
||||||
fsType = "nfs";
|
fsType = "nfs";
|
||||||
options = cfg.options;
|
options = cfg.options;
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/mnt/EightTerra/k3s-cluster" = {
|
fileSystems."/mnt/EightTerra/k3s-cluster" = lib.mkIf cfg.tnas1.enabled {
|
||||||
device = "${cfg.tnasHost}:/mnt/EightTerra/k3s-cluster";
|
device = "${cfg.tnas1.host}:/mnt/EightTerra/k3s-cluster";
|
||||||
fsType = "nfs";
|
fsType = "nfs";
|
||||||
options = cfg.options;
|
options = cfg.options;
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/mnt/OneT/NVR" = {
|
fileSystems."/mnt/OneT/NVR" = lib.mkIf cfg.tnas1.enabled {
|
||||||
device = "${cfg.tnasHost}:/mnt/OneT/NVR";
|
device = "${cfg.tnas1.host}:/mnt/OneT/NVR";
|
||||||
fsType = "nfs";
|
fsType = "nfs";
|
||||||
options = cfg.options;
|
options = cfg.options;
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/mnt/terra1/Data/apps" = {
|
fileSystems."/mnt/terra1/Data/apps" = lib.mkIf cfg.terra1.enabled {
|
||||||
device = "${cfg.terraHost}:/mnt/Data/apps";
|
device = "${cfg.terra1.host}:/mnt/Data/apps";
|
||||||
fsType = "nfs";
|
fsType = "nfs";
|
||||||
options = cfg.options;
|
options = cfg.options;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user