A complete reformatting to match nixpkgs-fmt

This commit is contained in:
Greg Hellings
2024-10-03 11:26:39 -05:00
parent e2f0856102
commit 78c802d32c
114 changed files with 5246 additions and 5089 deletions
+1
View File
@@ -1,2 +1,3 @@
host host
result result
.pre-commit-config.yaml
+8 -6
View File
@@ -1,20 +1,22 @@
{ {
fsid = "749bf0ea-acf5-4a5e-b33e-9a057455c06b"; fsid = "749bf0ea-acf5-4a5e-b33e-9a057455c06b";
clusterName = "home"; clusterName = "home";
initialMonitors = [ { initialMonitors = [{
hostname = "myself.thehellings.lan"; hostname = "myself.thehellings.lan";
ipAddress = "10.42.1.6"; ipAddress = "10.42.1.6";
} { }
{
hostname = "jeremiah.thehellings.lan"; hostname = "jeremiah.thehellings.lan";
ipAddress = "10.42.1.8"; ipAddress = "10.42.1.8";
} { }
{
hostname = "hosea.thehellings.lan"; hostname = "hosea.thehellings.lan";
ipAddress = "10.42.1.7"; ipAddress = "10.42.1.7";
} ]; }];
mdsNodes = [ { mdsNodes = [{
hostname = "jeremiah.thehellings.lan"; hostname = "jeremiah.thehellings.lan";
ipAddress = "10.42.1.8"; 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;
+1
View File
@@ -4,6 +4,7 @@
pre-commit-check = hooks.lib.${system}.run { pre-commit-check = hooks.lib.${system}.run {
src = ./.; src = ./.;
hooks = { hooks = {
nixpkgs-fmt.enable = true;
}; };
}; };
} }
+2 -1
View File
@@ -6,7 +6,8 @@
{ {
imports = imports =
[ # Include the results of the hardware scan. [
# Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./modules/ ./modules/
]; ];
+10 -8
View File
@@ -1,17 +1,18 @@
{ inputs, overlays, ... }: { inputs, overlays, ... }:
let let
mac = { mac =
system ? "aarch64-darwin", { system ? "aarch64-darwin"
name, , name
channel ? inputs.nixunstable, , channel ? inputs.nixunstable
hm ? inputs.hmunstable, , hm ? inputs.hmunstable
extraMods ? [] , extraMods ? [ ]
}: }:
let let
nixpkgs = import channel { nixpkgs = import channel {
inherit system overlays; inherit system overlays;
}; };
in inputs.darwin.lib.darwinSystem { in
inputs.darwin.lib.darwinSystem {
inherit system; inherit system;
specialArgs = { inherit nixpkgs; }; specialArgs = { inherit nixpkgs; };
modules = [ modules = [
@@ -27,7 +28,8 @@ let
./${name} ./${name}
] ++ extraMods; ] ++ extraMods;
}; };
in rec { in
rec {
la23002 = mac { name = "ivr"; }; la23002 = mac { name = "ivr"; };
LA23002 = la23002; LA23002 = la23002;
} }
+7 -4
View File
@@ -40,17 +40,19 @@
zed.url = "github:zed-industries/zed/v0.154.x"; zed.url = "github:zed-industries/zed/v0.154.x";
}; };
outputs = { self, ...}@inputs: let outputs = { self, ... }@inputs:
let
local_overlay = import ./overlays; local_overlay = import ./overlays;
overlays = [ overlays = [
inputs.agenix.overlays.default inputs.agenix.overlays.default
local_overlay local_overlay
inputs.nurpkgs.overlay inputs.nurpkgs.overlay
inputs.vsext.overlays.default inputs.vsext.overlays.default
(_: _: { zed-editor = inputs.zed.packages.x86_64-linux.default; } ) (_: _: { zed-editor = inputs.zed.packages.x86_64-linux.default; })
]; ];
in inputs.flake-parts.lib.mkFlake { inherit inputs; } { in
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
#checks = { #checks = {
# x86_64-linux = { # x86_64-linux = {
@@ -76,7 +78,7 @@
modules = import ./modules; modules = import ./modules;
}; };
perSystem = { pkgs, system, ... }: { perSystem = { pkgs, self', system, ... }: {
_module.args.pkgs = import inputs.nixstable { _module.args.pkgs = import inputs.nixstable {
inherit system overlays; inherit system overlays;
}; };
@@ -85,6 +87,7 @@
devShells = { devShells = {
default = pkgs.mkShell { default = pkgs.mkShell {
inherit (self'.checks.pre-commit-check) shellHook;
buildInputs = with pkgs; [ buildInputs = with pkgs; [
bashInteractive bashInteractive
curl curl
+6 -3
View File
@@ -5,7 +5,8 @@
{ {
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" ];
@@ -14,13 +15,15 @@
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";
}; };
+5 -5
View File
@@ -1,7 +1,6 @@
{ { inputs
inputs, , overlays
overlays, , ...
...
}: }:
rec { rec {
@@ -9,7 +8,8 @@ rec {
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = (import inputs.nixunstable { inherit system overlays; }); pkgs = (import inputs.nixunstable { inherit system overlays; });
in inputs.hmunstable.lib.homeManagerConfiguration { in
inputs.hmunstable.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = [ ./home.nix ]; modules = [ ./home.nix ];
extraSpecialArgs = { extraSpecialArgs = {
+6 -4
View File
@@ -1,7 +1,9 @@
{ pkgs, lib, { pkgs
host ? "most", , lib
nixvim, , host ? "most"
...}: , nixvim
, ...
}:
{ {
nixpkgs.config.allowUnfreePredicate = (_: true); nixpkgs.config.allowUnfreePredicate = (_: true);
+1 -3
View File
@@ -1,5 +1,3 @@
{ ... }: { ... }:
{ { }
}
+4 -3
View File
@@ -1,10 +1,10 @@
{ pkgs, lib, inputs, ...}: { pkgs, lib, inputs, ... }:
let let
nix23 = import inputs.nix23_05 { nix23 = import inputs.nix23_05 {
inherit (pkgs.stdenv) system; inherit (pkgs.stdenv) system;
overlays = [ inputs.self.overlays.default ]; overlays = [ inputs.self.overlays.default ];
}; };
py = nix23.python311.withPackages ( p: with p; [ py = nix23.python311.withPackages (p: with p; [
django django
djangorestframework djangorestframework
django-rapyd-modernauth django-rapyd-modernauth
@@ -22,7 +22,8 @@ let
pkgs.pipenv-ivr pkgs.pipenv-ivr
]); ]);
}; };
in { in
{
greg = { greg = {
development = true; development = true;
gui = true; gui = true;
+20 -20
View File
@@ -2,27 +2,27 @@
{ {
home.file.".ansible.cfg".text = '' home.file.".ansible.cfg".text = ''
[defaults] [defaults]
forks=10 forks=10
host_key_checking=False host_key_checking=False
# Also available: profile_roles # Also available: profile_roles
callback_enabled=timer,profile_tasks callback_enabled=timer,profile_tasks
stdout_callback=yaml stdout_callback=yaml
nocows=1 nocows=1
cow_selection=tux cow_selection=tux
collections_path=~/src collections_path=~/src
[ssh_connection] [ssh_connection]
pipelining=True pipelining=True
ssh_args = -o ControlMaster=auto -o ControlPersist=600s -o IdentitiesOnly=yes -o GSSAPIAuthentication=no -o StrictHostKeyChecking=no ssh_args = -o ControlMaster=auto -o ControlPersist=600s -o IdentitiesOnly=yes -o GSSAPIAuthentication=no -o StrictHostKeyChecking=no
control_path=%(directory)s/%%h-%%r control_path=%(directory)s/%%h-%%r
control_path_dir=/tmp control_path_dir=/tmp
[callback_profile_tasks] [callback_profile_tasks]
sort_order=descending sort_order=descending
[galaxy] [galaxy]
role_skeleton_ignore = ^.git$,^.*/.git_keep$,\..*.swp role_skeleton_ignore = ^.git$,^.*/.git_keep$,\..*.swp
role_skeleton = ~/src/ansible_collections/meta_ansible_templates/role role_skeleton = ~/src/ansible_collections/meta_ansible_templates/role
''; '';
} }
+19 -19
View File
@@ -23,7 +23,7 @@
yaml2js = "python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)"; yaml2js = "python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)";
}; };
sessionVariables = { sessionVariables = {
ANSIBLE_COLLECTIONS_PATH="\${HOME}/src/"; ANSIBLE_COLLECTIONS_PATH = "\${HOME}/src/";
CLICOLOR = "1"; CLICOLOR = "1";
EDITOR = "${pkgs.vim}/bin/vim"; EDITOR = "${pkgs.vim}/bin/vim";
GIT_SSL_NO_VERIFY = "True"; GIT_SSL_NO_VERIFY = "True";
@@ -34,41 +34,41 @@
TIMEFORMAT = "%3Uu %3Ss %3lR %P%%"; TIMEFORMAT = "%3Uu %3Ss %3lR %P%%";
}; };
profileExtra = '' profileExtra = ''
if [ -e /etc/profile ]; then if [ -e /etc/profile ]; then
. /etc/profile . /etc/profile
fi fi
''; '';
bashrcExtra = '' bashrcExtra = ''
function swordtag { function swordtag {
if [ x"$1" == "x" ]; then if [ x"$1" == "x" ]; then
echo "Please provide tag version" echo "Please provide tag version"
return return
fi fi
svn cp http://crosswire.org/svn/sword/branches/sword-1-8-x/ http://crosswire.org/svn/sword/tags/sword-$1/ svn cp http://crosswire.org/svn/sword/branches/sword-1-8-x/ http://crosswire.org/svn/sword/tags/sword-$1/
} }
function newdock { function newdock {
if [ x"$1" == "x" -o x"$2" == "x" ]; then if [ x"$1" == "x" -o x"$2" == "x" ]; then
echo "expected arguments [name] [source]" echo "expected arguments [name] [source]"
return return
fi fi
podman run -P --privileged=true -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v "$(pwd):/dmnt" -t -i --name="$1" "$2" /bin/bash podman run -P --privileged=true -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v "$(pwd):/dmnt" -t -i --name="$1" "$2" /bin/bash
} }
function rundock { function rundock {
podman start -a -i "$1" podman start -a -i "$1"
} }
function ac { function ac {
source ~/venv/''${1}/bin/activate source ~/venv/''${1}/bin/activate
} }
function py2env { function py2env {
/usr/bin/virtualenv -p /usr/bin/python2 "''${HOME}/venv/''${1}" /usr/bin/virtualenv -p /usr/bin/python2 "''${HOME}/venv/''${1}"
"''${HOME}/venv/''${1}/bin/pip" install -U pip "''${HOME}/venv/''${1}/bin/pip" install -U pip
} }
function py3env { function py3env {
VENV_NAME="''${1}" VENV_NAME="''${1}"
#PYVERSION="$(python3 -c "import sys;print(sys.version[:sys.version.find('.',2)])")" #PYVERSION="$(python3 -c "import sys;print(sys.version[:sys.version.find('.',2)])")"
#SITE_PACKAGES_PATH="/usr/lib64/python''${PYVERSION}/site-packages/" #SITE_PACKAGES_PATH="/usr/lib64/python''${PYVERSION}/site-packages/"
@@ -83,11 +83,11 @@ function py3env {
#else #else
# echo "ERROR: LibSELinux not found for Python ''${PYVERSION}. Install system package to enable." # echo "ERROR: LibSELinux not found for Python ''${PYVERSION}. Install system package to enable."
#fi #fi
} }
function unknown_host { function unknown_host {
sed -i -e ''${1}d ~/.ssh/known_hosts sed -i -e ''${1}d ~/.ssh/known_hosts
} }
''; '';
}; };
} }
+3 -1
View File
@@ -13,7 +13,9 @@
amend = "commit --amend"; amend = "commit --amend";
}; };
ignores = [ ignores = [
".*.swp" ".*.swo" ".*.swn" # vim ".*.swp"
".*.swo"
".*.swn" # vim
".idea" # IntelliJ ".idea" # IntelliJ
".DS_Store" # Macs ".DS_Store" # Macs
"Thumbs.db" # Windows "Thumbs.db" # Windows
+7 -6
View File
@@ -11,26 +11,27 @@
enable = true; enable = true;
serverAliveInterval = 60; serverAliveInterval = 60;
includes = ["config.local"]; includes = [ "config.local" ];
matchBlocks = matchBlocks =
let let
nas = { user = "admin"; }; nas = { user = "admin"; };
owned = { user = "greg"; }; 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;
"nas.thehellings.lan" = nas; "nas.thehellings.lan" = nas;
"nas.greg-hellings.gmail.com.beta.tailscale.net" = nas; "nas.greg-hellings.gmail.com.beta.tailscale.net" = nas;
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" = {
+10 -7
View File
@@ -49,18 +49,22 @@ in
wrap = false; wrap = false;
writebackup = false; writebackup = false;
}; };
keymaps = let keymaps =
let
winMove = key: { mode = "n"; key = "<C-${key}>"; action = "<C-w>${key}<C-w><CR>"; }; winMove = key: { mode = "n"; key = "<C-${key}>"; action = "<C-w>${key}<C-w><CR>"; };
in [ { in
[{
mode = "n"; mode = "n";
key = "<C-e>"; key = "<C-e>";
action = "<Esc>:BufExplorer<CR>"; action = "<Esc>:BufExplorer<CR>";
} { }
{
mode = "n"; mode = "n";
key = "<C-t>"; key = "<C-t>";
#action = "<Esc>:NERDTreeToggle<CR>"; #action = "<Esc>:NERDTreeToggle<CR>";
action = "<Esc>:Neotree toggle<CR>"; action = "<Esc>:Neotree toggle<CR>";
} { }
{
mode = "n"; mode = "n";
key = "<C-g>"; key = "<C-g>";
action = "<Esc>:Neotree float git_status toggle<CR>"; action = "<Esc>:Neotree float git_status toggle<CR>";
@@ -68,8 +72,7 @@ in
(winMove "h") (winMove "h")
(winMove "j") (winMove "j")
(winMove "k") (winMove "k")
(winMove "l") (winMove "l")];
];
plugins = { plugins = {
airline.enable = true; airline.enable = true;
cmp = { cmp = {
@@ -126,7 +129,7 @@ in
neo-tree.enable = true; neo-tree.enable = true;
notify.enable = true; notify.enable = true;
web-devicons.enable = true; web-devicons.enable = true;
} // (lib.mkIf (lib.versionAtLeast config.system.nixos.release "24.11") {}); } // (lib.mkIf (lib.versionAtLeast config.system.nixos.release "24.11") { });
extraConfigLua = builtins.replaceStrings [ "@git@" ] [ "${pkgs.git}/bin/git" ] (builtins.readFile ./vim/extra.lua); extraConfigLua = builtins.replaceStrings [ "@git@" ] [ "${pkgs.git}/bin/git" ] (builtins.readFile ./vim/extra.lua);
extraConfigVim = builtins.readFile ./vim/extra.vimrc; extraConfigVim = builtins.readFile ./vim/extra.vimrc;
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = with pkgs.vimPlugins; [
+2 -1
View File
@@ -15,7 +15,8 @@ let
process-compose process-compose
zed-editor zed-editor
]; ];
in with lib; { in
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 {
+7 -6
View File
@@ -4,11 +4,12 @@ let
gv = lib.hm.gvariant; gv = lib.hm.gvariant;
cfg = config.greg.gnome; cfg = config.greg.gnome;
in { 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 = (lib.mkIf cfg {
programs.gnome-terminal = lib.mkIf ( pkgs.system != "x86_64-darwin") { programs.gnome-terminal = lib.mkIf (pkgs.system != "x86_64-darwin") {
enable = true; enable = true;
showMenubar = true; showMenubar = true;
themeVariant = "dark"; themeVariant = "dark";
@@ -37,13 +38,13 @@ in {
lock-enabled = false; lock-enabled = false;
}; };
"org/gnome/desktop/wm/keybindings" = { "org/gnome/desktop/wm/keybindings" = {
switch-applications = []; switch-applications = [ ];
switch-applications-backward = []; switch-applications-backward = [ ];
switch-windows = ["<Alt>Tab"]; switch-windows = [ "<Alt>Tab" ];
switch-windows-backward = [ "<Shift><Alt>Tab" ]; switch-windows-backward = [ "<Shift><Alt>Tab" ];
}; };
"org/gnome/desktop/wm/preferences" = { "org/gnome/desktop/wm/preferences" = {
button-layout="icon:minimize,maximize,close"; button-layout = "icon:minimize,maximize,close";
}; };
"org/gnome/file-roller/listing" = { "org/gnome/file-roller/listing" = {
list-mode = "as-folder"; list-mode = "as-folder";
+6 -5
View File
@@ -4,7 +4,7 @@ let
cfg = config.greg.gui; cfg = config.greg.gui;
excludes = systems: opts: ( excludes = systems: opts: (
if ( builtins.all (x: pkgs.system != x) systems ) then opts else [] if (builtins.all (x: pkgs.system != x) systems) then opts else [ ]
); );
# For now, we ignore this and don't install it # For now, we ignore this and don't install it
@@ -13,12 +13,13 @@ let
vars = { vars = {
XDG_CURRENT_DESKTOP = "GNOME"; XDG_CURRENT_DESKTOP = "GNOME";
}; };
in { in
{
options.greg.gui = lib.mkEnableOption "Enable GUI programs"; options.greg.gui = lib.mkEnableOption "Enable GUI programs";
config = (lib.mkIf cfg { config = (lib.mkIf cfg {
# These packages are Linux only # These packages are Linux only
home.packages = with pkgs; ( excludes ["x86_64-darwin" "aarch64-darwin"] home.packages = with pkgs; (excludes [ "x86_64-darwin" "aarch64-darwin" ]
[ [
cdrtools cdrtools
element-desktop element-desktop
@@ -29,7 +30,7 @@ in {
]) ++ ]) ++
# x86_64-linux only # x86_64-linux only
( excludes ["x86_64-darwin" "aarch64-darwin" "aarch64-linux"] (excludes [ "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ]
[ [
bitwarden bitwarden
discord discord
@@ -42,7 +43,7 @@ in {
]) ++ ]) ++
# Items that are not supported on ARM/Linux # Items that are not supported on ARM/Linux
( excludes ["aarch64-linux"] (excludes [ "aarch64-linux" ]
[ [
onlyoffice-bin onlyoffice-bin
synology-drive-client synology-drive-client
+90 -60
View File
@@ -1,137 +1,167 @@
[ { [{
name = "Toolbar"; name = "Toolbar";
toolbar = true; toolbar = true;
bookmarks = [ { bookmarks = [{
name = "Ansible"; name = "Ansible";
bookmarks = [ { bookmarks = [{
name = "Collection Index"; name = "Collection Index";
url = "https://docs.ansible.com/ansible/latest/collections/index.html"; url = "https://docs.ansible.com/ansible/latest/collections/index.html";
} ]; }];
} { }
{
name = "Church"; name = "Church";
bookmarks = [ { bookmarks = [{
name = "DC4K"; name = "DC4K";
url = "https://www.dc4k.org/leaderzone/articles"; url = "https://www.dc4k.org/leaderzone/articles";
} ]; }];
} { }
{
name = "IVR"; name = "IVR";
bookmarks = [ { bookmarks = [{
name = "Dev"; name = "Dev";
bookmarks = [ { bookmarks = [{
name = "Core Survey"; name = "Core Survey";
url = "https://webdev5.ivrtechnology.com/coreservices/survey/admin/"; url = "https://webdev5.ivrtechnology.com/coreservices/survey/admin/";
} { }
{
name = "Audio"; name = "Audio";
url = "https://apidev1.ivrtechnology.com/coreservices/audio/admin/"; url = "https://apidev1.ivrtechnology.com/coreservices/audio/admin/";
} ]; }];
} { }
{
name = "HC"; name = "HC";
bookmarks = [ { bookmarks = [{
name = "Audio"; name = "Audio";
url = "https://hcweb3.ivrtechnology.com/coreservices/audio/admin/"; url = "https://hcweb3.ivrtechnology.com/coreservices/audio/admin/";
} { }
{
name = "Survey"; name = "Survey";
url = "https://hcweb2.ivrtechnology.com/coreservices/survey/admin/"; url = "https://hcweb2.ivrtechnology.com/coreservices/survey/admin/";
} ]; }];
} { }
{
name = "PCI"; name = "PCI";
bookmarks = [ { bookmarks = [{
name = "Audio"; name = "Audio";
url = "https://pciweb3.ivrtechnology.com/coreservices/audio/admin/"; url = "https://pciweb3.ivrtechnology.com/coreservices/audio/admin/";
} ]; }];
} { }
{
name = "Processes"; name = "Processes";
bookmarks = [ { bookmarks = [{
name = "Change Management"; name = "Change Management";
url = "https://ivrtg.atlassian.net/wiki/spaces/ITS/pages/13094842/Executing+Change+Management"; url = "https://ivrtg.atlassian.net/wiki/spaces/ITS/pages/13094842/Executing+Change+Management";
} { }
{
name = "Okta"; name = "Okta";
url = "https://engagesmart.okta.com/"; url = "https://engagesmart.okta.com/";
} { }
{
name = "DB Request"; name = "DB Request";
url = "https://ivrtg.aha.io/develop/features/INFR-1073"; url = "https://ivrtg.aha.io/develop/features/INFR-1073";
} ]; }];
} ]; }];
} { }
{
name = "Katie"; name = "Katie";
bookmarks = [ { bookmarks = [{
name = "Sports Forms"; name = "Sports Forms";
url = "https://midlothianisd.rankone.com/New/NewStudentList.aspx"; url = "https://midlothianisd.rankone.com/New/NewStudentList.aspx";
} { }
{
name = "Skyward"; name = "Skyward";
url = "https://skyward.iscorp.com/MidlothianISDTXStuSTS/Session/Signin?area=Home&controller=Home&action=Index&logoutreason=TimedOut"; url = "https://skyward.iscorp.com/MidlothianISDTXStuSTS/Session/Signin?area=Home&controller=Home&action=Index&logoutreason=TimedOut";
} ]; }];
} { }
{
name = "Nix"; name = "Nix";
bookmarks = [ { bookmarks = [{
name = "Package Versions"; name = "Package Versions";
url = "https://lazamar.co.uk/nix-versions/?channel=nixpkgs-unstable&package=python3"; url = "https://lazamar.co.uk/nix-versions/?channel=nixpkgs-unstable&package=python3";
} { }
{
name = "Channel status"; name = "Channel status";
url = "https://status.nixos.org/"; url = "https://status.nixos.org/";
} { }
{
name = "Home Manager options"; name = "Home Manager options";
url = "https://nix-community.github.io/home-manager/options.xhtml"; url = "https://nix-community.github.io/home-manager/options.xhtml";
} { }
{
name = "Flake Parts"; name = "Flake Parts";
url = "https://community.flake.parts/"; url = "https://community.flake.parts/";
} { }
{
name = "Language ref"; name = "Language ref";
url = "https://nix.dev/manual/nix/latest/language/index.html"; url = "https://nix.dev/manual/nix/latest/language/index.html";
} { }
{
name = "Builtin functions"; name = "Builtin functions";
url = "https://nix.dev/manual/nix/latest/language/builtins.html"; url = "https://nix.dev/manual/nix/latest/language/builtins.html";
} { }
{
name = "Nixpkgs functions"; name = "Nixpkgs functions";
url = "https://ryantm.github.io/nixpkgs/functions/library/strings/#sec-functions-library-strings"; url = "https://ryantm.github.io/nixpkgs/functions/library/strings/#sec-functions-library-strings";
} { }
{
name = "NUR search"; name = "NUR search";
url = "https://nur.nix-community.org/"; url = "https://nur.nix-community.org/";
} ]; }];
} { }
{
name = "Rust"; name = "Rust";
bookmarks = [ { bookmarks = [{
name = "Learn Rust"; name = "Learn Rust";
url = "https://www.rust-lang.org/learn"; url = "https://www.rust-lang.org/learn";
} { }
{
name = "Rust by Example"; name = "Rust by Example";
url = "https://doc.rust-lang.org/rust-by-example/hello.html"; url = "https://doc.rust-lang.org/rust-by-example/hello.html";
} { }
{
name = "Iced"; name = "Iced";
url = "https://docs.rs/iced/latest/iced/"; url = "https://docs.rs/iced/latest/iced/";
} ]; }];
} { }
{
name = "Shopping"; name = "Shopping";
bookmarks = [ { bookmarks = [{
name = "Cables"; name = "Cables";
url = "https://www.pchcables.com"; url = "https://www.pchcables.com";
} ]; }];
} { }
{
name = "SubTo"; name = "SubTo";
bookmarks = [ { bookmarks = [{
name = "Kajabi"; name = "Kajabi";
url = "https://www.subtocourse.com/login"; url = "https://www.subtocourse.com/login";
} { }
{
name = "SubTo Fund"; name = "SubTo Fund";
url = "https://frontend.koreconx.com/auth/login"; url = "https://frontend.koreconx.com/auth/login";
} { }
{
name = "Creive Title"; name = "Creive Title";
url = "https://getcreativetitle.com/"; url = "https://getcreativetitle.com/";
} { }
{
name = "REI Scripts"; name = "REI Scripts";
url = "https://reiconveyorbelt.com/no-excuses/"; url = "https://reiconveyorbelt.com/no-excuses/";
} ]; }];
} { }
{
name = "Tools"; name = "Tools";
bookmarks = [ { bookmarks = [{
name = "Password Hash"; name = "Password Hash";
url = "https://unix4lyfe.org/crypt/"; url = "https://unix4lyfe.org/crypt/";
} { }
{
name = "Keymap editor"; name = "Keymap editor";
url = "https://nickcoutsos.github.io/keymap-editor/"; url = "https://nickcoutsos.github.io/keymap-editor/";
} { }
{
name = "Bitcoin dashboard"; name = "Bitcoin dashboard";
url = "http://hosea.home:60845"; url = "http://hosea.home:60845";
} ]; }];
} ]; }];
} ] }]
+6 -3
View File
@@ -23,15 +23,18 @@ let
"${sleep} 5" "${sleep} 5"
"${msg} \"workspace 2 ; exec ${term} ; layout tabbed\"" "${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 = (lib.mkIf cfg {
programs.swaylock.enable = true; programs.swaylock.enable = true;
wayland.windowManager.sway = let wayland.windowManager.sway =
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;
+2 -1
View File
@@ -2,7 +2,8 @@
let let
cfg = config.greg.vscodium; cfg = config.greg.vscodium;
in { in
{
options.greg.vscodium = lib.mkEnableOption "Enable installation of VSCodium on the host"; options.greg.vscodium = lib.mkEnableOption "Enable installation of VSCodium on the host";
config = lib.mkIf cfg { config = lib.mkIf cfg {
+19 -13
View File
@@ -3,14 +3,15 @@
let let
cfg = config.programs.xonsh; cfg = config.programs.xonsh;
in with lib; { in
with lib; {
options = { options = {
programs.xonsh = { programs.xonsh = {
enable = mkEnableOption "Enable the xonsh program"; enable = mkEnableOption "Enable the xonsh program";
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.
@@ -19,7 +20,7 @@ in with lib; {
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";
@@ -62,13 +63,16 @@ in with lib; {
mapAttrsToList (k: v: "aliases['${k}']=r'${v}'") cfg.aliases mapAttrsToList (k: v: "aliases['${k}']=r'${v}'") cfg.aliases
); );
listToPythonList = let listToPythonList =
let
listInternals = args: listInternals = args:
concatStringsSep "\n" (map (v: "'${v}'") args); concatStringsSep "\n" (map (v: "'${v}'") args);
in list: "[${listInternals list}]"; in
list: "[${listInternals list}]";
sessionVars = concatStringsSep "\n" ( sessionVars = concatStringsSep "\n" (
mapAttrsToList (k: v: mapAttrsToList
(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
@@ -76,19 +80,21 @@ in with lib; {
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 mkIf cfg.enable { in
mkIf cfg.enable {
home.file.".xonshrc".text = '' home.file.".xonshrc".text = ''
${cfg.configHeader} ${cfg.configHeader}
${sessionVars} ${sessionVars}
${shortAliases} ${shortAliases}
${cfg.configFooter} ${cfg.configFooter}
''; '';
}; };
} }
+12 -9
View File
@@ -6,13 +6,14 @@ let
hm = inputs.hmunstable; hm = inputs.hmunstable;
nixvim = inputs.nixvimunstable; nixvim = inputs.nixvimunstable;
})); }));
machine = { machine =
channel ? inputs.nixstable, { channel ? inputs.nixstable
extraMods ? [], , extraMods ? [ ]
name, , name
system ? "x86_64-linux", , system ? "x86_64-linux"
hm ? inputs.hm, , hm ? inputs.hm
nixvim ? inputs.nixvimstable, , nixvim ? inputs.nixvimstable
,
}: }:
let let
nixpkgs = import channel { nixpkgs = import channel {
@@ -22,7 +23,8 @@ let
nurNoPkg = import inputs.nurpkgs { nurNoPkg = import inputs.nurpkgs {
nurpkgs = nixpkgs; nurpkgs = nixpkgs;
}; };
in channel.lib.nixosSystem { in
channel.lib.nixosSystem {
inherit system; inherit system;
specialArgs = { inherit nixpkgs inputs overlays; }; specialArgs = { inherit nixpkgs inputs overlays; };
modules = [ modules = [
@@ -47,7 +49,8 @@ let
./${name} ./${name}
] ++ extraMods; ] ++ extraMods;
}; };
in { in
{
genesis = machine { name = "genesis"; }; genesis = machine { name = "genesis"; };
exodus = unstable { name = "exodus"; }; exodus = unstable { name = "exodus"; };
jude = unstable { name = "jude"; }; jude = unstable { name = "jude"; };
+6 -3
View File
@@ -5,7 +5,8 @@
{ {
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" ];
@@ -14,13 +15,15 @@
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";
}; };
+5 -4
View File
@@ -4,7 +4,8 @@ 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 = {
file = ../../secrets/acme_password.age; file = ../../secrets/acme_password.age;
}; };
@@ -12,7 +13,7 @@ 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;
@@ -34,7 +35,7 @@ in {
dataSource = "/var/lib/step-ca/db"; dataSource = "/var/lib/step-ca/db";
badgerFileLoadingMode = ""; badgerFileLoadingMode = "";
}; };
authority.provisioners = [ { authority.provisioners = [{
type = "JWK"; type = "JWK";
name = "greg@thehellings.com"; name = "greg@thehellings.com";
key = { key = {
@@ -47,7 +48,7 @@ in {
y = "MEpqnJp60VV-SpFtb6m8U-VAYut7R_PKFm07xl7MjBk"; 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"
+5 -4
View File
@@ -5,7 +5,8 @@
{ {
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" ];
@@ -14,13 +15,13 @@
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
+4 -3
View File
@@ -34,8 +34,8 @@ in
]; ];
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" ];
@@ -81,7 +81,8 @@ in
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" "/dev/serial/by-id/usb-0658_0200-if00:/dev/zwave" "--device"
"/dev/serial/by-id/usb-0658_0200-if00:/dev/zwave"
"--pull=newer" "--pull=newer"
]; ];
environment = { environment = {
+10 -9
View File
@@ -17,7 +17,8 @@ let
"1.0.0.1" # Cloudflare "1.0.0.1" # Cloudflare
"149.112.112.112" # Quad 9 "149.112.112.112" # Quad 9
]; ];
in { in
{
greg.tailscale.enable = true; greg.tailscale.enable = true;
# Really, why do I still have to force-disable this crap? # Really, why do I still have to force-disable this crap?
@@ -36,18 +37,18 @@ in {
# This is our LAN port # This is our LAN port
"${lan}" = { "${lan}" = {
useDHCP = false; useDHCP = false;
ipv4.addresses = [ { ipv4.addresses = [{
address = "${lanIP}"; address = "${lanIP}";
prefixLength = 16; prefixLength = 16;
} ]; }];
}; };
"${iot}" = { "${iot}" = {
useDHCP = false; useDHCP = false;
ipv4.addresses = [ { ipv4.addresses = [{
address = "${iotIP}"; address = "${iotIP}";
prefixLength = 24; prefixLength = 24;
} ]; }];
}; };
}; };
firewall = { firewall = {
@@ -89,15 +90,15 @@ in {
######## ########
_3proxy = { _3proxy = {
enable = true; enable = true;
services = [ { services = [{
type = "socks"; type = "socks";
auth = [ "strong" ]; auth = [ "strong" ];
bindPort = proxyPort; bindPort = proxyPort;
acl = [ { acl = [{
rule = "allow"; rule = "allow";
users = [ "greg" ]; users = [ "greg" ];
} ]; }];
} ]; }];
#usersFile = "/run/agenix/3proxy"; #usersFile = "/run/agenix/3proxy";
denyPrivate = false; denyPrivate = false;
}; };
+2 -1
View File
@@ -2,7 +2,8 @@
let let
ip = "100.68.203.1"; ip = "100.68.203.1";
in { in
{
nix-bitcoin = { nix-bitcoin = {
generateSecrets = true; generateSecrets = true;
operator = { operator = {
+2 -1
View File
@@ -11,7 +11,8 @@ in
{ {
imports = imports =
[ # Include the results of the hardware scan. [
# Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
inputs.btc.nixosModules.default inputs.btc.nixosModules.default
./bitcoin.nix ./bitcoin.nix
+6 -3
View File
@@ -5,7 +5,8 @@
{ {
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" ];
@@ -14,13 +15,15 @@
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";
}; };
+1 -1
View File
@@ -1,4 +1,4 @@
{ pkgs, config, ...}: { pkgs, config, ... }:
{ {
# Bootloader. # Bootloader.
+3 -2
View File
@@ -5,7 +5,8 @@
{ config, pkgs, agenix, ... }: { config, pkgs, agenix, ... }:
{ {
imports = [ # Include the results of the hardware scan. imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./boot.nix ./boot.nix
./filesystem.nix ./filesystem.nix
@@ -19,6 +20,6 @@
isNormalUser = true; isNormalUser = true;
description = "Gregory Hellings"; description = "Gregory Hellings";
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; []; packages = with pkgs; [ ];
}; };
} }
+9 -6
View File
@@ -5,7 +5,8 @@
{ {
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" ];
@@ -14,24 +15,26 @@
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
+1 -1
View File
@@ -1,4 +1,4 @@
{...}: { ... }:
{ {
# Set your time zone. # Set your time zone.
+5 -4
View File
@@ -1,4 +1,4 @@
{...}: { ... }:
let let
dnsHosts = builtins.concatStringsSep "\n" [ dnsHosts = builtins.concatStringsSep "\n" [
"wiki.icdm.lan 10.42.101.1" "wiki.icdm.lan 10.42.101.1"
@@ -15,13 +15,14 @@ in
enableIPv6 = false; enableIPv6 = false;
interfaces = { interfaces = {
eno1.ipv4.addresses = [ { eno1.ipv4.addresses = [{
address = "10.42.101.1"; address = "10.42.101.1";
prefixLength = 16; prefixLength = 16;
} { }
{
address = "10.77.1.2"; address = "10.77.1.2";
prefixLength = 16; prefixLength = 16;
} ]; }];
}; };
# Allow traffic through # Allow traffic through
firewall = { firewall = {
+2 -1
View File
@@ -6,7 +6,8 @@ let
vip = (builtins.elemAt config.networking.interfaces.enp68s0.ipv4.addresses 1).address; vip = (builtins.elemAt config.networking.interfaces.enp68s0.ipv4.addresses 1).address;
hostname = config.networking.hostName; hostname = config.networking.hostName;
baseConfig = import ../../ceph/home.nix; baseConfig = import ../../ceph/home.nix;
in { in
{
services.ceph-benaco = baseConfig // { services.ceph-benaco = baseConfig // {
enable = false; enable = false;
monitor = { monitor = {
+8 -6
View File
@@ -6,7 +6,8 @@
{ {
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
@@ -31,19 +32,20 @@
}; };
interfaces = { interfaces = {
enp68s0 = { enp68s0 = {
ipv4.addresses = [ { ipv4.addresses = [{
address = "10.42.1.8"; address = "10.42.1.8";
prefixLength = 16; 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"; address = "10.201.1.2";
prefixLength = 24; prefixLength = 24;
} ]; }];
}; };
}; };
nameservers = [ nameservers = [
+6 -3
View File
@@ -5,7 +5,8 @@
{ {
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" ];
@@ -14,12 +15,14 @@
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";
}; };
+2 -1
View File
@@ -3,7 +3,8 @@
let let
minioPort = 9000; minioPort = 9000;
minioConsolePort = 9001; minioConsolePort = 9001;
in { in
{
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
minio-client minio-client
xfsprogs xfsprogs
+2 -1
View File
@@ -39,7 +39,8 @@
boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ]; boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
environment.systemPackages = with pkgs; lib.mkMerge [ environment.systemPackages = with pkgs; lib.mkMerge [
[ # for Immersed [
# for Immersed
cudatoolkit cudatoolkit
immersed-vr immersed-vr
libva libva
+4 -2
View File
@@ -5,7 +5,8 @@
{ {
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" ];
@@ -14,7 +15,8 @@
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";
}; };
+1 -1
View File
@@ -16,7 +16,7 @@
"${pkgs.kmod}/bin/modprobe vboxnetadp" "${pkgs.kmod}/bin/modprobe vboxnetadp"
]; ];
postStop = "${pkgs.kmod}/bin/rmmod vboxnetflt vboxnetadp vboxdrv"; postStop = "${pkgs.kmod}/bin/rmmod vboxnetflt vboxnetadp vboxdrv";
wantedBy = pkgs.lib.mkForce []; wantedBy = pkgs.lib.mkForce [ ];
serviceConfig.User = "root"; serviceConfig.User = "root";
}; };
}; };
+3 -2
View File
@@ -51,7 +51,7 @@
isSystemUser = true; isSystemUser = true;
group = "gitlab-runner"; group = "gitlab-runner";
}; };
users.groups.gitlab-runner = {}; users.groups.gitlab-runner = { };
systemd.services."gitlab-runner".serviceConfig = { systemd.services."gitlab-runner".serviceConfig = {
DynamicUser = lib.mkForce false; DynamicUser = lib.mkForce false;
@@ -63,7 +63,8 @@
commands = [{ commands = [{
command = "/run/current-system/sw/bin/systemctl"; command = "/run/current-system/sw/bin/systemctl";
options = [ "NOPASSWD" ]; options = [ "NOPASSWD" ];
} { }
{
command = "/run/current-system/sw/bin/podman"; command = "/run/current-system/sw/bin/podman";
options = [ "NOPASSWD" ]; options = [ "NOPASSWD" ];
}]; }];
+2 -1
View File
@@ -3,7 +3,8 @@
let let
srcDomain = "src.thehellings.com"; srcDomain = "src.thehellings.com";
sshPort = 2222; sshPort = 2222;
in { in
{
greg.proxies."${srcDomain}" = { greg.proxies."${srcDomain}" = {
target = "http://git.thehellings.lan"; target = "http://git.thehellings.lan";
ssl = true; ssl = true;
+11 -9
View File
@@ -21,10 +21,11 @@ in
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; ''
return 200 '${builtins.toJSON server}'; add_header Content-Type application/json;
''; return 200 '${builtins.toJSON server}';
'';
locations."= /.well-known/matrix/client".extraConfig = locations."= /.well-known/matrix/client".extraConfig =
let let
@@ -32,11 +33,12 @@ return 200 '${builtins.toJSON server}';
"m.homeserver" = { "base_url" = "https://${fqdn}"; }; "m.homeserver" = { "base_url" = "https://${fqdn}"; };
"m.identity_server" = { "base_url" = "https://vector.im"; }; "m.identity_server" = { "base_url" = "https://vector.im"; };
}; };
in '' in
add_header Content-Type application/json; ''
add_header Access-Control-Allow-Origin *; add_header Content-Type application/json;
return 200 '${builtins.toJSON client}'; add_header Access-Control-Allow-Origin *;
''; return 200 '${builtins.toJSON client}';
'';
}; };
# Reverse proxy in front of the actual Matrix server # Reverse proxy in front of the actual Matrix server
+4 -4
View File
@@ -17,10 +17,10 @@
# 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"; name = "nextcloud";
ensureDBOwnership = true; ensureDBOwnership = true;
} ]; }];
settings = { settings = {
log_connections = true; log_connections = true;
log_statement = "all"; log_statement = "all";
@@ -28,8 +28,8 @@
log_filename = "postgresql.log"; log_filename = "postgresql.log";
}; };
identMap = '' identMap = ''
root root postgres root root postgres
''; '';
}; };
services.postgresqlBackup = { services.postgresqlBackup = {
+2 -1
View File
@@ -6,7 +6,8 @@ let
vip = (builtins.elemAt config.networking.interfaces.enp38s0.ipv4.addresses 1).address; vip = (builtins.elemAt config.networking.interfaces.enp38s0.ipv4.addresses 1).address;
hostname = config.networking.hostName; hostname = config.networking.hostName;
baseConfig = import ../../ceph/home.nix; baseConfig = import ../../ceph/home.nix;
in { in
{
services.ceph-benaco = baseConfig // { services.ceph-benaco = baseConfig // {
enable = false; enable = false;
monitor = { monitor = {
+17 -11
View File
@@ -1,12 +1,16 @@
{ config, pkgs, lib, ... }: let { config, pkgs, lib, ... }:
let
registryPort = 5000; registryPort = 5000;
vpnIp = "100.78.226.76"; vpnIp = "100.78.226.76";
containerIp = "192.168.200.2"; containerIp = "192.168.200.2";
in { in
{
age.secretsMountPoint = "/run/derp"; age.secretsMountPoint = "/run/derp";
age.secrets = let age.secrets =
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";
gitlab-otp = cfg "otp"; gitlab-otp = cfg "otp";
gitlab-db = cfg "db"; gitlab-db = cfg "db";
@@ -30,7 +34,8 @@ in {
networking.firewall.allowedTCPPorts = [ 80 registryPort ]; networking.firewall.allowedTCPPorts = [ 80 registryPort ];
greg.proxies = let greg.proxies =
let
t = { t = {
target = "http://unix:/run/gitlab/gitlab-workhorse.socket"; target = "http://unix:/run/gitlab/gitlab-workhorse.socket";
extraConfig = '' extraConfig = ''
@@ -38,7 +43,8 @@ in {
proxy_set_header X-Forwarded-Ssl on; proxy_set_header X-Forwarded-Ssl on;
''; '';
}; };
in { in
{
"${containerIp}" = t; "${containerIp}" = t;
"${vpnIp}" = t; "${vpnIp}" = t;
"git.thehellings.lan" = t; "git.thehellings.lan" = t;
@@ -115,7 +121,7 @@ in {
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 (builtins.map (x: lib.attrsets.nameValuePair x { bucket = "gitlab-${builtins.replaceStrings [ "_" ] [ "-" ] x}"; }) [
"artifacts" "artifacts"
"ci_secure_files" "ci_secure_files"
"dependency_proxy" "dependency_proxy"
@@ -131,11 +137,11 @@ in {
}; };
nginx.virtualHosts."gitlab.shire-zebra.ts.net" = { nginx.virtualHosts."gitlab.shire-zebra.ts.net" = {
listen = [ { listen = [{
addr = vpnIp; addr = vpnIp;
port = registryPort; port = registryPort;
ssl = true; ssl = true;
} ]; }];
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:5000/"; proxyPass = "http://127.0.0.1:5000/";
recommendedProxySettings = true; recommendedProxySettings = true;
@@ -157,10 +163,10 @@ in {
enable = true; enable = true;
checkConfig = true; checkConfig = true;
ensureDatabases = [ "gitlab" ]; ensureDatabases = [ "gitlab" ];
ensureUsers = [ { ensureUsers = [{
name = "gitlab"; name = "gitlab";
ensureDBOwnership = true; ensureDBOwnership = true;
} ]; }];
settings = { settings = {
log_connections = true; log_connections = true;
log_statement = "all"; log_statement = "all";
+5 -4
View File
@@ -1,8 +1,9 @@
{ inputs, name, extra ? {}, packages ? [], overlays }: { inputs, name, extra ? { }, packages ? [ ], overlays }:
({ config, pkgs, lib, ... }: ({ config, pkgs, lib, ... }:
( (
lib.attrsets.recursiveUpdate { lib.attrsets.recursiveUpdate
{
imports = [ imports = [
inputs.agenix.nixosModules.default inputs.agenix.nixosModules.default
@@ -84,8 +85,8 @@ lib.attrsets.recursiveUpdate {
}; };
system.stateVersion = lib.mkForce "24.05"; system.stateVersion = lib.mkForce "24.05";
} }
extra extra
) # End of attrsets.recursiveUpdate ) # End of attrsets.recursiveUpdate
) # End of outter function wrapper ) # End of outter function wrapper
+6 -5
View File
@@ -28,19 +28,20 @@
}; };
interfaces = { interfaces = {
enp38s0 = { enp38s0 = {
ipv4.addresses = [ { ipv4.addresses = [{
address = "10.42.1.6"; address = "10.42.1.6";
prefixLength = 16; 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.1"; address = "10.201.1.1";
prefixLength = 24; prefixLength = 24;
} ]; }];
}; };
}; };
nameservers = [ nameservers = [
+6 -3
View File
@@ -4,12 +4,15 @@ let
gitlabStateDir = "/var/lib/gitlab"; gitlabStateDir = "/var/lib/gitlab";
container = input: (lib.attrsets.recursiveUpdate { container = input: (lib.attrsets.recursiveUpdate
{
bindMounts."/etc/ssh".hostPath = "/etc/ssh"; # For agenix secrets bindMounts."/etc/ssh".hostPath = "/etc/ssh"; # For agenix secrets
enableTun = true; enableTun = true;
privateNetwork = true; privateNetwork = true;
} input); }
in { input);
in
{
networking = { networking = {
firewall = { firewall = {
enable = true; enable = true;
+10 -5
View File
@@ -5,7 +5,8 @@
{ {
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" ];
@@ -14,24 +15,28 @@
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";
}; };
+5 -4
View File
@@ -29,13 +29,13 @@ in
isSystemUser = true; isSystemUser = true;
group = "dendrite"; group = "dendrite";
}; };
users.groups.dendrite = {}; users.groups.dendrite = { };
systemd.services.dendrite.serviceConfig = { systemd.services.dendrite.serviceConfig = {
User = "dendrite"; User = "dendrite";
}; };
greg.databases.dendrite = {}; greg.databases.dendrite = { };
services.dendrite = { services.dendrite = {
enable = true; enable = true;
@@ -54,7 +54,7 @@ in
"room_server" "room_server"
"sync_api" "sync_api"
]) ])
) ) // )) //
{ {
user_api.account_database.connection_string = conn; user_api.account_database.connection_string = conn;
user_api.device_database.connection_string = conn; user_api.device_database.connection_string = conn;
@@ -78,7 +78,8 @@ in
registration_enabled = false; registration_enabled = false;
registration_shared_secret = "\${REGISTRATION_SHARED_SECRET}"; registration_shared_secret = "\${REGISTRATION_SHARED_SECRET}";
}; };
}); }
);
}; };
systemd.services.dendrite = { systemd.services.dendrite = {
+2 -1
View File
@@ -3,7 +3,8 @@
let let
minioPort = 9000; minioPort = 9000;
minioConsolePort = 9001; minioConsolePort = 9001;
in { in
{
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
minio-client minio-client
xfsprogs xfsprogs
+2 -2
View File
@@ -16,8 +16,8 @@ in
experimental-features = "nix-command flakes"; experimental-features = "nix-command flakes";
keep-outputs = true; keep-outputs = true;
keep-derivations = true; keep-derivations = true;
min-free = (toString (1024 * 1024 * 1024) ); min-free = (toString (1024 * 1024 * 1024));
max-free = (toString (5 * 1024 * 1024 * 1024) ); max-free = (toString (5 * 1024 * 1024 * 1024));
substituters = [ substituters = [
"https://cache.garnix.io" "https://cache.garnix.io"
"https://ai.cachix.org" "https://ai.cachix.org"
+1 -1
View File
@@ -1,4 +1,4 @@
{...}: { ... }:
{ {
imports = [ imports = [
../baseline.nix ../baseline.nix
+2 -1
View File
@@ -1,7 +1,8 @@
let let
nixos = (import ./nixos); nixos = (import ./nixos);
darwin = (import ./darwin); darwin = (import ./darwin);
in { in
{
nixosModule = nixos; nixosModule = nixos;
darwinModule = darwin; darwinModule = darwin;
} }
+8 -5
View File
@@ -14,9 +14,11 @@ let
type = "sendonly"; type = "sendonly";
}; };
makeRestic = name: job: let makeRestic = name: job:
let
who = "${config.services.syncthing.user}:${config.services.syncthing.group}"; who = "${config.services.syncthing.user}:${config.services.syncthing.group}";
in rec { in
rec {
initialize = true; initialize = true;
passwordFile = config.age.secrets.restic-pw.path; passwordFile = config.age.secrets.restic-pw.path;
paths = [ job.src ]; paths = [ job.src ];
@@ -24,11 +26,12 @@ let
backupCleanupCommand = ''${pkgs.coreutils}/bin/chown -R ${who} "${repository}"''; backupCleanupCommand = ''${pkgs.coreutils}/bin/chown -R ${who} "${repository}"'';
}; };
in with lib; { in
with lib; {
options = { options = {
greg.backup = { greg.backup = {
jobs = mkOption { jobs = mkOption {
default = {}; default = { };
type = with types; attrsOf (submodule ( type = with types; attrsOf (submodule (
{ name, config, options, ... }: { name, config, options, ... }:
@@ -54,7 +57,7 @@ in with lib; {
}; };
}; };
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;
+58 -46
View File
@@ -8,11 +8,13 @@ let
cfg = config.services.ceph-benaco; cfg = config.services.ceph-benaco;
commaSep = builtins.concatStringsSep ","; commaSep = builtins.concatStringsSep ",";
ensureUnitExists = c': name: let ensureUnitExists = c': name:
let
unitName = (builtins.elemAt (builtins.split "\\." name) 0); unitName = (builtins.elemAt (builtins.split "\\." name) 0);
in if c'.systemd.services ? unitName in
if c'.systemd.services ? unitName
then name then name
else name;# "Unable to locate ${name} at ${commaSep (builtins.attrNames c')}"; else name; # "Unable to locate ${name} at ${commaSep (builtins.attrNames c')}";
in in
{ {
@@ -143,7 +145,7 @@ in
}; };
osds = mkOption { osds = mkOption {
default = {}; default = { };
example = { example = {
osd1 = { osd1 = {
enable = true; enable = true;
@@ -200,7 +202,7 @@ in
systemdExtraRequiresAfter = mkOption { systemdExtraRequiresAfter = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = []; default = [ ];
description = '' description = ''
Add the specified systemd units to the "requires" and "after" Add the specified systemd units to the "requires" and "after"
lists of the systemd service of this OSD. lists of the systemd service of this OSD.
@@ -325,7 +327,8 @@ in
###### implementation ###### implementation
config = let config =
let
monDir = "/var/lib/ceph/mon/${cfg.clusterName}-${cfg.monitor.nodeName}"; monDir = "/var/lib/ceph/mon/${cfg.clusterName}-${cfg.monitor.nodeName}";
mgrDir = "/var/lib/ceph/mgr/${cfg.clusterName}-${cfg.manager.nodeName}"; mgrDir = "/var/lib/ceph/mgr/${cfg.clusterName}-${cfg.manager.nodeName}";
mdsDir = "/var/lib/ceph/mds/${cfg.clusterName}-${cfg.mds.nodeName}"; mdsDir = "/var/lib/ceph/mds/${cfg.clusterName}-${cfg.mds.nodeName}";
@@ -361,7 +364,8 @@ in
cephMonitoringSudoersCommandsAndPackages = [ cephMonitoringSudoersCommandsAndPackages = [
{ {
package = pkgs.smartmontools; package = pkgs.smartmontools;
sudoersExtraRule = { # entry for `security.sudo.extraRules` sudoersExtraRule = {
# entry for `security.sudo.extraRules`
users = [ config.users.users.ceph.name ]; users = [ config.users.users.ceph.name ];
commands = [{ commands = [{
command = "${lib.getBin pkgs.smartmontools}/bin/smartctl -x --json=o /dev/*"; command = "${lib.getBin pkgs.smartmontools}/bin/smartctl -x --json=o /dev/*";
@@ -371,7 +375,8 @@ in
} }
{ {
package = pkgs.nvme-cli; package = pkgs.nvme-cli;
sudoersExtraRule = { # entry for `security.sudo.extraRules` sudoersExtraRule = {
# entry for `security.sudo.extraRules`
users = [ config.users.users.ceph.name ]; users = [ config.users.users.ceph.name ];
commands = [{ commands = [{
command = "${lib.getBin pkgs.nvme-cli}/bin/nvme * smart-log-add --json /dev/*"; command = "${lib.getBin pkgs.nvme-cli}/bin/nvme * smart-log-add --json /dev/*";
@@ -509,29 +514,32 @@ in
${lib.getLib cfg.package}/libexec/ceph/ceph-osd-prestart.sh --cluster ${cfg.clusterName} --id ${toString osdConfig.id} ${lib.getLib cfg.package}/libexec/ceph/ceph-osd-prestart.sh --cluster ${cfg.clusterName} --id ${toString osdConfig.id}
''; '';
serviceConfig = let serviceConfig =
let
clusterIpArg = lib.optionalString (osdConfig.clusterAddress != null) "--cluster_addr=${osdConfig.clusterAddress}"; clusterIpArg = lib.optionalString (osdConfig.clusterAddress != null) "--cluster_addr=${osdConfig.clusterAddress}";
in { in
LimitNOFILE="1048576"; {
LimitNPROC="1048576"; LimitNOFILE = "1048576";
LimitNPROC = "1048576";
ExecStart='' ExecStart = ''
${cfg.package}/bin/ceph-osd -f --cluster ${cfg.clusterName} --id ${toString osdConfig.id} --setuser ${config.users.users.ceph.name} --setgroup ${config.users.groups.ceph.name} "--public_bind_addr=${cfg.osdBindAddr}" "--public_addr=${cfg.osdAdvertisedPublicAddr}" "${clusterIpArg}" ${cfg.package}/bin/ceph-osd -f --cluster ${cfg.clusterName} --id ${toString osdConfig.id} --setuser ${config.users.users.ceph.name} --setgroup ${config.users.groups.ceph.name} "--public_bind_addr=${cfg.osdBindAddr}" "--public_addr=${cfg.osdAdvertisedPublicAddr}" "${clusterIpArg}"
''; '';
ExecReload='' ExecReload = ''
${pkgs.coreutils}/bin/kill -HUP $MAINPID ${pkgs.coreutils}/bin/kill -HUP $MAINPID
''; '';
Restart="on-failure"; Restart = "on-failure";
ProtectHome="true"; ProtectHome = "true";
ProtectSystem="full"; ProtectSystem = "full";
PrivateTmp="true"; PrivateTmp = "true";
TasksMax="infinity"; TasksMax = "infinity";
# StartLimitBurst="3"; # StartLimitBurst="3";
}; };
# startLimitIntervalSec = 30 * 60; # startLimitIntervalSec = 30 * 60;
}; };
in mkIf cfg.enable { in
mkIf cfg.enable {
environment.systemPackages = [ cfg.package ]; environment.systemPackages = [ cfg.package ];
networking.firewall = { networking.firewall = {
@@ -645,7 +653,8 @@ in
# The udevadm trigger/settle in `makeCephOsdSetupSystemdService` waits for these rules rule to be applied. # The udevadm trigger/settle in `makeCephOsdSetupSystemdService` waits for these rules rule to be applied.
services.udev.extraRules = services.udev.extraRules =
lib.concatStringsSep "\n" ( lib.concatStringsSep "\n" (
lib.mapAttrsToList (_localOsdServiceName: osdConfig: lib.mapAttrsToList
(_localOsdServiceName: osdConfig:
'' ''
SUBSYSTEM=="block", ${osdConfig.blockDeviceUdevRuleMatcher}, OWNER="${config.users.users.ceph.name}", GROUP="${config.users.groups.ceph.name}", MODE="0660" SUBSYSTEM=="block", ${osdConfig.blockDeviceUdevRuleMatcher}, OWNER="${config.users.users.ceph.name}", GROUP="${config.users.groups.ceph.name}", MODE="0660"
'' ''
@@ -654,7 +663,8 @@ in
SUBSYSTEM=="block", ${osdConfig.dbBlockDeviceUdevRuleMatcher}, OWNER="${config.users.users.ceph.name}", GROUP="${config.users.groups.ceph.name}", MODE="0660" SUBSYSTEM=="block", ${osdConfig.dbBlockDeviceUdevRuleMatcher}, OWNER="${config.users.users.ceph.name}", GROUP="${config.users.groups.ceph.name}", MODE="0660"
'' ''
) )
) cfg.osds )
cfg.osds
); );
systemd.services = { systemd.services = {
@@ -664,12 +674,14 @@ in
preStart = ensureCephDirs; preStart = ensureCephDirs;
script = let script =
let
# `--addv` seems currently required to get msgr-v2 working, see: # `--addv` seems currently required to get msgr-v2 working, see:
# https://tracker.ceph.com/issues/53751#note-11 # https://tracker.ceph.com/issues/53751#note-11
monmapNodes = builtins.concatStringsSep " " (lib.concatMap (mon: [ "--addv" mon.hostname "[v2:${mon.ipAddress}:3300,v1:${mon.ipAddress}:6789]" ]) cfg.initialMonitors); monmapNodes = builtins.concatStringsSep " " (lib.concatMap (mon: [ "--addv" mon.hostname "[v2:${mon.ipAddress}:3300,v1:${mon.ipAddress}:6789]" ]) cfg.initialMonitors);
# Monitors cannot simply be changed in config, one has to update the monmap, see note [replacing-ceph-monmap-ips-for-existing-cluster] # Monitors cannot simply be changed in config, one has to update the monmap, see note [replacing-ceph-monmap-ips-for-existing-cluster]
in '' in
''
set -euo pipefail set -euo pipefail
rm -rf "${monDir}" # Start from scratch. rm -rf "${monDir}" # Start from scratch.
echo "Initializing monitor." echo "Initializing monitor."
@@ -707,22 +719,22 @@ in
preStart = ensureTransientCephDirs; preStart = ensureTransientCephDirs;
serviceConfig = { serviceConfig = {
LimitNOFILE="1048576"; LimitNOFILE = "1048576";
LimitNPROC="1048576"; LimitNPROC = "1048576";
ExecStart='' ExecStart = ''
${cfg.package}/bin/ceph-mon -f --cluster ${cfg.clusterName} --id ${cfg.monitor.nodeName} --setuser ${config.users.users.ceph.name} --setgroup ${config.users.groups.ceph.name} "--public_bind_addr=${cfg.monitor.bindAddr}" "--public_addr=${cfg.monitor.advertisedPublicAddr}" ${cfg.package}/bin/ceph-mon -f --cluster ${cfg.clusterName} --id ${cfg.monitor.nodeName} --setuser ${config.users.users.ceph.name} --setgroup ${config.users.groups.ceph.name} "--public_bind_addr=${cfg.monitor.bindAddr}" "--public_addr=${cfg.monitor.advertisedPublicAddr}"
''; '';
ExecReload='' ExecReload = ''
${pkgs.coreutils}/bin/kill -HUP $MAINPID ${pkgs.coreutils}/bin/kill -HUP $MAINPID
''; '';
PrivateDevices="yes"; PrivateDevices = "yes";
ProtectHome="true"; ProtectHome = "true";
ProtectSystem="full"; ProtectSystem = "full";
PrivateTmp="true"; PrivateTmp = "true";
TasksMax="infinity"; TasksMax = "infinity";
Restart="on-failure"; Restart = "on-failure";
# StartLimitBurst="5"; # StartLimitBurst="5";
RestartSec="10"; RestartSec = "10";
}; };
# startLimitIntervalSec = 30 * 60; # startLimitIntervalSec = 30 * 60;
}; };
@@ -768,17 +780,17 @@ in
preStart = ensureTransientCephDirs; preStart = ensureTransientCephDirs;
serviceConfig = { serviceConfig = {
LimitNOFILE="1048576"; LimitNOFILE = "1048576";
LimitNPROC="1048576"; LimitNPROC = "1048576";
ExecStart='' ExecStart = ''
${cfg.package}/bin/ceph-mgr -f --cluster ${cfg.clusterName} --id ${cfg.manager.nodeName} --setuser ${config.users.users.ceph.name} --setgroup ${config.users.groups.ceph.name} ${cfg.package}/bin/ceph-mgr -f --cluster ${cfg.clusterName} --id ${cfg.manager.nodeName} --setuser ${config.users.users.ceph.name} --setgroup ${config.users.groups.ceph.name}
''; '';
ExecReload='' ExecReload = ''
${pkgs.coreutils}/bin/kill -HUP $MAINPID ${pkgs.coreutils}/bin/kill -HUP $MAINPID
''; '';
Restart="on-failure"; Restart = "on-failure";
RestartSec=10; RestartSec = 10;
# StartLimitBurst="3"; # StartLimitBurst="3";
}; };
# startLimitIntervalSec = 30 * 60; # startLimitIntervalSec = 30 * 60;
@@ -825,16 +837,16 @@ in
preStart = ensureTransientCephDirs; preStart = ensureTransientCephDirs;
serviceConfig = { serviceConfig = {
LimitNOFILE="1048576"; LimitNOFILE = "1048576";
LimitNPROC="1048576"; LimitNPROC = "1048576";
ExecStart='' ExecStart = ''
${cfg.package}/bin/ceph-mds -f --cluster ${cfg.clusterName} --id ${cfg.mds.nodeName} --setuser ${config.users.users.ceph.name} --setgroup ${config.users.groups.ceph.name} "--public_addr=${cfg.mds.listenAddr}" ${cfg.package}/bin/ceph-mds -f --cluster ${cfg.clusterName} --id ${cfg.mds.nodeName} --setuser ${config.users.users.ceph.name} --setgroup ${config.users.groups.ceph.name} "--public_addr=${cfg.mds.listenAddr}"
''; '';
ExecReload='' ExecReload = ''
${pkgs.coreutils}/bin/kill -HUP $MAINPID ${pkgs.coreutils}/bin/kill -HUP $MAINPID
''; '';
Restart="on-failure"; Restart = "on-failure";
# StartLimitBurst="3"; # StartLimitBurst="3";
}; };
# startLimitIntervalSec = 30 * 60; # startLimitIntervalSec = 30 * 60;
+9 -6
View File
@@ -5,9 +5,11 @@ let
# Create a container with all our default settings # Create a container with all our default settings
makeContainer = name: container: let makeContainer = name: container:
let
agekey = "/etc/ssh/agenix_key"; agekey = "/etc/ssh/agenix_key";
in { in
{
autoStart = true; autoStart = true;
hostAddress = "192.168.${container.subnet}.1"; hostAddress = "192.168.${container.subnet}.1";
localAddress = "192.168.${container.subnet}.2"; localAddress = "192.168.${container.subnet}.2";
@@ -35,11 +37,12 @@ let
greg.tailscale.enable = container.tailscale; greg.tailscale.enable = container.tailscale;
}; };
}; };
in { in
{
options.greg.containers = lib.mkOption { options.greg.containers = lib.mkOption {
default = {}; default = { };
type = with lib.types; attrsOf ( submodule ( type = with lib.types; attrsOf (submodule (
{ {
options = { options = {
tailscale = lib.mkOption { tailscale = lib.mkOption {
@@ -52,7 +55,7 @@ in {
default = "200"; default = "200";
}; };
builder = lib.mkOption { builder = lib.mkOption {
default = { ... }: {}; default = { ... }: { };
description = '' description = ''
This needs to be a function, like the one for This needs to be a function, like the one for
a container's config. It will setup the core system above the a container's config. It will setup the core system above the
+6 -5
View File
@@ -3,18 +3,19 @@
let let
cfg = config.greg.databases; cfg = config.greg.databases;
dbs = (lib.attrNames cfg); dbs = (lib.attrNames cfg);
in { in
{
options.greg.databases = lib.mkOption { options.greg.databases = lib.mkOption {
default = {}; default = { };
type = with lib.types; attrsOf ( submodule ( type = with lib.types; attrsOf (submodule (
{ name, config, options, ... }: { { name, config, options, ... }: {
# Options reserved for future expansion # Options reserved for future expansion
options = {}; options = { };
} }
)); ));
}; };
config = lib.mkIf ( dbs != [] ) { config = lib.mkIf (dbs != [ ]) {
services = { services = {
postgresql = { postgresql = {
enable = true; enable = true;
+4 -2
View File
@@ -1,10 +1,12 @@
{ config, pkgs, inputs, lib, ... }: { config, pkgs, inputs, lib, ... }:
let let
x = if builtins.hasAttr "xonsh-unwrapped" pkgs then x =
if builtins.hasAttr "xonsh-unwrapped" pkgs then
pkgs.xonsh else pkgs.xonsh else
pkgs.xonsh.passthru.wrapper; pkgs.xonsh.passthru.wrapper;
in { in
{
imports = [ imports = [
../baseline.nix ../baseline.nix
./backup.nix ./backup.nix
+2 -1
View File
@@ -3,7 +3,8 @@
let let
cfg = config.greg.gnome; cfg = config.greg.gnome;
in with lib; { in
with lib; {
options = { options = {
greg.gnome.enable = mkEnableOption "Enable my default Gnome3 setup"; greg.gnome.enable = mkEnableOption "Enable my default Gnome3 setup";
}; };
+2 -1
View File
@@ -3,7 +3,8 @@
let let
cfg = config.greg.home; cfg = config.greg.home;
in with lib; in
with lib;
{ {
options.greg.home = mkOption { options.greg.home = mkOption {
type = types.bool; type = types.bool;
+2 -1
View File
@@ -3,7 +3,8 @@
let let
cfg = config.greg.kde; cfg = config.greg.kde;
in with lib; { in
with lib; {
options = { options = {
greg.kde.enable = mkEnableOption "Enable my default KDE setup"; greg.kde.enable = mkEnableOption "Enable my default KDE setup";
}; };
+2 -1
View File
@@ -2,7 +2,8 @@
let let
cfg = config.services.kiwix-serve; cfg = config.services.kiwix-serve;
in with lib; { in
with lib; {
options.services.kiwix-serve = { options.services.kiwix-serve = {
enable = mkEnableOption "Enable the Kiwix web server"; enable = mkEnableOption "Enable the Kiwix web server";
+6 -5
View File
@@ -3,7 +3,8 @@
let let
cfg = config.greg.linode; cfg = config.greg.linode;
in with lib; in
with lib;
{ {
options.greg.linode = { options.greg.linode = {
enable = mkEnableOption "Set sensible defaults for a Linode host"; enable = mkEnableOption "Set sensible defaults for a Linode host";
@@ -21,10 +22,10 @@ in with lib;
boot.loader.grub = { boot.loader.grub = {
device = "nodev"; device = "nodev";
extraConfig = '' extraConfig = ''
serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1; serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1;
terminal_input serial; terminal_input serial;
terminal_output serial; terminal_output serial;
''; '';
}; };
# Tells grub to ignore partion-free device warnings, since we are on Linode # Tells grub to ignore partion-free device warnings, since we are on Linode
+4 -3
View File
@@ -3,7 +3,8 @@
let let
cfg = config.greg.print; cfg = config.greg.print;
in with lib; in
with lib;
{ {
options.greg.print.enable = mkOption { options.greg.print.enable = mkOption {
type = types.bool; type = types.bool;
@@ -20,7 +21,7 @@ in with lib;
] ++ (lib.optional pkgs.stdenv.isx86_64 gutenprintBin); ] ++ (lib.optional pkgs.stdenv.isx86_64 gutenprintBin);
}; };
hardware.printers.ensurePrinters = [ { hardware.printers.ensurePrinters = [{
name = "HomeLexmarkColorPrinter"; name = "HomeLexmarkColorPrinter";
location = "Home office"; location = "Home office";
deviceUri = "ipp://printer.thehellings.lan:631/"; deviceUri = "ipp://printer.thehellings.lan:631/";
@@ -28,6 +29,6 @@ in with lib;
ppdOptions = { ppdOptions = {
PageSize = "Letter"; PageSize = "Letter";
}; };
} ]; }];
}; };
} }
+10 -8
View File
@@ -11,18 +11,19 @@ let
locations."${dest.path}" = { locations."${dest.path}" = {
proxyPass = dest.target; proxyPass = dest.target;
extraConfig = '' extraConfig = ''
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade; proxy_set_header Connection $connection_upgrade;
'' + dest.extraConfig; '' + dest.extraConfig;
}; };
serverAliases = lib.mkIf dest.genAliases [ "${alias name}" ]; serverAliases = lib.mkIf dest.genAliases [ "${alias name}" ];
}; };
in with lib; { in
with lib; {
options = { options = {
greg.proxies = mkOption { greg.proxies = mkOption {
default = {}; default = { };
example = literalExpression '' example = literalExpression ''
{ host-name = { { host-name = {
target = proxyLocation; target = proxyLocation;
@@ -70,11 +71,12 @@ in with lib; {
default = ""; default = "";
}; };
}; };
})); }
));
}; };
}; };
config.services.nginx = mkIf ( ( attrValues cfg ) != [] ) { config.services.nginx = mkIf ((attrValues cfg) != [ ]) {
enable = true; enable = true;
recommendedGzipSettings = true; recommendedGzipSettings = true;
+13 -9
View File
@@ -3,19 +3,22 @@
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, { wan
lan, , lan
limitedLan ? [], , limitedLan ? [ ]
openPorts ? [ "ssh" "67" "53" ], # ssh, dhcpd, dns , openPorts ? [ "ssh" "67" "53" ]
, # ssh, dhcpd, dns
openUDPPorts ? [ "67" "53" ] # 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" (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; udpPortsString = lib.strings.concatMapStringsSep "\n" (x: "iifname { ${lanList}, \"tailscale0\" } udp dport ${toString x} accept") openUDPPorts;
in lib.strings.concatStringsSep "\n" [ in
lib.strings.concatStringsSep "\n" [
"table ip filter {" "table ip filter {"
" chain output {" " chain output {"
" type filter hook output priority 100; policy accept;" " type filter hook output priority 100; policy accept;"
@@ -57,7 +60,8 @@ let
]; ];
cfg = config.greg.router; cfg = config.greg.router;
in with lib; { in
with lib; {
options.greg.router = { options.greg.router = {
enable = mkEnableOption "Enable NFTables and routing"; enable = mkEnableOption "Enable NFTables and routing";
wan = mkOption { wan = mkOption {
@@ -71,7 +75,7 @@ in with lib; {
limited = mkOption { limited = mkOption {
type = (types.listOf types.str); type = (types.listOf types.str);
description = "A list of limited access LAN connections - such as IOT connections and similar."; description = "A list of limited access LAN connections - such as IOT connections and similar.";
default = []; default = [ ];
}; };
}; };
+2 -1
View File
@@ -3,7 +3,8 @@
let let
cfg = config.greg.rpi4; cfg = config.greg.rpi4;
in with lib; { in
with lib; {
options = { options = {
greg.rpi4 = { greg.rpi4 = {
enable = mkEnableOption "Enable support for Raspberry Pi 4s"; enable = mkEnableOption "Enable support for Raspberry Pi 4s";
+3 -2
View File
@@ -3,7 +3,8 @@
let let
cfg = config.greg.sway; cfg = config.greg.sway;
in with lib; { in
with lib; {
options = { options = {
greg.sway.enable = mkEnableOption "Enable my default Gnome3 setup"; greg.sway.enable = mkEnableOption "Enable my default Gnome3 setup";
}; };
@@ -37,6 +38,6 @@ in with lib; {
enable = true; # Will be enabled through home-manager enable = true; # Will be enabled through home-manager
wrapperFeatures.gtk = true; wrapperFeatures.gtk = true;
}; };
security.pam.services.swaylock = {}; security.pam.services.swaylock = { };
}; };
} }
+2 -1
View File
@@ -2,7 +2,8 @@
let let
cfg = config.greg.syncthing; cfg = config.greg.syncthing;
in with lib; { in
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";
}; };
+2 -1
View File
@@ -2,7 +2,8 @@
let let
cfg = config.greg.tailscale; cfg = config.greg.tailscale;
in { in
{
options = { options = {
greg.tailscale.enable = lib.mkEnableOption "Enable Tailscale"; greg.tailscale.enable = lib.mkEnableOption "Enable Tailscale";
}; };
+2 -1
View File
@@ -2,7 +2,8 @@
let let
cfg = config.greg.vmdev; cfg = config.greg.vmdev;
in with lib; in
with lib;
{ {
options = { options = {
greg.vmdev = { greg.vmdev = {
+7 -7
View File
@@ -1,10 +1,10 @@
{ pkgs, ... }: { pkgs, ... }:
pkgs.writeShellScriptBin "aacs" '' pkgs.writeShellScriptBin "aacs" ''
set -ex set -ex
[ ! -d "''${HOME}/.config/aacs" ] && mkdir -p "''${HOME}/.config/aacs" [ ! -d "''${HOME}/.config/aacs" ] && mkdir -p "''${HOME}/.config/aacs"
cd "''${HOME}/.config/aacs" cd "''${HOME}/.config/aacs"
[ -f KEYDB.cfg.zip ] && rm -f KEYDB.cfg.zip [ -f KEYDB.cfg.zip ] && rm -f KEYDB.cfg.zip
curl -L -o KEYDB.cfg.zip "http://fvonline-db.bplaced.net/fv_download.php?lang=eng" curl -L -o KEYDB.cfg.zip "http://fvonline-db.bplaced.net/fv_download.php?lang=eng"
${pkgs.unzip}/bin/unzip KEYDB.cfg.zip ${pkgs.unzip}/bin/unzip KEYDB.cfg.zip
mv keydb.cfg KEYDB.cfg'' mv keydb.cfg KEYDB.cfg''
+16 -16
View File
@@ -1,28 +1,28 @@
{ writeShellScriptBin, openssl, ...}: { writeShellScriptBin, openssl, ... }:
writeShellScriptBin "create_ssl" '' writeShellScriptBin "create_ssl" ''
set -e -o pipefail set -e -o pipefail
name="''${1}" name="''${1}"
root_key="''${2}" root_key="''${2}"
function usage { function usage {
echo "USAGE: create_ssl <cert name> <root path>" echo "USAGE: create_ssl <cert name> <root path>"
} }
if [ -z "''${name}" ]; then if [ -z "''${name}" ]; then
usage usage
exit 1 exit 1
fi fi
if [ -z "''${root_key}" ]; then if [ -z "''${root_key}" ]; then
usage usage
exit 1 exit 1
fi fi
# Create the certificate key # Create the certificate key
${openssl}/bin/openssl ecparam -out "''${name}.key" -name prime256v1 -genkey ${openssl}/bin/openssl ecparam -out "''${name}.key" -name prime256v1 -genkey
# Create the CSR # Create the CSR
${openssl}/bin/openssl req -name -sha256 -key "''${name}.key" -out "''${name}.csr" ${openssl}/bin/openssl req -name -sha256 -key "''${name}.key" -out "''${name}.csr"
# Sign it # Sign it
${openssl}/bin/openssl x509 -req -in "''${name}.csr" -CA "''${root_key}.crt" -CAkey "''${root_key}.key" -CAcreateserial -out "''${name}.crt" -days 3650 -sha256 ${openssl}/bin/openssl x509 -req -in "''${name}.csr" -CA "''${root_key}.crt" -CAkey "''${root_key}.key" -CAcreateserial -out "''${name}.crt" -days 3650 -sha256
'' ''
+18 -14
View File
@@ -18,30 +18,32 @@ let
myPython = prev.python312.withPackages myPackages; myPython = prev.python312.withPackages myPackages;
macOver = file: og: macOver = file: og:
if prev.stdenv.isDarwin then if prev.stdenv.isDarwin then
(prev.callPackage file {}) else (prev.callPackage file { }) else
prev."${og}"; prev."${og}";
buildFirefoxXpiAddon = final.nur.repos.rycee.lib.buildFirefoxXpiAddon; buildFirefoxXpiAddon = final.nur.repos.rycee.lib.buildFirefoxXpiAddon;
is2405 = prev.lib.versionAtLeast prev.lib.version "24"; is2405 = prev.lib.versionAtLeast prev.lib.version "24";
in rec { in
rec {
gregpy = myPython; gregpy = myPython;
## Testing adding python packages in the correct manner ## Testing adding python packages in the correct manner
pythonPackagesExtensions = (prev.pythonPackagesExtensions or []) ++ [ pythonPackagesExtensions = (prev.pythonPackagesExtensions or [ ]) ++ [
(python-final: python-prev: let cp = python-final.callPackage; in { (python-final: python-prev:
django-rapyd-modernauth = cp ./django-rapyd-modernauth.nix {}; let cp = python-final.callPackage; in {
graypy = cp ./graypy.nix {}; django-rapyd-modernauth = cp ./django-rapyd-modernauth.nix { };
itg-django-utils = cp ./itg-django-utils.nix {}; graypy = cp ./graypy.nix { };
xonsh-apipenv = cp ./xonsh-apipenv.nix {}; itg-django-utils = cp ./itg-django-utils.nix { };
xonsh-apipenv = cp ./xonsh-apipenv.nix { };
}) })
]; ];
# My own packages # My own packages
aacs = prev.callPackage ./aacs.nix {}; aacs = prev.callPackage ./aacs.nix { };
create_ssl = prev.callPackage ./create_ssl.nix {}; create_ssl = prev.callPackage ./create_ssl.nix { };
enwiki-dump = prev.callPackage ./enwiki-dump.nix {}; enwiki-dump = prev.callPackage ./enwiki-dump.nix { };
hms = prev.callPackage ./hms { hms = prev.callPackage ./hms {
pkgs = final.pkgs; pkgs = final.pkgs;
}; };
@@ -50,11 +52,13 @@ in rec {
setup-ssh = prev.callPackage ./setup-ssh { setup-ssh = prev.callPackage ./setup-ssh {
pkgs = final.pkgs; pkgs = final.pkgs;
}; };
upgrade-pg-cluster = prev.callPackage ./upgrade-pg-cluster.nix {}; upgrade-pg-cluster = prev.callPackage ./upgrade-pg-cluster.nix { };
# Overrides of packages # Overrides of packages
brew = prev.callPackage ./homebrew.nix {}; brew = prev.callPackage ./homebrew.nix { };
copier = (if is2405 then prev.copier.overridePythonAttrs (old: { copier = (if is2405 then
prev.copier.overridePythonAttrs
(old: {
version = "9.1.0"; version = "9.1.0";
src = final.fetchFromGitHub { src = final.fetchFromGitHub {
owner = "copier-org"; owner = "copier-org";
+13 -14
View File
@@ -1,15 +1,13 @@
{ { lib
lib, , buildPythonPackage
buildPythonPackage, , fetchPypi
fetchPypi, , click
, django
click, , python-dotenv
django, , pytz
python-dotenv, , setuptools
pytz, , sqlparse
setuptools, , zipp
sqlparse,
zipp
}: }:
let let
@@ -22,7 +20,8 @@ let
sqlparse sqlparse
zipp zipp
]; ];
in buildPythonPackage rec { in
buildPythonPackage rec {
pname = "django-rapyd-modernauth"; pname = "django-rapyd-modernauth";
version = "0.0.4"; version = "0.0.4";
@@ -35,7 +34,7 @@ in buildPythonPackage rec {
description = "A Django application that provides a custom User model where the username is the email address."; description = "A Django application that provides a custom User model where the username is the email address.";
homepage = "https://github.com/karthicraghupathi/django_rapyd_modernauth"; homepage = "https://github.com/karthicraghupathi/django_rapyd_modernauth";
license = licenses.afl20; license = licenses.afl20;
maintainers = []; maintainers = [ ];
}; };
doCheck = false; doCheck = false;
+29 -28
View File
@@ -2,54 +2,55 @@
let let
version = "2022.07.20"; version = "2022.07.20";
date = builtins.replaceStrings ["."] [""] version; date = builtins.replaceStrings [ "." ] [ "" ] version;
in pkgs.writeShellScriptBin "wiki-data" '' in
set -eo pipefail pkgs.writeShellScriptBin "wiki-data" ''
set -eo pipefail
function process_file { function process_file {
file="''${lang}''${1}" file="''${lang}''${1}"
destfile=/var/tmp/''${file} destfile=/var/tmp/''${file}
curl -C - -o "''${destfile}" "https://dumps.wikimedia.your.org/''${lang}wiki/${date}/''${file}" curl -C - -o "''${destfile}" "https://dumps.wikimedia.your.org/''${lang}wiki/${date}/''${file}"
bzcat "''${destfile}" | ${pkgs.php}/bin/php ${pkgs.mediawiki}/share/mediawiki/maintenance/importDump.php --report 500 | tee "/var/log/mediawiki-''${lang}-import" bzcat "''${destfile}" | ${pkgs.php}/bin/php ${pkgs.mediawiki}/share/mediawiki/maintenance/importDump.php --report 500 | tee "/var/log/mediawiki-''${lang}-import"
rm "''${destfile}" rm "''${destfile}"
} }
function zim_fetch { function zim_fetch {
dest="/srv/zims" dest="/srv/zims"
mkdir -p "''${dest}" mkdir -p "''${dest}"
file="''${1}" file="''${1}"
echo "Downloading ''${file}" echo "Downloading ''${file}"
transmission-remote -w "''${dest}" -a https://download.kiwix.org/zim/''${file}.zim.torrent transmission-remote -w "''${dest}" -a https://download.kiwix.org/zim/''${file}.zim.torrent
} }
#process_file "wiki-${date}-pages-articles-multistream.xml.bz2" #process_file "wiki-${date}-pages-articles-multistream.xml.bz2"
#process_file "wiki-${date}-pages-meta-current.xml.bz2" #process_file "wiki-${date}-pages-meta-current.xml.bz2"
#process_file "wiki-${date}-pages-articles.xml.bz2" #process_file "wiki-${date}-pages-articles.xml.bz2"
zim_fetch wikipedia_en_all_maxi zim_fetch wikipedia_en_all_maxi
zim_fetch wikipedia_fr_all_maxi zim_fetch wikipedia_fr_all_maxi
zim_fetch wikipedia_ht_all_maxi zim_fetch wikipedia_ht_all_maxi
zim_fetch wiktionary_en_all_maxi zim_fetch wiktionary_en_all_maxi
zim_fetch wiktionary_fr_all_maxi zim_fetch wiktionary_fr_all_maxi
zim_fetch wikiversity_en_all_maxi zim_fetch wikiversity_en_all_maxi
zim_fetch wikiversity_fr_all_maxi zim_fetch wikiversity_fr_all_maxi
zim_fetch wikibooks_en_all_maxi zim_fetch wikibooks_en_all_maxi
zim_fetch wikibooks_fr_all_maxi zim_fetch wikibooks_fr_all_maxi
zim_fetch wikisource_en_all_maxi zim_fetch wikisource_en_all_maxi
zim_fetch wikisource_fr_all_maxi zim_fetch wikisource_fr_all_maxi
zim_fetch ted_en_science zim_fetch ted_en_science
zim_fetch ted_en_technology zim_fetch ted_en_technology
zim_fetch phet_en zim_fetch phet_en
zim_fetch phet_fr zim_fetch phet_fr
zim_fetch phet_ht zim_fetch phet_ht
zim_fetch gutenberg_en_all zim_fetch gutenberg_en_all
zim_fetch gutenberg_fr_all zim_fetch gutenberg_fr_all
'' ''
+8 -9
View File
@@ -1,12 +1,11 @@
{ { lib
lib, , buildPythonPackage
buildPythonPackage, , fetchFromGitHub
fetchFromGitHub, , amqplib
, mock
amqplib, , pytestCheckHook
mock, , requests
pytestCheckHook, ,
requests,
}: }:
buildPythonPackage rec { buildPythonPackage rec {
+9 -10
View File
@@ -1,13 +1,12 @@
{ { lib
lib, , pkgs
pkgs, , stdenv
stdenv, , bash
, curl
bash, , git
curl, , ruby
git, , ...
ruby, }:
...}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "homebrew-installer"; pname = "homebrew-installer";
+24 -25
View File
@@ -1,32 +1,31 @@
{ { pkgs
pkgs, , coreutils
coreutils, , curl
curl, , gnutar
gnutar, , nix
nix, , ...
...
}: }:
pkgs.writeShellScriptBin "inject-darwin" '' pkgs.writeShellScriptBin "inject-darwin" ''
set -ex set -ex
set -o pipefail set -o pipefail
dir="$(${coreutils}/bin/mktemp -d)" dir="$(${coreutils}/bin/mktemp -d)"
cd "''${dir}" cd "''${dir}"
# Install nix-darwin # Install nix-darwin
${nix}/bin/nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer ${nix}/bin/nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
./result/bin/darwin-installer ./result/bin/darwin-installer
# Get my configuration # Get my configuration
mkdir -p ~/.config/darwin mkdir -p ~/.config/darwin
cd ~/.config/darwin cd ~/.config/darwin
${curl}/bin/curl -O -L https://github.com/greg-hellings/nixos-config/archive/refs/heads/main.tar.gz ${curl}/bin/curl -O -L https://github.com/greg-hellings/nixos-config/archive/refs/heads/main.tar.gz
${gnutar}/bin/tar xvzf main.tar.gz --strip-components 1 ${gnutar}/bin/tar xvzf main.tar.gz --strip-components 1
# Build NixOS for this system # Build NixOS for this system
pushd "''${dir}" pushd "''${dir}"
${nix}/bin/nix build "~/.config/darwin#darwinConfigurations.$(hostname -s).system" ${nix}/bin/nix build "~/.config/darwin#darwinConfigurations.$(hostname -s).system"
./result/sw/bin/darwin-rebuild switch --flake ~/.config/darwin ./result/sw/bin/darwin-rebuild switch --flake ~/.config/darwin
popd popd
rm -r "''${dir}" rm -r "''${dir}"
'' ''
+30 -31
View File
@@ -1,27 +1,26 @@
{ { pkgs
pkgs, , git
git, , ...
...
}: }:
pkgs.writeShellScriptBin "inject-nixos-config" '' pkgs.writeShellScriptBin "inject-nixos-config" ''
hostname="''${1}" hostname="''${1}"
if [ -n "''${hostname}"]; then if [ -n "''${hostname}"]; then
echo "You must provide a hostname"; echo "You must provide a hostname";
exit 1; exit 1;
fi fi
mv /etc/nixos /etc/nixos.bk mv /etc/nixos /etc/nixos.bk
cd /etc cd /etc
${git}/bin/git clone http://github.com/greg-hellings/nixos-config nixos ${git}/bin/git clone http://github.com/greg-hellings/nixos-config nixos
mkdir -p "/etc/nixos/hosts/''${hostname}" mkdir -p "/etc/nixos/hosts/''${hostname}"
# Prepares everything for the flake usage # Prepares everything for the flake usage
#cp /etc/nixos.bk/configuration.nix "/etc/nixos/hosts/''${hostname}/default.nix" #cp /etc/nixos.bk/configuration.nix "/etc/nixos/hosts/''${hostname}/default.nix"
cat << EOF > "/etc/nixos/hosts/''${hostname}/default.nix" cat << EOF > "/etc/nixos/hosts/''${hostname}/default.nix"
{ pkgs, config, ... }: { pkgs, config, ... }:
{ {
imports = [ ./hardware-configuration.nix ]; imports = [ ./hardware-configuration.nix ];
boot.loader = { boot.loader = {
@@ -34,23 +33,23 @@ cat << EOF > "/etc/nixos/hosts/''${hostname}/default.nix"
home = true; home = true;
tailscale.enable = true; tailscale.enable = true;
}; };
} }
EOF EOF
cp /etc/nixos.bk/hardware-configuration.nix "/etc/nixos/hosts/''${hostname}/hardware-configuration.nix" cp /etc/nixos.bk/hardware-configuration.nix "/etc/nixos/hosts/''${hostname}/hardware-configuration.nix"
# Prepare home-manager portion for setup # Prepare home-manager portion for setup
mkdir -p "/etc/nixos/home/hosts/''${hostname}" mkdir -p "/etc/nixos/home/hosts/''${hostname}"
cat << EOF > "/etc/nixos/home/hosts/''${hostname}/default.nix" cat << EOF > "/etc/nixos/home/hosts/''${hostname}/default.nix"
{ pkgs, config, ... }: { pkgs, config, ... }:
{ {
} }
EOF EOF
# Prepares it for injecting the use case into the flake usage # Prepares it for injecting the use case into the flake usage
cp /etc/nixos.bk/hardware-configuration.nix /etc/nixos cp /etc/nixos.bk/hardware-configuration.nix /etc/nixos
chown -R greg nixos chown -R greg nixos
echo "Now you should be able to just run `nixos-rebuild switch` to enable the flake functionality" echo "Now you should be able to just run `nixos-rebuild switch` to enable the flake functionality"
echo "After that and adding the entry to the flake, run `nixos-rebuild boot --flake '.#''${hostname}'` and reboot" echo "After that and adding the entry to the flake, run `nixos-rebuild boot --flake '.#''${hostname}'` and reboot"
'' ''
+9 -10
View File
@@ -1,12 +1,11 @@
{ { lib
lib, , buildPythonPackage
buildPythonPackage, , fetchurl
fetchurl, , django
, djangorestframework
django, , graypy
djangorestframework, , setuptools
graypy, ,
setuptools,
}: }:
buildPythonPackage rec { buildPythonPackage rec {
@@ -28,7 +27,7 @@ buildPythonPackage rec {
meta = with lib; { meta = with lib; {
description = "ITG specific stuff"; description = "ITG specific stuff";
homepage = "http://www.ivrtechnology.com"; homepage = "http://www.ivrtechnology.com";
maintainers = []; maintainers = [ ];
}; };
doCheck = false; doCheck = false;
+5 -4
View File
@@ -1,18 +1,19 @@
{ nixunstable, flake-utils }: { nixunstable, flake-utils }:
flake-utils.lib.eachDefaultSystemMap (system: flake-utils.lib.eachDefaultSystemMap (system:
let let
pkgs = (import nixunstable { inherit system; }); pkgs = (import nixunstable { inherit system; });
lib = pkgs.lib; lib = pkgs.lib;
callPackage = pkgs.lib.callPackageWith pkgs; callPackage = pkgs.lib.callPackageWith pkgs;
python = pkgs.packages.python3; python = pkgs.packages.python3;
cp = pkgs.packages.python3.pkgs.callPackage; cp = pkgs.packages.python3.pkgs.callPackage;
in { in
{
hms = pkgs.callPackage ./hms.nix { hms = pkgs.callPackage ./hms.nix {
inherit pkgs; inherit pkgs;
}; };
brew = pkgs.callPackage ./homebrew.nix {}; brew = pkgs.callPackage ./homebrew.nix { };
django-rapyd-modernauth = pkgs.python3.pkgs.callPackage ./django-rapyd-modernauth.nix { django-rapyd-modernauth = pkgs.python3.pkgs.callPackage ./django-rapyd-modernauth.nix {
buildPythonPackage = pkgs.python3.pkgs.buildPythonPackage; buildPythonPackage = pkgs.python3.pkgs.buildPythonPackage;
@@ -22,5 +23,5 @@ flake-utils.lib.eachDefaultSystemMap (system:
buildPythonPackage = pkgs.python3.pkgs.buildPythonPackage; buildPythonPackage = pkgs.python3.pkgs.buildPythonPackage;
fetchPypi = pkgs.python.pkgs.fetchPypi; fetchPypi = pkgs.python.pkgs.fetchPypi;
}; };
} }
) )
+2 -1
View File
@@ -22,7 +22,8 @@ let
pythonEnv = python3.withPackages runtimeDeps; pythonEnv = python3.withPackages runtimeDeps;
in buildPythonApplication rec { in
buildPythonApplication rec {
pname = "pipenv"; pname = "pipenv";
version = "2023.11.15"; version = "2023.11.15";
format = "pyproject"; format = "pyproject";
+1 -1
View File
@@ -1,3 +1,3 @@
{ pkgs, gh, ... }: { pkgs, gh, ... }:
pkgs.writeShellScriptBin "setup-ssh" (builtins.replaceStrings ["gh "] ["${gh}/bin/gh "] (builtins.readFile ./setup-ssh.sh)) pkgs.writeShellScriptBin "setup-ssh" (builtins.replaceStrings [ "gh " ] [ "${gh}/bin/gh " ] (builtins.readFile ./setup-ssh.sh))
+2 -1
View File
@@ -3,7 +3,8 @@
let let
newPostgres = postgresql_16; newPostgres = postgresql_16;
oldPostgres = postgresql_15; oldPostgres = postgresql_15;
in writeScriptBin "upgrade-pg-cluster" '' in
writeScriptBin "upgrade-pg-cluster" ''
set -eux set -eux
systemctl stop postgresql systemctl stop postgresql
+7 -7
View File
@@ -1,9 +1,9 @@
{ { lib
lib, , buildPythonPackage
buildPythonPackage, , fetchFromGitHub
fetchFromGitHub, , toPythonModule
toPythonModule, , pipenv
pipenv, ,
}: }:
buildPythonPackage rec { buildPythonPackage rec {
@@ -27,6 +27,6 @@ buildPythonPackage rec {
description = "Auto pipenv support for Xonsh"; description = "Auto pipenv support for Xonsh";
homepage = "https://github.com/greg-hellings/xontrib-apipenv"; homepage = "https://github.com/greg-hellings/xontrib-apipenv";
license = licenses.mit; license = licenses.mit;
maintainers = []; maintainers = [ ];
}; };
} }