From 78dc445d3ba6f74c0d4d1286aae93b1d769aa26c Mon Sep 17 00:00:00 2001 From: randomuser Date: Sun, 25 Feb 2024 20:29:31 -0600 Subject: [PATCH 1/6] some server chagnes --- boxes/netbox/default.nix | 214 +++------------------------------------ 1 file changed, 14 insertions(+), 200 deletions(-) diff --git a/boxes/netbox/default.nix b/boxes/netbox/default.nix index 9b279ce..e951a0e 100644 --- a/boxes/netbox/default.nix +++ b/boxes/netbox/default.nix @@ -1,114 +1,6 @@ { lib, config, pkgs, ... }: -let - cgitrc = pkgs.writeText "cgitrc" '' - css=/static/cgit.css - logo=/static/logo.png - favicon=/static/favicon.ico - root-title=beepboop.systems - root-desc=quality git hosting - - readme=:README - readme=:readme - readme=:readme.txt - readme=:README.txt - readme=:readme.md - readme=:README.md - - remove-suffix=1 - section-from-path=1 - - section-sort=0 - - section=meta - - repo.url=about - repo.path=/doesnt/exist - repo.desc=about this site - - section=other services at beepboop.systems - - repo.url=bitwarden - repo.path=/doesnt/exist - repo.desc=a simple password manager - - repo.url=radicale - repo.path=/doesnt/exist - repo.desc=a simple calendar server - - repo.url=roundcube - repo.path=/doesnt/exist - repo.desc=mail.beepboop.systems webmail - - repo.url=gitea - repo.path=/doesnt/exist - repo.desc=real git hosting services (until this one is fully operational) - - section=projects - - repo.url=advent - repo.path=/var/lib/git/advent - repo.desc=advent of code solutions - - repo.url=desmos-computer - repo.path=/var/lib/git/desmos-computer - repo.desc=a minimal ISA implemented in the Desmos graphing calculator - - repo.url=dot_testing - repo.path=/var/lib/git/dot_testing - repo.desc=configuration files for NixOS/GNU+Linux boxes - - repo.url=esgd - repo.path=/var/lib/git/esgd - repo.desc=the exceedingly simple gopher daemon - - repo.url=mail-sync - repo.path=/var/lib/git/mail-sync - repo.desc=synchronize mail from walled gardens - - repo.url=mastosnake - repo.path=/var/lib/git/mastosnake - repo.desc=a low quality clone of Twitter Plays Snake - - repo.url=secmsg - repo.path=/var/lib/git/secmsg - repo.desc=a stupid (in)secure messaging client thing - - repo.url=ultimate - repo.path=/var/lib/git/ultimate - repo.desc=ultimate tic tac toe solving engine - - repo.url=wordlefish - repo.path=/var/lib/git/wordlefish - repo.desc=use information theory to solve wordle puzzles - - section=irc robots - - repo.url=botanybot - repo.path=/var/lib/git/botanybot - repo.desc=water bots on ~.club - - repo.url=coinminer - repo.path=/var/lib/git/coinminer - repo.desc=mine fake coins on irc - - repo.url=chaosbot - repo.path=/var/lib/git/chaosbot - repo.desc=robot to protect a user on chaos - - repo.url=modbot - repo.path=/var/lib/git/modbot - repo.desc=modular irc robot - - repo.url=pychaos - repo.path=/var/lib/git/pychaos - repo.desc=python chaos bot - - repo.url=universalducks - repo.path=/var/lib/git/universalducks - repo.desc=cross channel irc ducks - ''; -in { +{ imports = [ ./hardware-configuration.nix @@ -150,32 +42,18 @@ in { settings.protocols = [ { host = "localhost"; - name = "ssh"; - port = "55555"; - service = "ssh"; + name = "ssh"; + port = "55555"; + service = "ssh"; } { host = "localhost"; - name = "tls"; - port = "442"; + name = "tls"; + port = "442"; } ]; }; - # cgit - users = { - groups.git = { }; - users.git = { - createHome = true; - home = /var/lib/git; - isSystemUser = true; - shell = "${pkgs.git}/bin/git-shell"; - group = "git"; - }; - }; - - services.fcgiwrap = { enable = true; user = "git"; group = "git"; }; - networking.hostName = "netbox"; services.radicale = { @@ -218,18 +96,18 @@ in { jails = { "nginx-bruteforce" = '' enabled = true - filter = nginx-bruteforce - logpath = /var/log/nginx/access.log - backend = auto - maxretry = 6 - findtime = 600 + filter = nginx-bruteforce + logpath = /var/log/nginx/access.log + backend = auto + maxretry = 6 + findtime = 600 ''; "postfix-bruteforce" = '' enabled = true - filter = postfix-bruteforce - maxretry = 6 - findtime = 600 + filter = postfix-bruteforce + maxretry = 6 + findtime = 600 ''; }; }; @@ -304,70 +182,6 @@ in { forceSSL = true; enableACME = true; root = "/var/www/beepboop.systems"; - - locations."~* ^/static/(.+.(ico|css))$" = { - extraConfig = '' - alias ${pkgs.cgit}/cgit/$1; - ''; - }; - locations."/static/logo.png" = { - extraConfig = '' - try_files /icon.png /icon.png; - ''; - }; - locations."/about" = { - extraConfig = '' - try_files /about.html /about.html; - ''; - }; - locations."/bitwarden" = { - extraConfig = '' - return 301 https://bit.beepboop.systems; - ''; - }; - locations."/gitea" = { - extraConfig = '' - return 301 https://git.beepboop.systems/rndusr; - ''; - }; - locations."/radicale" = { - extraConfig = '' - return 301 https://cal.beepboop.systems; - ''; - }; - locations."/roundcube" = { - extraConfig = '' - return 301 https://mail.beepboop.systems; - ''; - }; - locations."~* ^(.*)\\.git(/.*)?$" = { - extraConfig = '' - set $modified_path $1$2; - client_max_body_size 0; - - include ${pkgs.nginx}/conf/fastcgi_params; - fastcgi_param SCRIPT_FILENAME ${pkgs.git}/bin/git-http-backend; - fastcgi_param GIT_HTTP_EXPORT_ALL ""; - fastcgi_param GIT_PROJECT_ROOT /var/lib/git; - fastcgi_param PATH_INFO $uri; - - # Forward REMOTE_USER as we want to know when we are authenticated - fastcgi_param REMOTE_USER $remote_user; - fastcgi_pass unix:${config.services.fcgiwrap.socketAddress}; - ''; - }; - locations."/" = { - extraConfig = '' - include ${pkgs.nginx}/conf/fastcgi_params; - fastcgi_param CGIT_CONFIG ${cgitrc}; - fastcgi_param SCRIPT_FILENAME ${pkgs.cgit}/cgit/cgit.cgi; - fastcgi_split_path_info ^(/?)(.+)$; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param QUERY_STRING $args; - fastcgi_param HTTP_HOST $server_name; - fastcgi_pass unix:${config.services.fcgiwrap.socketAddress}; - ''; - }; }; services.nginx.virtualHosts."git.beepboop.systems" = { From 36486ba1a2111928aa87bc6c35410c208835e555 Mon Sep 17 00:00:00 2001 From: rndusr Date: Mon, 26 Feb 2024 00:05:50 -0600 Subject: [PATCH 2/6] some server-side changes --- boxes/netbox/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/boxes/netbox/default.nix b/boxes/netbox/default.nix index e951a0e..8bdee39 100644 --- a/boxes/netbox/default.nix +++ b/boxes/netbox/default.nix @@ -151,14 +151,19 @@ services.gitea = { enable = true; - appName = "crappy code"; # Give the site a name + appName = "beepboop.systems"; # Give the site a name database = { type = "postgres"; passwordFile = "/etc/gittea-pass"; }; + settings.security.INSTALL_LOCK = true; + settings.service.SHOW_REGISTRATION_BUTTON = false; + settings.ui.DEFAULT_THEME = "arc-green"; + settings.api.ENABLE_SWAGGER = false; settings.server = { DOMAIN = "git.beepboop.systems"; ROOT_URL = "https://git.beepboop.systems/"; + LANDING_PAGE = "explore"; HTTP_PORT = 3001; }; }; From 2690b6296fd7919b2a5cb5836b59ccb6cbf6a63d Mon Sep 17 00:00:00 2001 From: randomuser Date: Fri, 15 Mar 2024 18:51:36 -0500 Subject: [PATCH 3/6] changes --- boxes/phone/bash.nix | 16 ++++++++++++++++ boxes/phone/default.nix | 15 +++++++-------- boxes/phone/home.nix | 1 + flake.nix | 3 ++- home/isync/default.nix | 4 ++++ home/khal/default.nix | 4 ++++ home/msmtp/default.nix | 4 ++++ home/neomutt/default.nix | 4 ++++ home/todoman/default.nix | 4 ++++ home/vdirsyncer/default.nix | 4 ++++ 10 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 boxes/phone/bash.nix diff --git a/boxes/phone/bash.nix b/boxes/phone/bash.nix new file mode 100644 index 0000000..b85f686 --- /dev/null +++ b/boxes/phone/bash.nix @@ -0,0 +1,16 @@ +{ lib, config, pkgs, home, ... }: + +{ + home.packages = with pkgs; [ + bash + ]; + + home.file = { + ".bashrc" = { + source = lib.mkDefault ../../home/bash/bashrc; + }; + ".bash_profile" = { + source = lib.mkDefault ../../home/bash/profile; + }; + }; +} diff --git a/boxes/phone/default.nix b/boxes/phone/default.nix index b853e3a..a764fae 100644 --- a/boxes/phone/default.nix +++ b/boxes/phone/default.nix @@ -13,17 +13,16 @@ }; environment.packages = with pkgs; [ - vdirsyncer - msmtp - khal - todoman - neomutt - khal - rbw - isync + tigervnc git tmux hostname + tigervnc + xorg.xinit +# tar +# awk +# sed + elinks ]; environment.etcBackupExtension = ".bak"; diff --git a/boxes/phone/home.nix b/boxes/phone/home.nix index 993fa15..70bbc6f 100644 --- a/boxes/phone/home.nix +++ b/boxes/phone/home.nix @@ -11,6 +11,7 @@ ../../home/msmtp ../../home/neomutt ../../home/rbw + ./bash.nix ]; home.stateVersion = "23.05"; diff --git a/flake.nix b/flake.nix index 8acc27f..147dc02 100644 --- a/flake.nix +++ b/flake.nix @@ -39,7 +39,8 @@ phone-nixpkgs, home-manager-phone, nix-on-droid, - ... }@inputs: { + ... + }@inputs: { nixOnDroidConfigurations = { phone = nix-on-droid.lib.nixOnDroidConfiguration { modules = [ diff --git a/home/isync/default.nix b/home/isync/default.nix index c6ad1cf..263741a 100644 --- a/home/isync/default.nix +++ b/home/isync/default.nix @@ -1,6 +1,10 @@ { lib, config, pkgs, home, ... }: { + home.packages = with pkgs; [ + isync + ]; + home.file = { ".config/isync/config" = { source = ./config; diff --git a/home/khal/default.nix b/home/khal/default.nix index 7694a5a..26ed216 100644 --- a/home/khal/default.nix +++ b/home/khal/default.nix @@ -1,6 +1,10 @@ { lib, config, pkgs, home, ... }: { + home.packages = with pkgs; [ + khal + ]; + home.file = { ".config/khal/config" = { source = ./config; diff --git a/home/msmtp/default.nix b/home/msmtp/default.nix index 14e770a..e268b88 100644 --- a/home/msmtp/default.nix +++ b/home/msmtp/default.nix @@ -1,6 +1,10 @@ { lib, config, pkgs, home, ... }: { + home.packages = with pkgs; [ + msmtp + ]; + home.file = { ".config/msmtp/config" = { source = ./config; diff --git a/home/neomutt/default.nix b/home/neomutt/default.nix index 07e36f9..178db03 100644 --- a/home/neomutt/default.nix +++ b/home/neomutt/default.nix @@ -1,6 +1,10 @@ { lib, config, pkgs, home, ... }: { + home.packages = with pkgs; [ + neomutt + ]; + home.file = { ".config/neomutt/neomuttrc" = { source = ./neomuttrc; diff --git a/home/todoman/default.nix b/home/todoman/default.nix index 141adc3..e92bc0b 100644 --- a/home/todoman/default.nix +++ b/home/todoman/default.nix @@ -1,6 +1,10 @@ { lib, config, pkgs, home, ... }: { + home.packages = with pkgs; [ + todoman + ]; + home.file = { ".config/todoman/config.py" = { source = ./config.py; diff --git a/home/vdirsyncer/default.nix b/home/vdirsyncer/default.nix index e7fb08b..ea53992 100644 --- a/home/vdirsyncer/default.nix +++ b/home/vdirsyncer/default.nix @@ -1,6 +1,10 @@ { lib, config, pkgs, home, ... }: { + home.packages = with pkgs; [ + vdirsyncer + ]; + home.file = { ".config/vdirsyncer/config" = { source = ./config; From 9890f55c9d255ada7e7e1dbd79db45010c4d9c0e Mon Sep 17 00:00:00 2001 From: randomuser Date: Fri, 15 Mar 2024 18:54:42 -0500 Subject: [PATCH 4/6] updated flake.lock --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index 321bd9b..02f83f7 100644 --- a/flake.lock +++ b/flake.lock @@ -25,11 +25,11 @@ }, "locked": { "dir": "pkgs/firefox-addons", - "lastModified": 1708805268, - "narHash": "sha256-TyB6HacqcoIoK8tf5mwk/K9bkexCxjJsVXBp4+cbATI=", + "lastModified": 1710537928, + "narHash": "sha256-uBYpos1lJ3AIuCEKx/yO0rOYCkBbkC37fgR+Y0hdk6g=", "owner": "rycee", "repo": "nur-expressions", - "rev": "211c45ca8c36d7aebcff3e4b548142093fc85857", + "rev": "9a40144862e64dd651f599bff59a04b5ba20b610", "type": "gitlab" }, "original": { @@ -98,11 +98,11 @@ ] }, "locked": { - "lastModified": 1702195668, - "narHash": "sha256-Lxmjez0nfNBptdqV5GsXKm7Bb7swjGsrxiLxWJu0tL8=", + "lastModified": 1709578214, + "narHash": "sha256-jSCHB1+9eA0S2h7G8Aju8XARK0vbDuOR7uFFvCEsKhk=", "owner": "nix-community", "repo": "home-manager", - "rev": "33110fb3c7fe6a94b98b641866a5eddb64b7c23f", + "rev": "219f4bef6d22bc67cddefbba69aadb748d79c49d", "type": "github" }, "original": { @@ -164,11 +164,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1708702655, - "narHash": "sha256-qxT5jSLhelfLhQ07+AUxSTm1VnVH+hQxDkQSZ/m/Smo=", + "lastModified": 1710420202, + "narHash": "sha256-MvFKESbq4rUWuaf2RKPNYENaSZEw/jaCLo2gU6oREcM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c5101e457206dd437330d283d6626944e28794b3", + "rev": "878ef7d9721bee9f81f8a80819f9211ad1f993da", "type": "github" }, "original": { From 9dd19eb42965b1cb954004726394fcd564e41983 Mon Sep 17 00:00:00 2001 From: randomuser Date: Sat, 16 Mar 2024 14:12:43 -0500 Subject: [PATCH 5/6] add options to hm/bash.nix --- boxes/phone/bash.nix | 16 ---------------- boxes/phone/home.nix | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 boxes/phone/bash.nix diff --git a/boxes/phone/bash.nix b/boxes/phone/bash.nix deleted file mode 100644 index b85f686..0000000 --- a/boxes/phone/bash.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ lib, config, pkgs, home, ... }: - -{ - home.packages = with pkgs; [ - bash - ]; - - home.file = { - ".bashrc" = { - source = lib.mkDefault ../../home/bash/bashrc; - }; - ".bash_profile" = { - source = lib.mkDefault ../../home/bash/profile; - }; - }; -} diff --git a/boxes/phone/home.nix b/boxes/phone/home.nix index 70bbc6f..bd4f016 100644 --- a/boxes/phone/home.nix +++ b/boxes/phone/home.nix @@ -11,7 +11,7 @@ ../../home/msmtp ../../home/neomutt ../../home/rbw - ./bash.nix + ( import ../../home/bash { isRoot = true; } ) ]; home.stateVersion = "23.05"; From d3ebc491c140f38f95f71a06f805d69079bcc69c Mon Sep 17 00:00:00 2001 From: randomuser Date: Mon, 18 Mar 2024 18:27:29 -0500 Subject: [PATCH 6/6] some misc stuff --- README.md | 1 - boxes/mainsail/default.nix | 1 + boxes/mlg/default.nix | 2 ++ boxes/virtbox/default.nix | 1 + boxes/x230t/default.nix | 1 + home/nvim/init.lua | 14 ++++++++++---- home/nws/default.nix | 9 +++++++++ home/x11.nix | 1 + modules/hosts.nix | 10 ++++++++++ 9 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 home/nws/default.nix create mode 100644 modules/hosts.nix diff --git a/README.md b/README.md index df68e69..823ab2d 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,6 @@ things to do ------------ - integrate `disko` and `sops-nix` into the setup -- switch from gitea to cgit - establish backup infrastructure for `netbox` - move gmail-mail-bridge into mail-sync repo * (perhaps figure out how to produce a flake for it) diff --git a/boxes/mainsail/default.nix b/boxes/mainsail/default.nix index 16ca93b..9250640 100644 --- a/boxes/mainsail/default.nix +++ b/boxes/mainsail/default.nix @@ -4,6 +4,7 @@ ./hardware-configuration.nix ../../modules/ssh-phone-home.nix ../../modules/bootstrap.nix + ../../modules/hosts.nix ../../modules/common.nix ]; diff --git a/boxes/mlg/default.nix b/boxes/mlg/default.nix index 335577b..948985a 100644 --- a/boxes/mlg/default.nix +++ b/boxes/mlg/default.nix @@ -5,6 +5,7 @@ ./hardware-configuration.nix ./nvidia.nix ../../modules/ssh-phone-home.nix + ../../modules/hosts.nix ../../modules/bootstrap.nix ../../modules/common.nix ../../modules/x11.nix @@ -24,6 +25,7 @@ vscodium thunderbird libreoffice + texliveMedium ]; services.hardware.bolt.enable = true; # thunderbolt support diff --git a/boxes/virtbox/default.nix b/boxes/virtbox/default.nix index 81e64ab..3653e41 100644 --- a/boxes/virtbox/default.nix +++ b/boxes/virtbox/default.nix @@ -4,6 +4,7 @@ imports = [ ./hardware-configuration.nix ../../modules/bootstrap.nix + ../../modules/hosts.nix ../../modules/common.nix ../../modules/x11.nix ../../modules/discord.nix diff --git a/boxes/x230t/default.nix b/boxes/x230t/default.nix index 8762215..1239e63 100644 --- a/boxes/x230t/default.nix +++ b/boxes/x230t/default.nix @@ -7,6 +7,7 @@ ../../modules/bootstrap.nix ../../modules/common.nix ../../modules/x11.nix + ../../modules/hosts.nix ../../modules/tlp.nix ../../modules/media.nix ../../modules/anki.nix diff --git a/home/nvim/init.lua b/home/nvim/init.lua index 0d891a5..41ce1ad 100644 --- a/home/nvim/init.lua +++ b/home/nvim/init.lua @@ -146,8 +146,8 @@ local packer = require('packer').startup(function(use) require('packer').sync() end end); --- }}} - +-- -- }}} + nnoremap('ff', function() require('telescope.builtin').find_files() end) @@ -171,6 +171,12 @@ luasnip.add_snippets("tex", { luasnip.text_node({ "", "\\end{" }), ls_extras.rep(1), luasnip.text_node("}") }) }) --- }}} -return packer +luasnip.add_snippets("tex", { + luasnip.snippet("desc", { + luasnip.text_node({ "\\begin{description}", "\t\\item "}), + luasnip.insert_node(1), + luasnip.text_node({ "", "\\end{description}" }), + }) +}) +-- }}} diff --git a/home/nws/default.nix b/home/nws/default.nix new file mode 100644 index 0000000..4877d56 --- /dev/null +++ b/home/nws/default.nix @@ -0,0 +1,9 @@ +{ lib, config, pkgs, home, ... }: + +{ + home.file = { + ".config/nws" = { + text = ''KOHX''; + }; + }; +} diff --git a/home/x11.nix b/home/x11.nix index b919cb6..23cd718 100644 --- a/home/x11.nix +++ b/home/x11.nix @@ -18,6 +18,7 @@ ./neomutt ./msmtp ./rbw + ./nws ./x11-progs.nix ./tty.nix diff --git a/modules/hosts.nix b/modules/hosts.nix new file mode 100644 index 0000000..9a2d351 --- /dev/null +++ b/modules/hosts.nix @@ -0,0 +1,10 @@ +{ lib, config, pkgs, inputs, ...}: + +{ + networking.hosts = { + "192.168.1.120" = [ "x230t" ]; + "192.168.1.52" = [ "mlg" ]; + "192.168.1.100" = [ "mainsail" ]; + }; +} +