Completely reformat to satisfy nixfmt

This commit is contained in:
Greg Hellings
2024-10-19 01:20:46 -05:00
parent 7abb613f20
commit a71eb7485a
56 changed files with 1749 additions and 1393 deletions
+13 -9
View File
@@ -1,10 +1,11 @@
{ {
fsid = "749bf0ea-acf5-4a5e-b33e-9a057455c06b"; fsid = "749bf0ea-acf5-4a5e-b33e-9a057455c06b";
clusterName = "home"; clusterName = "home";
initialMonitors = [{ initialMonitors = [
hostname = "myself.thehellings.lan"; {
ipAddress = "10.42.1.6"; hostname = "myself.thehellings.lan";
} ipAddress = "10.42.1.6";
}
{ {
hostname = "jeremiah.thehellings.lan"; hostname = "jeremiah.thehellings.lan";
ipAddress = "10.42.1.8"; ipAddress = "10.42.1.8";
@@ -12,11 +13,14 @@
{ {
hostname = "hosea.thehellings.lan"; hostname = "hosea.thehellings.lan";
ipAddress = "10.42.1.7"; ipAddress = "10.42.1.7";
}]; }
mdsNodes = [{ ];
hostname = "jeremiah.thehellings.lan"; mdsNodes = [
ipAddress = "10.42.1.8"; {
}]; hostname = "jeremiah.thehellings.lan";
ipAddress = "10.42.1.8";
}
];
publicNetworks = [ "10.42.0.0/16" ]; publicNetworks = [ "10.42.0.0/16" ];
clusterNetworks = [ "10.201.0.0/16" ]; clusterNetworks = [ "10.201.0.0/16" ];
adminKeyring = ../secrets/home.client.admin.keyring; adminKeyring = ../secrets/home.client.admin.keyring;
+23 -17
View File
@@ -1,31 +1,37 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "uas" "sd_mod" ]; boot.initrd.availableKernelModules = [
"xhci_pci"
"thunderbolt"
"nvme"
"uas"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/607b933f-2967-4652-b478-4d8e9aa38a0d";
device = "/dev/disk/by-uuid/607b933f-2967-4652-b478-4d8e9aa38a0d"; fsType = "btrfs";
fsType = "btrfs"; options = [ "subvol=@" ];
options = [ "subvol=@" ]; };
};
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/B31C-C1F4";
device = "/dev/disk/by-uuid/B31C-C1F4"; fsType = "vfat";
fsType = "vfat"; };
};
swapDevices = [ ]; swapDevices = [ ];
+7 -9
View File
@@ -1,8 +1,9 @@
{ pkgs {
, lib pkgs,
, host ? "most" lib,
, nixvim host ? "most",
, ... nixvim,
...
}: }:
{ {
@@ -12,15 +13,12 @@
./modules ./modules
] ++ lib.optionals (builtins.pathExists ./hosts/${host}) [ ./hosts/${host} ]; ] ++ lib.optionals (builtins.pathExists ./hosts/${host}) [ ./hosts/${host} ];
programs.tmux = { programs.tmux = {
enable = true; enable = true;
keyMode = "vi"; keyMode = "vi";
terminal = "xterm-256color"; terminal = "xterm-256color";
customPaneNavigationAndResize = true; customPaneNavigationAndResize = true;
extraConfig = (lib.strings.concatStringsSep "\n" [ extraConfig = (lib.strings.concatStringsSep "\n" [ "bind P paste-buffer" ]);
"bind P paste-buffer"
]);
}; };
home.stateVersion = "23.05"; home.stateVersion = "23.05";
+2 -1
View File
@@ -1,3 +1,4 @@
{ ... }: { ... }:
{ } {
}
+1 -3
View File
@@ -3,7 +3,5 @@
{ {
greg.vscodium.enable = true; greg.vscodium.enable = true;
home.packages = with pkgs; [ home.packages = with pkgs; [ brew ];
brew
];
} }
+11 -6
View File
@@ -15,16 +15,18 @@
matchBlocks = matchBlocks =
let let
nas = { user = "admin"; }; nas = {
owned = { user = "greg"; }; user = "admin";
};
owned = {
user = "greg";
};
in in
{ {
inherit nas; inherit nas;
"*" = { "*" = {
dynamicForwards = [{ dynamicForwards = [ { port = 10240; } ];
port = 10240;
}];
}; };
"10.42.1.4" = lib.hm.dag.entryBefore [ "10.42.*" ] nas; "10.42.1.4" = lib.hm.dag.entryBefore [ "10.42.*" ] nas;
@@ -33,7 +35,10 @@
chronicles = nas; chronicles = nas;
"chronicles.thehellings.lan" = lib.hm.dag.entryBefore [ "*.thehellings.lan" ] nas; "chronicles.thehellings.lan" = lib.hm.dag.entryBefore [ "*.thehellings.lan" ] nas;
gh = { user = "git"; hostname = "github.com"; }; gh = {
user = "git";
hostname = "github.com";
};
"src" = { "src" = {
user = "gitlab"; user = "gitlab";
hostname = "git.thehellings.lan"; hostname = "git.thehellings.lan";
+9 -2
View File
@@ -1,9 +1,16 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
{ {
# The Hack font is used in the Fugitive sidebars # The Hack font is used in the Fugitive sidebars
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
home.packages = [ (pkgs.nerdfonts.override { fonts = [ "Hack" ]; }) ]; home.packages = [ (pkgs.nerdfonts.override { fonts = [ "Hack" ]; }) ];
programs.nixvim = (import ./vim/config.nix { inherit config pkgs lib; }) // { enable = true; }; programs.nixvim = (import ./vim/config.nix { inherit config pkgs lib; }) // {
enable = true;
};
} }
+6 -4
View File
@@ -67,9 +67,11 @@
}; };
configHeader = builtins.readFile ./xonsh_header.xsh; configHeader = builtins.readFile ./xonsh_header.xsh;
configFooter = (builtins.readFile ./xonsh_footer.xsh) + (builtins.concatStringsSep "\n" [ configFooter =
"with open('${pkgs.stdenv.cc}/nix-support/dynamic-linker', 'r') as fp:" (builtins.readFile ./xonsh_footer.xsh)
" $NIX_LD = fp.read().strip()" + (builtins.concatStringsSep "\n" [
]); "with open('${pkgs.stdenv.cc}/nix-support/dynamic-linker', 'r') as fp:"
" $NIX_LD = fp.read().strip()"
]);
}; };
} }
+9 -5
View File
@@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
packages = with pkgs; [ packages = with pkgs; [
bruno # but let's not talk about it bruno # but let's not talk about it
@@ -16,10 +21,9 @@ let
zed-editor zed-editor
]; ];
in in
with lib; { with lib;
{
options.greg.development = mkEnableOption "Setup necessary development packages"; options.greg.development = mkEnableOption "Setup necessary development packages";
config = mkIf config.greg.development { config = mkIf config.greg.development { home.packages = packages; };
home.packages = packages;
};
} }
+122 -109
View File
@@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.greg.gnome; cfg = config.greg.gnome;
@@ -6,115 +11,123 @@ in
{ {
options.greg.gnome = lib.mkEnableOption "Enable Gnome support and settings"; options.greg.gnome = lib.mkEnableOption "Enable Gnome support and settings";
config = (lib.mkIf cfg { config = (
programs.gnome-terminal = lib.mkIf (pkgs.system != "x86_64-darwin") { lib.mkIf cfg {
enable = true; programs.gnome-terminal = lib.mkIf (pkgs.system != "x86_64-darwin") {
showMenubar = true; enable = true;
themeVariant = "dark"; showMenubar = true;
profile."95f3c68e-82f3-4f44-ac85-6e075fed80b0" = { themeVariant = "dark";
default = true; profile."95f3c68e-82f3-4f44-ac85-6e075fed80b0" = {
customCommand = "xonsh -st best"; default = true;
loginShell = true; customCommand = "xonsh -st best";
scrollbackLines = 65535; loginShell = true;
transparencyPercent = 50; scrollbackLines = 65535;
visibleName = "greg"; transparencyPercent = 50;
visibleName = "greg";
};
}; };
};
dconf.settings = { dconf.settings = {
"org/gnome/Disks" = { "org/gnome/Disks" = {
image-dir-uri = "file:///home/greg/Downloads"; image-dir-uri = "file:///home/greg/Downloads";
};
"org/gnome/desktop/interface" = {
clock-show-weekday = true;
color-scheme = "default";
cursor-size = 24;
toolbar-style = "text";
};
"org/gnome/desktop/screensaver" = {
lock-delay = "uint32 0";
lock-enabled = false;
};
"org/gnome/desktop/wm/keybindings" = {
switch-applications = [ ];
switch-applications-backward = [ ];
switch-windows = [ "<Alt>Tab" ];
switch-windows-backward = [ "<Shift><Alt>Tab" ];
};
"org/gnome/desktop/wm/preferences" = {
button-layout = "icon:minimize,maximize,close";
};
"org/gnome/file-roller/listing" = {
list-mode = "as-folder";
name-coloumn-width = 302;
show-path = true;
sort-method = "name";
sort-type = "ascending";
};
"org/gnome/nautilus/preferences" = {
default-folder-viewer = "icon-view";
search-filter-time-type = "last_modified";
search-view = "list-view";
};
"org/gnome/shell" = {
enabled-extensions = [
"appindicatorsupport@rgcjonas.gmail.com"
"Vitals@CoreCoding.com"
"window-list@gnome-shell-extensions.gcampax.github.com"
"gsconnect@andyholmes.github.io"
];
favorite-apps = [
"org.gnome.Calendar.desktop"
"org.gnome.Nautilus.desktop"
"org.gnome.Terminal.desktop"
"firefox.desktop"
"vlc.desktop"
];
remember-mount-password = true;
};
"org/gnome/shell/extensions/vitals" = {
hot-sensors = [
"_memory_usage_"
"_system_load_1m_"
"__network-rx_max__"
"_temperature_k10temp_tccd1_"
"_temperature_k10temp_tctl_"
];
};
"org/gnome/shell/overrides" = {
attach-modal-dialogs = true;
dynamic-workspaces = true;
edge-tiling = true;
focus-change-on-pointer-rest = true;
workspaces-only-on-primary = true;
};
"org/gnome/shell/weather" = {
automation-location = true;
locations = "[<(uint32 2, <('Midlothian / Waxahachie, Mid-Way Regional Airport', 'KJWY', false, [(0.5664611473274288, -1.691437359323684)], @a(dd) [])>)>]";
};
"org/gnome/shell/window-switcher" = {
app-icon-mode = "both";
current-workspace-only = true;
};
"org/gtk/settings/file-chooser" = {
location-mode = "path-bar";
show-hidden = false;
show-size-column = true;
sort-column = "modified";
sort-directories-first = false;
sort-order = "descending";
};
"org/virt-manager/virt-manager/confirm" = {
delete-storage = true;
forcepoweroff = false;
};
"org/virt-manager/virt-manager/details" = {
show-toolbar = true;
};
"org/virt-manager/virt-manager/connections" = {
autoconnect = [
"qemu:///session"
"qemu:///system"
];
uris = [
"qemu:///session"
"qemu:///system"
];
};
}; };
"org/gnome/desktop/interface" = { }
clock-show-weekday = true; );
color-scheme = "default";
cursor-size = 24;
toolbar-style = "text";
};
"org/gnome/desktop/screensaver" = {
lock-delay = "uint32 0";
lock-enabled = false;
};
"org/gnome/desktop/wm/keybindings" = {
switch-applications = [ ];
switch-applications-backward = [ ];
switch-windows = [ "<Alt>Tab" ];
switch-windows-backward = [ "<Shift><Alt>Tab" ];
};
"org/gnome/desktop/wm/preferences" = {
button-layout = "icon:minimize,maximize,close";
};
"org/gnome/file-roller/listing" = {
list-mode = "as-folder";
name-coloumn-width = 302;
show-path = true;
sort-method = "name";
sort-type = "ascending";
};
"org/gnome/nautilus/preferences" = {
default-folder-viewer = "icon-view";
search-filter-time-type = "last_modified";
search-view = "list-view";
};
"org/gnome/shell" = {
enabled-extensions = [
"appindicatorsupport@rgcjonas.gmail.com"
"Vitals@CoreCoding.com"
"window-list@gnome-shell-extensions.gcampax.github.com"
"gsconnect@andyholmes.github.io"
];
favorite-apps = [
"org.gnome.Calendar.desktop"
"org.gnome.Nautilus.desktop"
"org.gnome.Terminal.desktop"
"firefox.desktop"
"vlc.desktop"
];
remember-mount-password = true;
};
"org/gnome/shell/extensions/vitals" = {
hot-sensors = [
"_memory_usage_"
"_system_load_1m_"
"__network-rx_max__"
"_temperature_k10temp_tccd1_"
"_temperature_k10temp_tctl_"
];
};
"org/gnome/shell/overrides" = {
attach-modal-dialogs = true;
dynamic-workspaces = true;
edge-tiling = true;
focus-change-on-pointer-rest = true;
workspaces-only-on-primary = true;
};
"org/gnome/shell/weather" = {
automation-location = true;
locations = "[<(uint32 2, <('Midlothian / Waxahachie, Mid-Way Regional Airport', 'KJWY', false, [(0.5664611473274288, -1.691437359323684)], @a(dd) [])>)>]";
};
"org/gnome/shell/window-switcher" = {
app-icon-mode = "both";
current-workspace-only = true;
};
"org/gtk/settings/file-chooser" = {
location-mode = "path-bar";
show-hidden = false;
show-size-column = true;
sort-column = "modified";
sort-directories-first = false;
sort-order = "descending";
};
"org/virt-manager/virt-manager/confirm" = {
delete-storage = true;
forcepoweroff = false;
};
"org/virt-manager/virt-manager/details" = {
show-toolbar = true;
};
"org/virt-manager/virt-manager/connections" = {
autoconnect = [ "qemu:///session" "qemu:///system" ];
uris = [ "qemu:///session" "qemu:///system" ];
};
};
});
} }
+6 -1
View File
@@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
{ {
options.greg.pypackage = lib.mkOption { options.greg.pypackage = lib.mkOption {
description = "Enable Gnome support and settings"; description = "Enable Gnome support and settings";
+91 -82
View File
@@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.greg.sway; cfg = config.greg.sway;
@@ -9,98 +14,102 @@ let
term = "${pkgs.alacritty}/bin/alacritty"; term = "${pkgs.alacritty}/bin/alacritty";
msg = "${pkgs.sway}/bin/swaymsg"; msg = "${pkgs.sway}/bin/swaymsg";
sleep = "${pkgs.coreutils}/bin/sleep"; sleep = "${pkgs.coreutils}/bin/sleep";
workstation1 = pkgs.writeScriptBin "workstation1" (builtins.concatStringsSep "\n" [ workstation1 = pkgs.writeScriptBin "workstation1" (
"${msg} \"workspace 1 ; exec ${pkgs.firefox}/bin/firefox ; split horizontal ; exec ${pkgs.element-desktop}/bin/element-desktop \"" builtins.concatStringsSep "\n" [
"${sleep} 1" "${msg} \"workspace 1 ; exec ${pkgs.firefox}/bin/firefox ; split horizontal ; exec ${pkgs.element-desktop}/bin/element-desktop \""
"${msg} '[app_id=\"firefox\"]' move left" "${sleep} 1"
"${msg} '[instance=\"element\"]' \"layout tabbed ; exec ${term} \"" "${msg} '[app_id=\"firefox\"]' move left"
"${msg} '[app_id=\"firefox\"]' move left" "${msg} '[instance=\"element\"]' \"layout tabbed ; exec ${term} \""
"${sleep} 0.3" "${msg} '[app_id=\"firefox\"]' move left"
"${msg} '[app_id=\"Alacritty\" workspace=\"1\"]' move right" "${sleep} 0.3"
"${msg} '[app_id=\"firefox\"]' resize grow width 300 px" "${msg} '[app_id=\"Alacritty\" workspace=\"1\"]' move right"
]); "${msg} '[app_id=\"firefox\"]' resize grow width 300 px"
workstation2 = pkgs.writeScriptBin "workstation2" (builtins.concatStringsSep "\n" [ ]
"${sleep} 5" );
"${msg} \"workspace 2 ; exec ${term} ; layout tabbed\"" workstation2 = pkgs.writeScriptBin "workstation2" (
]); builtins.concatStringsSep "\n" [
"${sleep} 5"
"${msg} \"workspace 2 ; exec ${term} ; layout tabbed\""
]
);
in in
{ {
options.greg.sway = lib.mkEnableOption "Enable Sway support and settings"; options.greg.sway = lib.mkEnableOption "Enable Sway support and settings";
config = (lib.mkIf cfg { config = (
programs.swaylock.enable = true; lib.mkIf cfg {
programs.swaylock.enable = true;
wayland.windowManager.sway = wayland.windowManager.sway =
let let
mod = config.wayland.windowManager.sway.config.modifier; mod = config.wayland.windowManager.sway.config.modifier;
in in
{ {
enable = true; enable = true;
config = rec { config = rec {
#fonts.size = 10.0; #fonts.size = 10.0;
keybindings = lib.mkOptionDefault { keybindings = lib.mkOptionDefault {
"Mod4+l" = "exec ${pkgs.swaylock}/bin/swaylock -c 000000"; "Mod4+l" = "exec ${pkgs.swaylock}/bin/swaylock -c 000000";
"Mod4+h" = "exec ${pkgs.qpwgraph}/bin/qpwgraph -x /home/greg/sound/headphones.qpwgraph -m"; "Mod4+h" = "exec ${pkgs.qpwgraph}/bin/qpwgraph -x /home/greg/sound/headphones.qpwgraph -m";
"Mod4+m" = "exec ${pkgs.qpwgraph}/bin/qpwgraph -x /home/greg/sound/monitor.qpwgraph -m"; "Mod4+m" = "exec ${pkgs.qpwgraph}/bin/qpwgraph -x /home/greg/sound/monitor.qpwgraph -m";
"Mod4+b" = "exec ${pkgs.qpwgraph}/bin/qpwgraph -x /home/greg/sound/both.qpwgraph -m"; "Mod4+b" = "exec ${pkgs.qpwgraph}/bin/qpwgraph -x /home/greg/sound/both.qpwgraph -m";
"${mod}+Shift+Return" = file_browser.path; "${mod}+Shift+Return" = file_browser.path;
};
modifier = "Mod1";
output = {
"Samsung Electric Company S24E650 H4ZN600985" = {
mode = "1920x1200";
transform = "90";
pos = "0 0";
}; };
"ViewSonic Corporation VA2252 Series VMT201800925" = { modifier = "Mod1";
mode = "1920x1080"; output = {
pos = "200 1920"; "Samsung Electric Company S24E650 H4ZN600985" = {
mode = "1920x1200";
transform = "90";
pos = "0 0";
};
"ViewSonic Corporation VA2252 Series VMT201800925" = {
mode = "1920x1080";
pos = "200 1920";
};
}; };
terminal = term;
startup = [
{ command = "${workstation1}/bin/workstation1"; }
{ command = "${workstation2}/bin/workstation2"; }
];
};
extraOptions = [ "--unsupported-gpu" ];
extraSessionCommands = ''
export WLR_NO_HARDWARE_CURSORS=1
'';
systemd.enable = true;
wrapperFeatures = {
base = true;
gtk = true;
}; };
terminal = term;
startup = [
{ command = "${workstation1}/bin/workstation1"; }
{ command = "${workstation2}/bin/workstation2"; }
];
}; };
extraOptions = [
"--unsupported-gpu" home.pointerCursor = {
]; name = "Adwaita";
extraSessionCommands = '' package = pkgs.gnome.adwaita-icon-theme;
export WLR_NO_HARDWARE_CURSORS=1 size = 12;
''; x11 = {
systemd.enable = true; enable = true;
wrapperFeatures = { defaultCursor = "Adwaita";
base = true;
gtk = true;
}; };
}; };
home.pointerCursor = { home.packages = with pkgs; [
name = "Adwaita"; arj
package = pkgs.gnome.adwaita-icon-theme; dpkg
size = 12; kate
x11 = { kget
enable = true; krename
defaultCursor = "Adwaita"; file_browser.pkg
}; p7zip
}; plocate
rpm
home.packages = with pkgs; [ qpwgraph
arj xorg.xev
dpkg xorg.xmodmap
kate xxdiff
kget ];
krename }
file_browser.pkg );
p7zip
plocate
rpm
qpwgraph
xorg.xev
xorg.xmodmap
xxdiff
];
});
} }
+36 -36
View File
@@ -4,7 +4,8 @@ let
cfg = config.programs.xonsh; cfg = config.programs.xonsh;
in in
with lib; { with lib;
{
options = { options = {
programs.xonsh = { programs.xonsh = {
enable = mkEnableOption "Enable the xonsh program"; enable = mkEnableOption "Enable the xonsh program";
@@ -12,34 +13,36 @@ with lib; {
sessionVariables = mkOption { sessionVariables = mkOption {
type = types.attrs; type = types.attrs;
default = { }; default = { };
example = { XONSH_TRACE_SUBPROC = true; }; example = {
XONSH_TRACE_SUBPROC = true;
};
description = '' description = ''
Environment variables that will be set for the Xonsh session. Environment variables that will be set for the Xonsh session.
''; '';
}; };
aliases = mkOption { aliases = mkOption {
type = types.attrsOf types.str; type = types.attrsOf types.str;
default = { }; default = { };
example = literalExpression '' example = literalExpression ''
{ {
ll = "ls -l"; ll = "ls -l";
la = "ls -a"; la = "ls -a";
} }
''; '';
description = '' description = ''
An attribute set that maps aliases (the top level attribute names in An attribute set that maps aliases (the top level attribute names in
this option) to command strings or directly to build outputs. this option) to command strings or directly to build outputs.
''; '';
}; };
configHeader = mkOption { configHeader = mkOption {
type = types.lines; type = types.lines;
default = ""; default = "";
example = literalExpression '' example = literalExpression ''
import os import os
import sys import sys
''; '';
description = "An arbitrary string to put at the top of the config file"; description = "An arbitrary string to put at the top of the config file";
}; };
@@ -47,11 +50,11 @@ with lib; {
type = types.lines; type = types.lines;
default = ""; default = "";
example = literalExpression '' example = literalExpression ''
def _some_method(args): def _some_method(args):
do_command() do_command()
some_other_thing() some_other_thing()
aliases['some_method'] = _some_method aliases['some_method'] = _some_method
''; '';
description = "An arbitrary string to put at the end of the config file"; description = "An arbitrary string to put at the end of the config file";
}; };
}; };
@@ -59,29 +62,26 @@ with lib; {
config = config =
let let
shortAliases = concatStringsSep "\n" ( shortAliases = concatStringsSep "\n" (mapAttrsToList (k: v: "aliases['${k}']=r'${v}'") cfg.aliases);
mapAttrsToList (k: v: "aliases['${k}']=r'${v}'") cfg.aliases
);
listToPythonList = listToPythonList =
let let
listInternals = args: listInternals = args: concatStringsSep "\n" (map (v: "'${v}'") args);
concatStringsSep "\n" (map (v: "'${v}'") args);
in in
list: "[${listInternals list}]"; list: "[${listInternals list}]";
sessionVars = concatStringsSep "\n" ( sessionVars = concatStringsSep "\n" (
mapAttrsToList mapAttrsToList (
(k: v: k: v:
if builtins.typeOf v == "string" then if builtins.typeOf v == "string" then
"\$${k} = '${v}'" "\$${k} = '${v}'"
else if builtins.typeOf v == "list" then else if builtins.typeOf v == "list" then
"\$${k} = ${listToPythonList}" "\$${k} = ${listToPythonList}"
else if builtins.typeOf v == "int" then else if builtins.typeOf v == "int" then
"\$${k} = ${toString v}" "\$${k} = ${toString v}"
else "" else
) ""
cfg.sessionVariables ) cfg.sessionVariables
); );
in in
+23 -17
View File
@@ -1,31 +1,37 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "uas" "sd_mod" ]; boot.initrd.availableKernelModules = [
"xhci_pci"
"thunderbolt"
"nvme"
"uas"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/607b933f-2967-4652-b478-4d8e9aa38a0d";
device = "/dev/disk/by-uuid/607b933f-2967-4652-b478-4d8e9aa38a0d"; fsType = "btrfs";
fsType = "btrfs"; options = [ "subvol=@" ];
options = [ "subvol=@" ]; };
};
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/B31C-C1F4";
device = "/dev/disk/by-uuid/B31C-C1F4"; fsType = "vfat";
fsType = "vfat"; };
};
swapDevices = [ ]; swapDevices = [ ];
+29 -17
View File
@@ -1,9 +1,16 @@
{ pkgs, config, lib, ... }: {
pkgs,
config,
lib,
...
}:
let let
address = (builtins.elemAt config.networking.interfaces.ens18.ipv4.addresses 0).address; address = (builtins.elemAt config.networking.interfaces.ens18.ipv4.addresses 0).address;
root_ca = pkgs.writeText "root_ca.crt" (builtins.readFile ../../ca/root_ca.crt); root_ca = pkgs.writeText "root_ca.crt" (builtins.readFile ../../ca/root_ca.crt);
intermediate_ca = pkgs.writeText "intermediate_ca.crt" (builtins.readFile ../../ca/intermediate_ca.crt); intermediate_ca = pkgs.writeText "intermediate_ca.crt" (
builtins.readFile ../../ca/intermediate_ca.crt
);
in in
{ {
age.secrets.acme_password = { age.secrets.acme_password = {
@@ -13,7 +20,10 @@ in
file = ../../secrets/ca/intermediate_key.age; file = ../../secrets/ca/intermediate_key.age;
}; };
age.secrets.root_ca_key.file = ../../secrets/ca/root_key.age; age.secrets.root_ca_key.file = ../../secrets/ca/root_key.age;
systemd.services.step-ca.serviceConfig.Environment = lib.mkForce [ "STEPDEBUG=1" "HOME=%S/step-ca" ]; systemd.services.step-ca.serviceConfig.Environment = lib.mkForce [
"STEPDEBUG=1"
"HOME=%S/step-ca"
];
services.step-ca = { services.step-ca = {
inherit address; inherit address;
enable = false; enable = false;
@@ -35,20 +45,22 @@ in
dataSource = "/var/lib/step-ca/db"; dataSource = "/var/lib/step-ca/db";
badgerFileLoadingMode = ""; badgerFileLoadingMode = "";
}; };
authority.provisioners = [{ authority.provisioners = [
type = "JWK"; {
name = "greg@thehellings.com"; type = "JWK";
key = { name = "greg@thehellings.com";
use = "sig"; key = {
kty = "EC"; use = "sig";
kid = "1GOpOttYLZtx7XiG79ZycbGcG4ptL0czfohK35SZOEI"; kty = "EC";
crv = "P-256"; kid = "1GOpOttYLZtx7XiG79ZycbGcG4ptL0czfohK35SZOEI";
alg = "ES256"; crv = "P-256";
x = "YEWVj5CCoqWQXWqmL0UuORlFY9IEOLcg1jpG1o-wGx4"; alg = "ES256";
y = "MEpqnJp60VV-SpFtb6m8U-VAYut7R_PKFm07xl7MjBk"; x = "YEWVj5CCoqWQXWqmL0UuORlFY9IEOLcg1jpG1o-wGx4";
}; y = "MEpqnJp60VV-SpFtb6m8U-VAYut7R_PKFm07xl7MjBk";
encryptedKey = "eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjdHkiOiJqd2sranNvbiIsImVuYyI6IkEyNTZHQ00iLCJwMmMiOjYwMDAwMCwicDJzIjoieWdfb0lfbWgwbHhPRXdjUTBsd0FnUSJ9.ivdQUFEhs2U8PUBYr8AhQl3hHdb4spF4jvXgqY_hiVgpjB-z3Nn9Uw.u7vrNht_3WD1G97q.mbydlpAQxjtKLkOmmDOUczqscRDPqrUyoPJ1uqXcJDH3vs4KiYlrKRcFLjPy9sWzEL1iIrqjwf3U-3AAx1KNAg7frs2D__MGfOO-U5SdQDVJVAND7KpWOJGJVSb0xioCA6-8ldlP_REqu4ENmkkdw0_6Is2b0p7ZFKqke_fqOOs7osqFAfbMb_WzEWrACLn5A5-Teh2rpEgR-z9zipN6MSEqE6VIQ2BXuv70aHWhslNe1MK1OgTYm9CqA47EMYvQ7HQLPDZAbP56WK84yJLktoXMmnkaKeTtvER0dh4ufyjJHBhecnEranbR5rHc_jV8_qvyWhlqbCrOU_8bWrk.a9SH_q3GKIUsOUSRWkDxQg"; };
}]; encryptedKey = "eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjdHkiOiJqd2sranNvbiIsImVuYyI6IkEyNTZHQ00iLCJwMmMiOjYwMDAwMCwicDJzIjoieWdfb0lfbWgwbHhPRXdjUTBsd0FnUSJ9.ivdQUFEhs2U8PUBYr8AhQl3hHdb4spF4jvXgqY_hiVgpjB-z3Nn9Uw.u7vrNht_3WD1G97q.mbydlpAQxjtKLkOmmDOUczqscRDPqrUyoPJ1uqXcJDH3vs4KiYlrKRcFLjPy9sWzEL1iIrqjwf3U-3AAx1KNAg7frs2D__MGfOO-U5SdQDVJVAND7KpWOJGJVSb0xioCA6-8ldlP_REqu4ENmkkdw0_6Is2b0p7ZFKqke_fqOOs7osqFAfbMb_WzEWrACLn5A5-Teh2rpEgR-z9zipN6MSEqE6VIQ2BXuv70aHWhslNe1MK1OgTYm9CqA47EMYvQ7HQLPDZAbP56WK84yJLktoXMmnkaKeTtvER0dh4ufyjJHBhecnEranbR5rHc_jV8_qvyWhlqbCrOU_8bWrk.a9SH_q3GKIUsOUSRWkDxQg";
}
];
tls = { tls = {
cipherSuites = [ cipherSuites = [
"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256" "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256"
+13 -12
View File
@@ -4,24 +4,25 @@
{ lib, modulesPath, ... }: { lib, modulesPath, ... }:
{ {
imports = imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
[
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ]; boot.initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"sr_mod"
"virtio_blk"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ]; boot.kernelModules = [ ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/a13f941e-4985-47ab-a8c6-374a627c5ce1";
device = "/dev/disk/by-uuid/a13f941e-4985-47ab-a8c6-374a627c5ce1"; fsType = "ext4";
fsType = "ext4"; };
};
swapDevices = swapDevices = [ { device = "/dev/disk/by-uuid/ac4557de-1ad5-4d3c-b9f4-5ec50dbf76f1"; } ];
[{ device = "/dev/disk/by-uuid/ac4557de-1ad5-4d3c-b9f4-5ec50dbf76f1"; }];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's
+22 -12
View File
@@ -26,16 +26,17 @@
"wyoming" "wyoming"
"zwave_js" "zwave_js"
]; ];
customComponents = with pkgs.home-assistant-custom-components; [ customComponents = with pkgs.home-assistant-custom-components; [ smartthinq-sensors ];
smartthinq-sensors
];
config = { config = {
default_config = { }; default_config = { };
tts = [{ platform = "google_translate"; }]; tts = [ { platform = "google_translate"; } ];
http = { http = {
use_x_forwarded_for = true; use_x_forwarded_for = true;
trusted_proxies = [ "127.0.0.1" "::1" ]; trusted_proxies = [
"127.0.0.1"
"::1"
];
server_host = "127.0.0.1"; server_host = "127.0.0.1";
}; };
#"automation manual" = *nix config here* and so on #"automation manual" = *nix config here* and so on
@@ -75,7 +76,10 @@
containers.zwave = { containers.zwave = {
autoStart = false; # We will try to start it with udev.extraRules listed below, as this option starts it too quickly autoStart = false; # We will try to start it with udev.extraRules listed below, as this option starts it too quickly
image = "zwavejs/zwave-js-ui:latest"; image = "zwavejs/zwave-js-ui:latest";
ports = [ "8091:8091" "3000:3000" ]; ports = [
"8091:8091"
"3000:3000"
];
volumes = [ "/var/lib/zwave:/usr/src/app/store" ]; volumes = [ "/var/lib/zwave:/usr/src/app/store" ];
extraOptions = [ extraOptions = [
"--device" "--device"
@@ -93,8 +97,12 @@
# the container. So we add the creation of /var/lib/{zwave,hass} to the systemd Unit files # the container. So we add the creation of /var/lib/{zwave,hass} to the systemd Unit files
systemd.services = { systemd.services = {
"podman-zwave" = { "podman-zwave" = {
after = [ "sys-devices-pci0000:00-0000:00:1e.0-0000:02:1b.0-usb2-2\\x2d1-2\\x2d1:1.0-tty-ttyACM0.device" ]; after = [
wantedBy = [ "sys-devices-pci0000:00-0000:00:1e.0-0000:02:1b.0-usb2-2\\x2d1-2\\x2d1:1.0-tty-ttyACM0.device" ]; "sys-devices-pci0000:00-0000:00:1e.0-0000:02:1b.0-usb2-2\\x2d1-2\\x2d1:1.0-tty-ttyACM0.device"
];
wantedBy = [
"sys-devices-pci0000:00-0000:00:1e.0-0000:02:1b.0-usb2-2\\x2d1-2\\x2d1:1.0-tty-ttyACM0.device"
];
serviceConfig = { serviceConfig = {
StateDirectory = "zwave"; StateDirectory = "zwave";
StateDirectoryMode = pkgs.lib.mkForce "0777"; StateDirectoryMode = pkgs.lib.mkForce "0777";
@@ -103,9 +111,8 @@
}; };
services.udev.extraRules = '' services.udev.extraRules = ''
SUBSYSTEM=="tty", KERNEL=="ttyACM0", TAG+="systemd" SUBSYSTEM=="tty", KERNEL=="ttyACM0", TAG+="systemd"
''; '';
greg.proxies = { greg.proxies = {
"smart.home".target = "http://127.0.0.1:8123/"; "smart.home".target = "http://127.0.0.1:8123/";
@@ -116,7 +123,10 @@
# Ensure that both ports are up and running. We keep 8123 directly open because we are on the LAN and sometimes want to connect # Ensure that both ports are up and running. We keep 8123 directly open because we are on the LAN and sometimes want to connect
# directly for troubleshooting Nginx configuration # directly for troubleshooting Nginx configuration
networking.firewall = { networking.firewall = {
allowedTCPPorts = [ 80 443 ]; allowedTCPPorts = [
80
443
];
}; };
greg.backup.jobs.zwave = { greg.backup.jobs.zwave = {
+27 -21
View File
@@ -37,18 +37,22 @@ in
# This is our LAN port # This is our LAN port
"${lan}" = { "${lan}" = {
useDHCP = false; useDHCP = false;
ipv4.addresses = [{ ipv4.addresses = [
address = "${lanIP}"; {
prefixLength = 16; address = "${lanIP}";
}]; prefixLength = 16;
}
];
}; };
"${iot}" = { "${iot}" = {
useDHCP = false; useDHCP = false;
ipv4.addresses = [{ ipv4.addresses = [
address = "${iotIP}"; {
prefixLength = 24; address = "${iotIP}";
}]; prefixLength = 24;
}
];
}; };
}; };
firewall = { firewall = {
@@ -90,15 +94,19 @@ in
######## ########
_3proxy = { _3proxy = {
enable = true; enable = true;
services = [{ services = [
type = "socks"; {
auth = [ "strong" ]; type = "socks";
bindPort = proxyPort; auth = [ "strong" ];
acl = [{ bindPort = proxyPort;
rule = "allow"; acl = [
users = [ "greg" ]; {
}]; rule = "allow";
}]; users = [ "greg" ];
}
];
}
];
#usersFile = "/run/agenix/3proxy"; #usersFile = "/run/agenix/3proxy";
denyPrivate = false; denyPrivate = false;
}; };
@@ -140,7 +148,7 @@ in
"4c:a1:61:05:cd:52,192.168.66.61" # Rainbird "4c:a1:61:05:cd:52,192.168.66.61" # Rainbird
"48:d6:d5:5d:81:21,192.168.66.65" # Google Home "48:d6:d5:5d:81:21,192.168.66.65" # Google Home
"6c:29:90:3e:e2:02,192.168.66.66" # wiz "6c:29:90:3e:e2:02,192.168.66.66" # wiz
"28:87:ba:0e:ca:da,192.168.66.74" # "28:87:ba:0e:ca:da,192.168.66.74"
"28:87:ba:0e:c9:fd,192.168.66.75" # Master closet "28:87:ba:0e:c9:fd,192.168.66.75" # Master closet
"54:af:97:c2:0f:a1,192.168.66.76" # Master toilet "54:af:97:c2:0f:a1,192.168.66.76" # Master toilet
"54:af:97:83:ed:33,192.168.66.80" "54:af:97:83:ed:33,192.168.66.80"
@@ -174,9 +182,7 @@ in
# Update adblock list # Update adblock list
cron = { cron = {
enable = true; enable = true;
systemCronJobs = [ systemCronJobs = [ "* * * * * root ${adblockUpdate} 2>&1 > /var/log/adblock.log" ];
"* * * * * root ${adblockUpdate} 2>&1 > /var/log/adblock.log"
];
}; };
}; # End of services configuration }; # End of services configuration
+2 -5
View File
@@ -41,9 +41,7 @@ in
listen = true; listen = true;
rpc = { rpc = {
address = ip; address = ip;
allowip = [ allowip = [ "100.1.1.1/8" ];
"100.1.1.1/8"
];
}; };
}; };
clightning = { clightning = {
@@ -74,6 +72,5 @@ in
}; };
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [ ];
];
} }
+24 -17
View File
@@ -1,31 +1,38 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "uas" "sd_mod" ]; boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"uas"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/d4ac74f7-62bb-421a-aad8-566277c9d8ba";
device = "/dev/disk/by-uuid/d4ac74f7-62bb-421a-aad8-566277c9d8ba"; fsType = "btrfs";
fsType = "btrfs"; options = [ "subvol=@" ];
options = [ "subvol=@" ]; };
};
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/1F51-B638";
device = "/dev/disk/by-uuid/1F51-B638"; fsType = "vfat";
fsType = "vfat"; };
};
fileSystems."/chain" = { fileSystems."/chain" = {
device = "/dev/sda1"; device = "/dev/sda1";
+4 -1
View File
@@ -19,7 +19,10 @@
users.users.greg = { users.users.greg = {
isNormalUser = true; isNormalUser = true;
description = "Gregory Hellings"; description = "Gregory Hellings";
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [
"networkmanager"
"wheel"
];
packages = with pkgs; [ ]; packages = with pkgs; [ ];
}; };
} }
+2 -1
View File
@@ -1,7 +1,8 @@
{ ... }: { ... }:
let let
in { in
{
fileSystems."serve" = { fileSystems."serve" = {
#device = "10.42.1.4:/volume1/icdm-mysql/"; #device = "10.42.1.4:/volume1/icdm-mysql/";
#fsType = "nfs"; #fsType = "nfs";
+29 -24
View File
@@ -1,40 +1,45 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules = [
"xhci_pci"
"ehci_pci"
"ahci"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/dab0d455-e25e-4445-8fa4-5320047d7e7b";
device = "/dev/disk/by-uuid/dab0d455-e25e-4445-8fa4-5320047d7e7b"; fsType = "btrfs";
fsType = "btrfs"; options = [ "subvol=@" ];
options = [ "subvol=@" ]; };
};
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/5aedbb07-5761-423b-909d-2560405eae32";
device = "/dev/disk/by-uuid/5aedbb07-5761-423b-909d-2560405eae32"; fsType = "ext4";
fsType = "ext4"; };
};
fileSystems."/var" = fileSystems."/var" = {
{ device = "/dev/disk/by-uuid/57968536-c29d-417d-997e-85223d1d1f65";
device = "/dev/disk/by-uuid/57968536-c29d-417d-997e-85223d1d1f65"; fsType = "btrfs";
fsType = "btrfs"; };
};
swapDevices = swapDevices = [ { device = "/dev/disk/by-uuid/09691dce-375a-43c6-8d40-4498d20a6d9a"; } ];
[{ device = "/dev/disk/by-uuid/09691dce-375a-43c6-8d40-4498d20a6d9a"; }];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's
+17 -13
View File
@@ -1,8 +1,6 @@
{ ... }: { ... }:
let let
dnsHosts = builtins.concatStringsSep "\n" [ dnsHosts = builtins.concatStringsSep "\n" [ "wiki.icdm.lan 10.42.101.1" ];
"wiki.icdm.lan 10.42.101.1"
];
in in
{ {
# If we have to do proxying in Bayonnais, we can start to work on that here # If we have to do proxying in Bayonnais, we can start to work on that here
@@ -11,24 +9,32 @@ in
hostName = "icdm-root"; hostName = "icdm-root";
useDHCP = false; useDHCP = false;
defaultGateway = "10.42.1.1"; defaultGateway = "10.42.1.1";
nameservers = [ "100.100.100.100" "10.42.1.2" ]; nameservers = [
"100.100.100.100"
"10.42.1.2"
];
enableIPv6 = false; enableIPv6 = false;
interfaces = { interfaces = {
eno1.ipv4.addresses = [{ eno1.ipv4.addresses = [
address = "10.42.101.1"; {
prefixLength = 16; address = "10.42.101.1";
} prefixLength = 16;
}
{ {
address = "10.77.1.2"; address = "10.77.1.2";
prefixLength = 16; prefixLength = 16;
}]; }
];
}; };
# Allow traffic through # Allow traffic through
firewall = { firewall = {
enable = true; enable = true;
allowedTCPPorts = [ 53 ]; allowedTCPPorts = [ 53 ];
allowedUDPPorts = [ 53 67 ]; allowedUDPPorts = [
53
67
];
}; };
extraHosts = "${dnsHosts}"; extraHosts = "${dnsHosts}";
@@ -38,9 +44,7 @@ in
enable = true; enable = true;
settings = { settings = {
domain = "icdm.lan"; domain = "icdm.lan";
dhcp-range = [ dhcp-range = [ "eno1,10.77.1.10,10.77.1.255,255.255.0.0,12h" ];
"eno1,10.77.1.10,10.77.1.255,255.255.0.0,12h"
];
dhcp-option = [ dhcp-option = [
"eno1,option:router,10.77.1.1" "eno1,option:router,10.77.1.1"
"eno1,option:dns-server,10.77.1.2,1.1.1.1" "eno1,option:dns-server,10.77.1.2,1.1.1.1"
+7 -4
View File
@@ -1,4 +1,9 @@
{ pkgs, lib, modulesPath, ... }: {
pkgs,
lib,
modulesPath,
...
}:
{ {
imports = [ imports = [
@@ -9,7 +14,5 @@
networking.networkmanager.enable = lib.mkForce false; networking.networkmanager.enable = lib.mkForce false;
users.users.greg.initialPassword = ""; users.users.greg.initialPassword = "";
#services.getty.autologinUser = lib.mkForce "greg"; #services.getty.autologinUser = lib.mkForce "greg";
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [ tree ];
tree
];
} }
+26 -20
View File
@@ -2,16 +2,20 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
{ {
imports = imports = [
[ # Include the results of the hardware scan.
# Include the results of the hardware scan. ./ceph.nix
./ceph.nix ./hardware-configuration.nix
./hardware-configuration.nix ./minio.nix
./minio.nix ];
];
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
@@ -32,25 +36,27 @@
}; };
interfaces = { interfaces = {
enp68s0 = { enp68s0 = {
ipv4.addresses = [{ ipv4.addresses = [
address = "10.42.1.8"; {
prefixLength = 16; address = "10.42.1.8";
} prefixLength = 16;
}
{ {
address = "10.42.100.1"; address = "10.42.100.1";
prefixLength = 16; prefixLength = 16;
}]; }
];
}; };
san = { san = {
ipv4.addresses = [{ ipv4.addresses = [
address = "10.201.1.2"; {
prefixLength = 24; address = "10.201.1.2";
}]; prefixLength = 24;
}
];
}; };
}; };
nameservers = [ nameservers = [ "10.42.1.5" ];
"10.42.1.5"
];
}; };
greg = { greg = {
home = true; home = true;
+23 -16
View File
@@ -1,30 +1,37 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "uas" "usbhid" "sd_mod" ]; boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"uas"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/ffc167f5-d9e4-4b11-a5f1-f7da0550ad24";
device = "/dev/disk/by-uuid/ffc167f5-d9e4-4b11-a5f1-f7da0550ad24"; fsType = "ext4";
fsType = "ext4"; };
};
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/3047-870E";
device = "/dev/disk/by-uuid/3047-870E"; fsType = "vfat";
fsType = "vfat"; };
};
swapDevices = [ ]; swapDevices = [ ];
+25 -20
View File
@@ -12,23 +12,28 @@
enable = true; enable = true;
configurationLimit = 20; configurationLimit = 20;
extraEntries = { extraEntries = {
"Windows.conf" = (lib.strings.concatStringsSep "\n" [ "Windows.conf" = (
"title Windows" lib.strings.concatStringsSep "\n" [
"efi /EFI/Microsoft/EFI/bootmgfw.efi" "title Windows"
]); "efi /EFI/Microsoft/EFI/bootmgfw.efi"
"Win2.conf" = (lib.strings.concatStringsSep "\n" [ ]
"title Windows 11" );
"efi /shellx64.efi" "Win2.conf" = (
"options -nointerrupt -noconsolein -noconsoleout windows11.nsh" lib.strings.concatStringsSep "\n" [
]); "title Windows 11"
"Shell.conf" = (lib.strings.concatStringsSep "\n" [ "efi /shellx64.efi"
"title EFI Shell" "options -nointerrupt -noconsolein -noconsoleout windows11.nsh"
"efi /shell.efi" ]
]); );
"Shell.conf" = (
lib.strings.concatStringsSep "\n" [
"title EFI Shell"
"efi /shell.efi"
]
);
}; };
extraFiles = { extraFiles = {
"windows11.nsh" = (pkgs.writeText "windows11.nsh" (lib.strings.concatStringsSep "\n" [ "windows11.nsh" = (pkgs.writeText "windows11.nsh" (lib.strings.concatStringsSep "\n" [ ]));
]));
"shell.efi" = "${pkgs.edk2-uefi-shell}/shell.efi"; "shell.efi" = "${pkgs.edk2-uefi-shell}/shell.efi";
}; };
}; };
@@ -38,11 +43,11 @@
useOSProber = true; useOSProber = true;
efiSupport = true; efiSupport = true;
extraEntries = '' extraEntries = ''
menuentry "Windows" --class windows --class os { menuentry "Windows" --class windows --class os {
insmod ntfs insmod ntfs
chainloader (hd0,0)/EFI/Windows/bootmgfw.efi chainloader (hd0,0)/EFI/Windows/bootmgfw.efi
} }
''; '';
}; };
#efi.canTouchEfiVariables = true; #efi.canTouchEfiVariables = true;
}; };
+47 -42
View File
@@ -25,7 +25,10 @@
firewall = { firewall = {
enable = false; enable = false;
allowedTCPPorts = [ 21000 ]; allowedTCPPorts = [ 21000 ];
allowedUDPPorts = [ 21000 21010 ]; allowedUDPPorts = [
21000
21010
];
}; };
}; };
greg = { greg = {
@@ -38,48 +41,50 @@
boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ]; boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
environment.systemPackages = with pkgs; lib.mkMerge [ environment.systemPackages =
[ with pkgs;
# for Immersed lib.mkMerge [
cudatoolkit [
immersed-vr # for Immersed
libva cudatoolkit
] immersed-vr
[ libva
bind # For things like nslookup ]
create_ssl [
distrobox bind # For things like nslookup
expect create_ssl
gimp distrobox
go expect
gparted gimp
gnucash go
graphviz gparted
flock gnucash
ffmpeg graphviz
handbrake flock
imagemagick ffmpeg
libtheora handbrake
libxml2 imagemagick
linode-cli libtheora
makemkv libxml2
oathToolkit linode-cli
usbutils makemkv
vagrant oathToolkit
ventoy usbutils
] vagrant
ventoy
]
[ [
# Video/Audio data composition framework tools like "gst-inspect", "gst-launch" ... # Video/Audio data composition framework tools like "gst-inspect", "gst-launch" ...
gst_all_1.gstreamer gst_all_1.gstreamer
gst_all_1.gst-plugins-base gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-bad gst_all_1.gst-plugins-bad
gst_all_1.gst-plugins-ugly gst_all_1.gst-plugins-ugly
gst_all_1.gst-libav gst_all_1.gst-libav
gst_all_1.gst-vaapi gst_all_1.gst-vaapi
] ]
]; ];
fileSystems = { fileSystems = {
"/boot" = { "/boot" = {
device = "/dev/nvme0n1p1"; device = "/dev/nvme0n1p1";
+20 -12
View File
@@ -1,25 +1,33 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ #device = "/dev/disk/by-uuid/27ae91ed-32e9-411e-8227-0d99e360fbbf";
#device = "/dev/disk/by-uuid/27ae91ed-32e9-411e-8227-0d99e360fbbf"; device = "/dev/nvme0n1p4";
device = "/dev/nvme0n1p4"; fsType = "btrfs";
fsType = "btrfs"; };
};
swapDevices = [ ]; swapDevices = [ ];
+21 -14
View File
@@ -1,4 +1,9 @@
{ pkgs, lib, config, ... }: {
pkgs,
lib,
config,
...
}:
{ {
imports = [ imports = [
@@ -29,9 +34,7 @@
networkmanager.enable = lib.mkForce false; networkmanager.enable = lib.mkForce false;
hostName = "linode"; hostName = "linode";
domain = "thehellings.com"; domain = "thehellings.com";
nameservers = [ nameservers = [ "100.88.91.27" ];
"100.88.91.27"
];
}; };
age.secrets.runner-deployer = { age.secrets.runner-deployer = {
@@ -58,17 +61,21 @@
User = "gitlab-runner"; User = "gitlab-runner";
}; };
security.sudo.extraRules = [{ security.sudo.extraRules = [
users = [ "gitlab-runner" ]; {
commands = [{ users = [ "gitlab-runner" ];
command = "/run/current-system/sw/bin/systemctl"; commands = [
options = [ "NOPASSWD" ]; {
command = "/run/current-system/sw/bin/systemctl";
options = [ "NOPASSWD" ];
}
{
command = "/run/current-system/sw/bin/podman";
options = [ "NOPASSWD" ];
}
];
} }
{ ];
command = "/run/current-system/sw/bin/podman";
options = [ "NOPASSWD" ];
}];
}];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
bind bind
+3 -3
View File
@@ -10,9 +10,9 @@ in
ssl = true; ssl = true;
genAliases = false; genAliases = false;
extraConfig = '' extraConfig = ''
proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Ssl on; proxy_set_header X-Forwarded-Ssl on;
''; '';
}; };
greg.proxies."registry.thehellings.com" = { greg.proxies."registry.thehellings.com" = {
target = "https://registry.thehellings.lan:5000"; target = "https://registry.thehellings.lan:5000";
+14 -8
View File
@@ -1,14 +1,22 @@
# Do not modify this file! It was generated by "nixos-generate-config" # Do not modify this file! It was generated by "nixos-generate-config"
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = [ imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_scsi" "ahci" "sd_mod" ]; boot.initrd.availableKernelModules = [
"virtio_pci"
"virtio_scsi"
"ahci"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ]; boot.kernelModules = [ ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
@@ -18,9 +26,7 @@
fsType = "ext4"; fsType = "ext4";
}; };
swapDevices = [ swapDevices = [ { device = "/dev/sdb"; } ];
{ device = "/dev/sdb"; }
];
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
} }
+13 -4
View File
@@ -19,7 +19,9 @@ in
# the actual application server at matrix.thehellings.com # the actual application server at matrix.thehellings.com
locations."= /.well-known/matrix/server".extraConfig = locations."= /.well-known/matrix/server".extraConfig =
let let
server = { "m.server" = "${fqdn}:443"; }; server = {
"m.server" = "${fqdn}:443";
};
in in
'' ''
add_header Content-Type application/json; add_header Content-Type application/json;
@@ -29,8 +31,12 @@ in
locations."= /.well-known/matrix/client".extraConfig = locations."= /.well-known/matrix/client".extraConfig =
let let
client = { client = {
"m.homeserver" = { "base_url" = "https://${fqdn}"; }; "m.homeserver" = {
"m.identity_server" = { "base_url" = "https://vector.im"; }; "base_url" = "https://${fqdn}";
};
"m.identity_server" = {
"base_url" = "https://vector.im";
};
}; };
in in
'' ''
@@ -58,6 +64,9 @@ in
# Open networking ports for the server # Open networking ports for the server
networking.firewall = { networking.firewall = {
enable = true; enable = true;
allowedTCPPorts = [ 80 443 ]; allowedTCPPorts = [
80
443
];
}; };
} }
+9 -13
View File
@@ -1,26 +1,24 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
environment.systemPackages = [ environment.systemPackages = [ pkgs.upgrade-pg-cluster ];
pkgs.upgrade-pg-cluster
];
services.postgresql = { services.postgresql = {
enable = true; enable = true;
package = pkgs.postgresql_15; package = pkgs.postgresql_15;
checkConfig = true; checkConfig = true;
ensureDatabases = [ ensureDatabases = [ "nextcloud" ];
"nextcloud"
];
#initialScript = pkgs.writeText "create-matrix-db.sql" '' #initialScript = pkgs.writeText "create-matrix-db.sql" ''
# CREATE ROLE "matrix-synapse" WITH LOGIN; # CREATE ROLE "matrix-synapse" WITH LOGIN;
# CREATE DATABASE "synapse" WITH OWNER "matrix-synapse" TEMPLATE template0 LC_COLLATE = "C" LC_CTYPE = "C"; # CREATE DATABASE "synapse" WITH OWNER "matrix-synapse" TEMPLATE template0 LC_COLLATE = "C" LC_CTYPE = "C";
# GRANT ALL PRIVILEGES ON DATABASE "synapse" TO "matrix-synapse"; # GRANT ALL PRIVILEGES ON DATABASE "synapse" TO "matrix-synapse";
#''; # These are done manually in order to set the LC_COLLATE values properly #''; # These are done manually in order to set the LC_COLLATE values properly
ensureUsers = [{ ensureUsers = [
name = "nextcloud"; {
ensureDBOwnership = true; name = "nextcloud";
}]; ensureDBOwnership = true;
}
];
settings = { settings = {
log_connections = true; log_connections = true;
log_statement = "all"; log_statement = "all";
@@ -34,9 +32,7 @@
services.postgresqlBackup = { services.postgresqlBackup = {
enable = true; enable = true;
databases = [ databases = [ "nextcloud" ];
"nextcloud"
];
}; };
services.logrotate = { services.logrotate = {
+59 -32
View File
@@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
registryPort = 5000; registryPort = 5000;
vpnIp = "100.78.226.76"; vpnIp = "100.78.226.76";
@@ -8,7 +13,12 @@ in
age.secretsMountPoint = "/run/derp"; age.secretsMountPoint = "/run/derp";
age.secrets = age.secrets =
let let
cfg = n: { file = ../../secrets/gitlab/${n}.age; owner = "gitlab"; group = "gitlab"; mode = "0444"; }; cfg = n: {
file = ../../secrets/gitlab/${n}.age;
owner = "gitlab";
group = "gitlab";
mode = "0444";
};
in in
{ {
gitlab-secret = cfg "secret"; gitlab-secret = cfg "secret";
@@ -32,16 +42,19 @@ in
}; };
}; };
networking.firewall.allowedTCPPorts = [ 80 registryPort ]; networking.firewall.allowedTCPPorts = [
80
registryPort
];
greg.proxies = greg.proxies =
let let
t = { t = {
target = "http://unix:/run/gitlab/gitlab-workhorse.socket"; target = "http://unix:/run/gitlab/gitlab-workhorse.socket";
extraConfig = '' extraConfig = ''
proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Ssl on; proxy_set_header X-Forwarded-Ssl on;
''; '';
}; };
in in
{ {
@@ -115,33 +128,45 @@ in
provider = "AWS"; provider = "AWS";
endpoint = "http://s3.thehellings.lan:9000"; endpoint = "http://s3.thehellings.lan:9000";
region = "us-east-1"; region = "us-east-1";
aws_access_key_id = { _secret = config.age.secrets.minio_access_key_id.path; }; aws_access_key_id = {
aws_secret_access_key = { _secret = config.age.secrets.minio_secret_access_key.path; }; _secret = config.age.secrets.minio_access_key_id.path;
};
aws_secret_access_key = {
_secret = config.age.secrets.minio_secret_access_key.path;
};
path_style = true; # True for MinIO path_style = true; # True for MinIO
aws_signature_version = 2; aws_signature_version = 2;
}; };
#storage_options = ...; #storage_options = ...;
objects = builtins.listToAttrs (builtins.map (x: lib.attrsets.nameValuePair x { bucket = "gitlab-${builtins.replaceStrings [ "_" ] [ "-" ] x}"; }) [ objects = builtins.listToAttrs (
"artifacts" builtins.map
"ci_secure_files" (
"dependency_proxy" x: lib.attrsets.nameValuePair x { bucket = "gitlab-${builtins.replaceStrings [ "_" ] [ "-" ] x}"; }
"external_diffs" )
"lfs" [
"packages" "artifacts"
"pages" "ci_secure_files"
"terraform_state" "dependency_proxy"
"uploads" "external_diffs"
]); "lfs"
"packages"
"pages"
"terraform_state"
"uploads"
]
);
}; };
}; };
}; };
nginx.virtualHosts."gitlab.shire-zebra.ts.net" = { nginx.virtualHosts."gitlab.shire-zebra.ts.net" = {
listen = [{ listen = [
addr = vpnIp; {
port = registryPort; addr = vpnIp;
ssl = true; port = registryPort;
}]; ssl = true;
}
];
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:5000/"; proxyPass = "http://127.0.0.1:5000/";
recommendedProxySettings = true; recommendedProxySettings = true;
@@ -156,17 +181,21 @@ in
# Fetch the SSL certificates for nginx to use # Fetch the SSL certificates for nginx to use
cron = { cron = {
enable = true; enable = true;
systemCronJobs = [ "0 0 1 */2 * cd /etc/certs && tailscale cert gitlab.shire-zebra.ts.net && chown nginx * && systemctl reload nginx" ]; systemCronJobs = [
"0 0 1 */2 * cd /etc/certs && tailscale cert gitlab.shire-zebra.ts.net && chown nginx * && systemctl reload nginx"
];
}; };
postgresql = { postgresql = {
enable = true; enable = true;
checkConfig = true; checkConfig = true;
ensureDatabases = [ "gitlab" ]; ensureDatabases = [ "gitlab" ];
ensureUsers = [{ ensureUsers = [
name = "gitlab"; {
ensureDBOwnership = true; name = "gitlab";
}]; ensureDBOwnership = true;
}
];
settings = { settings = {
log_connections = true; log_connections = true;
log_statement = "all"; log_statement = "all";
@@ -186,9 +215,7 @@ in
# to the 100.* addresses # to the 100.* addresses
systemd.services = { systemd.services = {
nginx = rec { nginx = rec {
after = [ after = [ "network-online.target" ];
"network-online.target"
];
wants = after; wants = after;
serviceConfig = { serviceConfig = {
RestartMaxDelaySec = "30s"; RestartMaxDelaySec = "30s";
+34 -28
View File
@@ -1,44 +1,50 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usb_storage"
"usbhid"
"sd_mod"
"sr_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/714744ca-dd9d-4713-b571-c6ccfbf56d79";
device = "/dev/disk/by-uuid/714744ca-dd9d-4713-b571-c6ccfbf56d79"; fsType = "btrfs";
fsType = "btrfs"; options = [ "subvol=nixos" ];
options = [ "subvol=nixos" ]; };
};
fileSystems."/home" = fileSystems."/home" = {
{ device = "/dev/disk/by-uuid/714744ca-dd9d-4713-b571-c6ccfbf56d79";
device = "/dev/disk/by-uuid/714744ca-dd9d-4713-b571-c6ccfbf56d79"; fsType = "btrfs";
fsType = "btrfs"; options = [ "subvol=home" ];
options = [ "subvol=home" ]; };
};
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/29E7-E20C";
device = "/dev/disk/by-uuid/29E7-E20C"; fsType = "vfat";
fsType = "vfat"; };
};
fileSystems."/myvol" = fileSystems."/myvol" = {
{ device = "/dev/nvme0n1p1";
device = "/dev/nvme0n1p1"; fsType = "btrfs";
fsType = "btrfs"; };
};
swapDevices = [ ]; swapDevices = [ ];
+78 -68
View File
@@ -8,82 +8,92 @@ in
greg.containers.matrix = { greg.containers.matrix = {
tailscale = true; tailscale = true;
subnet = "204"; subnet = "204";
builder = { config, ... }: { builder =
networking.firewall.allowedTCPPorts = [ config.services.dendrite.httpPort ]; { config, ... }:
{
networking.firewall.allowedTCPPorts = [ config.services.dendrite.httpPort ];
# Environment secrets # Environment secrets
age = { age = {
secrets.dendrite = { secrets.dendrite = {
file = ../../secrets/dendrite.age; file = ../../secrets/dendrite.age;
owner = "dendrite"; owner = "dendrite";
};
secrets.dendrite_key = {
file = ../../secrets/dendrite_key.age;
owner = "dendrite";
};
}; };
secrets.dendrite_key = {
file = ../../secrets/dendrite_key.age; users.users.dendrite = {
owner = "dendrite"; isSystemUser = true;
group = "dendrite";
}; };
}; users.groups.dendrite = { };
users.users.dendrite = { systemd.services.dendrite.serviceConfig = {
isSystemUser = true; User = "dendrite";
group = "dendrite"; };
};
users.groups.dendrite = { };
systemd.services.dendrite.serviceConfig = { greg.databases.dendrite = { };
User = "dendrite";
};
greg.databases.dendrite = { }; services.dendrite = {
enable = true;
services.dendrite = { environmentFile = config.age.secrets.dendrite.path;
enable = true; httpPort = 8448;
environmentFile = config.age.secrets.dendrite.path; # Identify ourselves as the root of our own domain
httpPort = 8448; settings = (
# Identify ourselves as the root of our own domain (builtins.listToAttrs (
settings = ( (map
(builtins.listToAttrs ( (x: {
(map (x: { name = x; value = { database.connection_string = conn; }; }) [ name = x;
"app_service_api" value = {
"federation_api" database.connection_string = conn;
"key_server" };
"media_api" })
"mscs" [
"relay_api" "app_service_api"
"room_server" "federation_api"
"sync_api" "key_server"
]) "media_api"
)) // "mscs"
{ "relay_api"
user_api.account_database.connection_string = conn; "room_server"
user_api.device_database.connection_string = conn; "sync_api"
global = { ]
database = { )
connection_string = conn; ))
max_open_conns = 25; // {
max_idle_conns = 5; user_api.account_database.connection_string = conn;
conn_max_lifetime = -1; user_api.device_database.connection_string = conn;
global = {
database = {
connection_string = conn;
max_open_conns = 25;
max_idle_conns = 5;
conn_max_lifetime = -1;
};
server_name = "thehellings.com";
trusted_third_party_id_servers = [
"matrix.org"
"vector.im"
"jupiterbroadcasting.com"
];
# Generate this with {path-to-dendrite}/bin/generate-keys --private-key /etc/dendrite.pem
private_key = config.age.secrets.dendrite_key.path;
}; };
server_name = "thehellings.com"; client_api = {
trusted_third_party_id_servers = [ registration_enabled = false;
"matrix.org" registration_shared_secret = "\${REGISTRATION_SHARED_SECRET}";
"vector.im" };
"jupiterbroadcasting.com" }
]; );
# Generate this with {path-to-dendrite}/bin/generate-keys --private-key /etc/dendrite.pem };
private_key = config.age.secrets.dendrite_key.path;
};
client_api = {
registration_enabled = false;
registration_shared_secret = "\${REGISTRATION_SHARED_SECRET}";
};
}
);
};
systemd.services.dendrite = { systemd.services.dendrite = {
after = [ "postgresql.service" ]; after = [ "postgresql.service" ];
requires = [ "postgresql.service" ]; requires = [ "postgresql.service" ];
};
}; };
};
}; };
} }
+1 -3
View File
@@ -1,8 +1,6 @@
{ ... }: { ... }:
{ {
imports = [ imports = [ ../baseline.nix ];
../baseline.nix
];
system.stateVersion = 4; system.stateVersion = 4;
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
+42 -34
View File
@@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
let let
cfg = config.greg.backup; cfg = config.greg.backup;
@@ -14,7 +19,8 @@ let
type = "sendonly"; type = "sendonly";
}; };
makeRestic = _: job: makeRestic =
_: job:
let let
who = "${config.services.syncthing.user}:${config.services.syncthing.group}"; who = "${config.services.syncthing.user}:${config.services.syncthing.group}";
in in
@@ -27,48 +33,50 @@ let
}; };
in in
with lib; { with lib;
{
options = { options = {
greg.backup = { greg.backup = {
jobs = mkOption { jobs = mkOption {
default = { }; default = { };
type = with types; attrsOf (submodule ( type =
{ ... }: with types;
{ attrsOf (
options = { submodule (
src = mkOption { { ... }:
type = types.str; {
description = "Local path (string form) to backup from"; options = {
}; src = mkOption {
type = types.str;
description = "Local path (string form) to backup from";
};
dest = mkOption { dest = mkOption { type = types.str; };
type = types.str;
};
id = mkOption { id = mkOption {
type = types.str; type = types.str;
description = "The unique folder ID for this"; description = "The unique folder ID for this";
}; };
}; };
} }
)); )
);
}; };
}; };
}; };
config = mkIf ((attrValues cfg.jobs) != [ ]) config = mkIf ((attrValues cfg.jobs) != [ ]) {
{ age.secrets = {
age.secrets = { restic-pw.file = ../../secrets/restic-pw.age;
restic-pw.file = ../../secrets/restic-pw.age; restic-env.file = ../../secrets/restic-env.age;
restic-env.file = ../../secrets/restic-env.age;
};
greg.syncthing = {
enable = true;
};
services = {
syncthing.settings.folders = mapAttrs makeSyncFolders cfg.jobs;
restic.backups = mapAttrs makeRestic cfg.jobs;
};
}; };
greg.syncthing = {
enable = true;
};
services = {
syncthing.settings.folders = mapAttrs makeSyncFolders cfg.jobs;
restic.backups = mapAttrs makeRestic cfg.jobs;
};
};
} }
+560 -494
View File
File diff suppressed because it is too large Load Diff
+21 -8
View File
@@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
cfg = config.greg.databases; cfg = config.greg.databases;
@@ -7,12 +12,17 @@ in
{ {
options.greg.databases = lib.mkOption { options.greg.databases = lib.mkOption {
default = { }; default = { };
type = with lib.types; attrsOf (submodule ( type =
{ ... }: { with lib.types;
# Options reserved for future expansion attrsOf (
options = { }; submodule (
} { ... }:
)); {
# Options reserved for future expansion
options = { };
}
)
);
}; };
config = lib.mkIf (dbs != [ ]) { config = lib.mkIf (dbs != [ ]) {
@@ -22,7 +32,10 @@ in
package = pkgs.postgresql_15; package = pkgs.postgresql_15;
checkConfig = true; checkConfig = true;
ensureDatabases = dbs; ensureDatabases = dbs;
ensureUsers = map (db: { name = db; ensureDBOwnership = true; }) dbs; ensureUsers = map (db: {
name = db;
ensureDBOwnership = true;
}) dbs;
settings = { settings = {
log_connections = true; log_connections = true;
log_statement = "all"; log_statement = "all";
+9 -5
View File
@@ -1,10 +1,16 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.greg.gnome; cfg = config.greg.gnome;
in in
with lib; { with lib;
{
options = { options = {
greg.gnome.enable = mkEnableOption "Enable my default Gnome3 setup"; greg.gnome.enable = mkEnableOption "Enable my default Gnome3 setup";
}; };
@@ -24,9 +30,7 @@ with lib; {
xkb.layout = "us"; xkb.layout = "us";
}; };
udev.packages = with pkgs; [ udev.packages = with pkgs; [ gnome-settings-daemon ];
gnome-settings-daemon
];
pipewire.enable = true; pipewire.enable = true;
+31 -22
View File
@@ -1,37 +1,46 @@
{ config, pkgs, lib, options, ... }: {
config,
pkgs,
lib,
options,
...
}:
let let
cfg = config.greg.kde; cfg = config.greg.kde;
in in
with lib; { with lib;
{
options = { options = {
greg.kde.enable = mkEnableOption "Enable my default KDE setup"; greg.kde.enable = mkEnableOption "Enable my default KDE setup";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# Sets up a basic KDE installation # Sets up a basic KDE installation
services = { services =
xserver = { {
enable = true; xserver = {
xkb.layout = "us"; enable = true;
# Trackpad support xkb.layout = "us";
libinput.enable = true; # Trackpad support
}; libinput.enable = true;
};
pipewire = { pipewire = {
enable = true; enable = true;
alsa.enable = true; alsa.enable = true;
alsa.support32Bit = true; alsa.support32Bit = true;
pulse.enable = true; pulse.enable = true;
}; };
} // (optionalAttrs (builtins.hasAttr "plasma6" options.services.xserver.desktopManager) { }
desktopManager.plasma6.enable = true; // (optionalAttrs (builtins.hasAttr "plasma6" options.services.xserver.desktopManager) {
displayManager = { desktopManager.plasma6.enable = true;
defaultSession = "plasma"; displayManager = {
sddm.enable = true; defaultSession = "plasma";
}; sddm.enable = true;
}); };
});
programs.dconf.enable = true; programs.dconf.enable = true;
programs.sway.enable = true; # Gives us Wayland programs.sway.enable = true; # Gives us Wayland
+13 -8
View File
@@ -1,9 +1,15 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.services.kiwix-serve; cfg = config.services.kiwix-serve;
in in
with lib; { with lib;
{
options.services.kiwix-serve = { options.services.kiwix-serve = {
enable = mkEnableOption "Enable the Kiwix web server"; enable = mkEnableOption "Enable the Kiwix web server";
@@ -22,16 +28,15 @@ with lib; {
proxy = mkOption { proxy = mkOption {
type = types.str; type = types.str;
default = ""; default = "";
description = ''Upstream proxy, if any, to configure with kiwix. Specify description = ''
host and port. E.g. "localhost:8080" Upstream proxy, if any, to configure with kiwix. Specify
''; host and port. E.g. "localhost:8080"
'';
}; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.systemPackages = [ environment.systemPackages = [ pkgs.kiwix-tools ];
pkgs.kiwix-tools
];
systemd.services.kiwix-serve = { systemd.services.kiwix-serve = {
enable = true; enable = true;
+6 -1
View File
@@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
cfg = config.greg.linode; cfg = config.greg.linode;
+18 -13
View File
@@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
cfg = config.greg.print; cfg = config.greg.print;
@@ -16,19 +21,19 @@ with lib;
# ipp://printer.thehellings.lan:631/ - generic postscript printer # ipp://printer.thehellings.lan:631/ - generic postscript printer
services.printing = { services.printing = {
enable = true; enable = true;
drivers = with pkgs; [ drivers = with pkgs; [ gutenprint ] ++ (lib.optional pkgs.stdenv.isx86_64 gutenprintBin);
gutenprint
] ++ (lib.optional pkgs.stdenv.isx86_64 gutenprintBin);
}; };
hardware.printers.ensurePrinters = [{ hardware.printers.ensurePrinters = [
name = "HomeLexmarkColorPrinter"; {
location = "Home office"; name = "HomeLexmarkColorPrinter";
deviceUri = "ipp://printer.thehellings.lan:631/"; location = "Home office";
model = "drv:///sample.drv/generic.ppd"; deviceUri = "ipp://printer.thehellings.lan:631/";
ppdOptions = { model = "drv:///sample.drv/generic.ppd";
PageSize = "Letter"; ppdOptions = {
}; PageSize = "Letter";
}]; };
}
];
}; };
} }
+55 -48
View File
@@ -10,69 +10,76 @@ let
enableACME = dest.ssl; enableACME = dest.ssl;
locations."${dest.path}" = { locations."${dest.path}" = {
proxyPass = dest.target; proxyPass = dest.target;
extraConfig = '' extraConfig =
proxy_http_version 1.1; ''
proxy_set_header Upgrade $http_upgrade; proxy_http_version 1.1;
proxy_set_header Connection $connection_upgrade; proxy_set_header Upgrade $http_upgrade;
'' + dest.extraConfig; proxy_set_header Connection $connection_upgrade;
''
+ dest.extraConfig;
}; };
serverAliases = lib.mkIf dest.genAliases [ "${alias name}" ]; serverAliases = lib.mkIf dest.genAliases [ "${alias name}" ];
}; };
in in
with lib; { with lib;
{
options = { options = {
greg.proxies = mkOption { greg.proxies = mkOption {
default = { }; default = { };
example = literalExpression '' example = literalExpression ''
{ host-name = { { host-name = {
target = proxyLocation; target = proxyLocation;
ssl = true; ssl = true;
}; };
''; '';
description = '' description = ''
Quick and simple Nginx proxy configurations. Quick and simple Nginx proxy configurations.
Use this to configure a very simple proxy that does not Use this to configure a very simple proxy that does not
need any extra customization options other than SSL need any extra customization options other than SSL
enablement. enablement.
''; '';
type = with types; attrsOf (submodule ( type =
{ ... }: with types;
{ attrsOf (
options = { submodule (
genAliases = mkOption { { ... }:
type = types.bool; {
description = "Whether to auto-generate short alias name"; options = {
default = true; genAliases = mkOption {
}; type = types.bool;
description = "Whether to auto-generate short alias name";
default = true;
};
target = mkOption { target = mkOption {
type = types.str; type = types.str;
description = ''The destination that is being proxied.''; description = ''The destination that is being proxied.'';
example = "http://localhost:8080"; example = "http://localhost:8080";
}; };
ssl = mkOption { ssl = mkOption {
type = types.bool; type = types.bool;
description = "Whether to enable SSL in front of the proxy"; description = "Whether to enable SSL in front of the proxy";
default = false; default = false;
}; };
path = mkOption { path = mkOption {
type = types.str; type = types.str;
description = "The path prefix for this proxy"; description = "The path prefix for this proxy";
default = "/"; default = "/";
}; };
extraConfig = mkOption { extraConfig = mkOption {
type = types.str; type = types.str;
description = "Extra nginx config options"; description = "Extra nginx config options";
default = ""; default = "";
}; };
}; };
} }
)); )
);
}; };
}; };
+35 -15
View File
@@ -1,22 +1,39 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
names = mylist: (lib.strings.concatMapStringsSep "," (x: ''"${x}"'') mylist); names = mylist: (lib.strings.concatMapStringsSep "," (x: ''"${x}"'') mylist);
# Pass the names of the wan/lan ports # Pass the names of the wan/lan ports
nftConfig = nftConfig =
{ wan {
, lan wan,
, limitedLan ? [ ] lan,
, openPorts ? [ "ssh" "67" "53" ] limitedLan ? [ ],
, # ssh, dhcpd, dns openPorts ? [
openUDPPorts ? [ "67" "53" ] # dhcpd, dns "ssh"
"67"
"53"
],
# ssh, dhcpd, dns
openUDPPorts ? [
"67"
"53"
], # dhcpd, dns
}: }:
let let
lanList = names lan; lanList = names lan;
allLan = names (lan ++ limitedLan); allLan = names (lan ++ limitedLan);
wanName = names wan; wanName = names wan;
portsString = lib.strings.concatMapStringsSep "\n" (x: "iifname { ${lanList}, \"tailscale0\" } tcp dport ${toString x} accept") openPorts; portsString = lib.strings.concatMapStringsSep "\n" (
udpPortsString = lib.strings.concatMapStringsSep "\n" (x: "iifname { ${lanList}, \"tailscale0\" } udp dport ${toString x} accept") openUDPPorts; x: "iifname { ${lanList}, \"tailscale0\" } tcp dport ${toString x} accept"
) openPorts;
udpPortsString = lib.strings.concatMapStringsSep "\n" (
x: "iifname { ${lanList}, \"tailscale0\" } udp dport ${toString x} accept"
) openUDPPorts;
in in
lib.strings.concatStringsSep "\n" [ lib.strings.concatStringsSep "\n" [
"table ip filter {" "table ip filter {"
@@ -61,7 +78,8 @@ let
cfg = config.greg.router; cfg = config.greg.router;
in in
with lib; { with lib;
{
options.greg.router = { options.greg.router = {
enable = mkEnableOption "Enable NFTables and routing"; enable = mkEnableOption "Enable NFTables and routing";
wan = mkOption { wan = mkOption {
@@ -82,11 +100,13 @@ with lib; {
config = mkIf cfg.enable { config = mkIf cfg.enable {
networking.nftables = { networking.nftables = {
enable = true; enable = true;
ruleset = (nftConfig { ruleset = (
inherit (cfg) lan wan; nftConfig {
openPorts = config.networking.firewall.allowedTCPPorts; inherit (cfg) lan wan;
openUDPPorts = config.networking.firewall.allowedUDPPorts; openPorts = config.networking.firewall.allowedTCPPorts;
}); openUDPPorts = config.networking.firewall.allowedUDPPorts;
}
);
}; };
environment.systemPackages = [ environment.systemPackages = [
+8 -2
View File
@@ -1,10 +1,16 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
cfg = config.greg.rpi4; cfg = config.greg.rpi4;
in in
with lib; { with lib;
{
options = { options = {
greg.rpi4 = { greg.rpi4 = {
enable = mkEnableOption "Enable support for Raspberry Pi 4s"; enable = mkEnableOption "Enable support for Raspberry Pi 4s";
+2 -1
View File
@@ -4,7 +4,8 @@ let
cfg = config.greg.sway; cfg = config.greg.sway;
in in
with lib; { with lib;
{
options = { options = {
greg.sway.enable = mkEnableOption "Enable my default Gnome3 setup"; greg.sway.enable = mkEnableOption "Enable my default Gnome3 setup";
}; };
+2 -1
View File
@@ -3,7 +3,8 @@
let let
cfg = config.greg.syncthing; cfg = config.greg.syncthing;
in in
with lib; { with lib;
{
options.greg.syncthing = { options.greg.syncthing = {
enable = mkEnableOption "Setup my personal minimal configuration for Syncthing"; enable = mkEnableOption "Setup my personal minimal configuration for Syncthing";
}; };
+6 -1
View File
@@ -1,4 +1,9 @@
{ pkgs, lib, config, ... }: {
pkgs,
lib,
config,
...
}:
let let
cfg = config.greg.vmdev; cfg = config.greg.vmdev;
+18 -18
View File
@@ -1,24 +1,26 @@
{ lib {
, stdenv lib,
, python3 stdenv,
, fetchFromGitHub python3,
, installShellFiles fetchFromGitHub,
installShellFiles,
}: }:
with python3.pkgs; with python3.pkgs;
let let
runtimeDeps = ps: with ps; [ runtimeDeps =
certifi ps:
setuptools with ps;
pip [
virtualenv certifi
virtualenv-clone setuptools
] pip
++ lib.optionals stdenv.hostPlatform.isAndroid [ virtualenv
pyjnius virtualenv-clone
]; ]
++ lib.optionals stdenv.hostPlatform.isAndroid [ pyjnius ];
pythonEnv = python3.withPackages runtimeDeps; pythonEnv = python3.withPackages runtimeDeps;
@@ -71,9 +73,7 @@ buildPythonApplication rec {
"test_download_file" "test_download_file"
]; ];
disabledTestPaths = [ disabledTestPaths = [ "tests/integration" ];
"tests/integration"
];
postInstall = '' postInstall = ''
installShellCompletion --cmd pipenv \ installShellCompletion --cmd pipenv \
+7 -9
View File
@@ -1,9 +1,9 @@
{ lib {
, buildPythonPackage lib,
, fetchFromGitHub buildPythonPackage,
, toPythonModule fetchFromGitHub,
, pipenv toPythonModule,
, pipenv,
}: }:
buildPythonPackage rec { buildPythonPackage rec {
@@ -19,9 +19,7 @@ buildPythonPackage rec {
doCheck = false; doCheck = false;
dependencies = [ dependencies = [ (toPythonModule pipenv) ];
(toPythonModule pipenv)
];
meta = with lib; { meta = with lib; {
description = "Auto pipenv support for Xonsh"; description = "Auto pipenv support for Xonsh";
+8 -2
View File
@@ -5,7 +5,14 @@ let
genesis = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEI9jbTPmEWQ0F2bLYmnIOLmBnag1fkKxHRjz3X8lB/k root@genesis"; genesis = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEI9jbTPmEWQ0F2bLYmnIOLmBnag1fkKxHRjz3X8lB/k root@genesis";
hosea = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKLIwkTTXA56sUlUjEulXXZRvZy5H4a5ZwgKWLlpkQDz"; hosea = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKLIwkTTXA56sUlUjEulXXZRvZy5H4a5ZwgKWLlpkQDz";
jeremiah = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOjQjXq9WYU2Ki27BR9WwJ4ZruS/lJXbjC1b0Q42Adi0"; jeremiah = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOjQjXq9WYU2Ki27BR9WwJ4ZruS/lJXbjC1b0Q42Adi0";
systems = [ genesis linode jude myself hosea jeremiah ]; systems = [
genesis
linode
jude
myself
hosea
jeremiah
];
user_genesis_virt = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFWPSFQT0AH77wrwRhiskcBS0w4ZakBRdJywYYBsnm3S greg@genesis"; user_genesis_virt = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFWPSFQT0AH77wrwRhiskcBS0w4ZakBRdJywYYBsnm3S greg@genesis";
user_ivr = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMYzms+KIe5/bYF3uCyFjA5e1AgMPLIA3c4k417coqBe gregory.hellings@ls23003"; user_ivr = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMYzms+KIe5/bYF3uCyFjA5e1AgMPLIA3c4k417coqBe gregory.hellings@ls23003";
@@ -44,7 +51,6 @@ in
"restic-env.age".publicKeys = everyone; "restic-env.age".publicKeys = everyone;
"restic-pw.age".publicKeys = everyone; "restic-pw.age".publicKeys = everyone;
"dendrite.age".publicKeys = everyone; "dendrite.age".publicKeys = everyone;
"dendrite_key.age".publicKeys = everyone; "dendrite_key.age".publicKeys = everyone;
"gitlab/secret.age".publicKeys = everyone; "gitlab/secret.age".publicKeys = everyone;