Compare commits

..

No commits in common. "master" and "statusbar-experimental" have entirely different histories.

358 changed files with 36447 additions and 2160 deletions

5
.config/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
.config
mimeapps.list
pulse/
rbw
chromium/

102
.config/bash/bashrc Normal file
View File

@ -0,0 +1,102 @@
#!/bin/bash
# if not interactive, don't do anything
[ -z "$PS1" ] && return
# some housekeeping
alias ls="ls --color=auto"
alias ll="ls -lah --color=auto"
function cd() {
builtin cd "$@" && ls --color=auto
}
# history
HISTCONTROL=ignorespace:ignoredups:erasedups
HISTFILESIZE=9999999999
HISTSIZE=9999999999
# bash specific settings
set -o vi # vim mode
shopt -s autocd
shopt -s cmdhist
shopt -s histreedit
shopt -s histappend
shopt -s histverify
PS1="\w\$ "
if [ -n "$IN_NIX_SHELL" ]; then
NIX_SHELL_PS1="nix:"
fi
if [ "$USER" = "root" ]; then
USER_PREFIX="\[\033[41m\]root:\[\033[0;0m\]"
elif [ "$USER" == "ryan" ] && [ "$HOSTNAME" = "netbox" ]; then
USER_PREFIX=""
elif [ "$USER" != "usr" ]; then
USER_PREFIX="$USER:"
fi
# hostname shenanigans
case "$HOSTNAME" in
"aristotle")
PS1="$USER_PREFIX\[\033[36;1m\]${NIX_SHELL_PS1}arist:$PS1\[\033[0;0m\]"
;;
"copernicus")
PS1="$USER_PREFIX\[\033[97;1m\]${NIX_SHELL_PS1}coper:$PS1\[\033[0;0m\]"
;;
"x230t")
PS1="$USER_PREFIX\[\033[93;1m\]${NIX_SHELL_PS1}x230t:$PS1\[\033[0;0m\]"
;;
"mlg")
PS1="$USER_PREFIX\[\033[94;1m\]${NIX_SHELL_PS1}mlg:$PS1\[\033[0;0m\]"
;;
"netbox")
PS1="$USER_PREFIX\[\033[95;1m\]${NIX_SHELL_PS1}net:$PS1\[\033[0;0m\]"
;;
*)
PS1="$USER_PREFIX\[\033[96;1m\]${NIX_SHELL_PS1}unk:$PS1\[\033[0;0m\]"
;;
esac
repos() {
sel="$(ls ~/git | fzy | awk '{print "/home/usr/git/"$1}')"
[ "$?" -eq 1 ] && exit
cd "$sel"
}
hist() {
res=$(cat ~/.config/bash/hist | \
sort | \
uniq | \
shuf | \
fzy)
[ -n "$res" ] && $($res)
}
search() {
if [ "$1" = '-a' ]; then
res=$(find /home/usr/ /home/usr/doc/ \
-mindepth 1 \
-not -path '*/.*' \
-not -path './Mail/*' \
-not -path './vdir/*' \
-not -path '*venv*' \
-not -path '*node_modules*' \
-not -path '*__pycache__*' \
-type d | cut -c 11- | fzy)
else
res=$(find $(pwd) \
-mindepth 1 \
-not -path '*/.*' \
-not -path './Mail/*' \
-not -path './vdir/*' \
-not -path '*venv*' \
-not -path '*node_modules*' \
-not -path '*__pycache__*' \
-type d | cut -c 11- | fzy)
fi
[ -n "$res" ] && cd /home/usr/"$res"
}

30
.config/bspwm/bspwmrc Executable file
View File

@ -0,0 +1,30 @@
#!/bin/sh
# rndusr's bspwmrc
bspc rule -a st-gpg-menu state=floating
bspc rule -a statusbar border=off sticky=on state=floating manage=off
bspc rule -a tmenu-prompt border=on sticky=on state=floating
bspc rule -a Xmessage border=on state=floating
bspc rule -a Zathura state=tiled
bspc rule -a generic-st-window state=floating manage=on sticky=on border=on
bspc rule -a floating-feh state=floating
bspc rule -a send-to-9 desktop=9
bspc rule -a steam desktop=1
bspc rule -a discord desktop=2
bspc config normal_border_color "#161510"
bspc config active_border_color "#161510"
bspc config focused_border_color "#727A18"
bspc config pointer_follows_focus true
bspc config pointer_follows_monitor true
bspc config focus_follows_pointer true
bspc config window_gap 0
bspc config top_padding 20
# post-wm configuration
disp
bspc desktop -f 1

BIN
.config/dunst/beep.m4a Normal file

Binary file not shown.

24
.config/dunst/dunstrc Normal file
View File

@ -0,0 +1,24 @@
[global]
follow = mouse
font = Fantasque Sans Mono 20
frame_width = 1
always_run_script = true
[urgency_low]
background = "#161510"
foreground = "#cccccc"
frame_color = "#727a18"
[urgency_normal]
background = "#161510"
foreground = "#cccccc"
frame_color = "#727a18"
[urgency_critical]
background = "#161510"
foreground = "#cccccc"
frame_color = "#727a18"
[notify]
summary = "*"
script = ~/.config/dunst/notification_handler.sh

View File

@ -0,0 +1,3 @@
#!/bin/sh
mpv ~/.config/dunst/beep.m4a

3
.config/elinks/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
bookmarks
globhist
gotohist

524
.config/elinks/elinks.conf Normal file
View File

@ -0,0 +1,524 @@
## ELinks 0.16.1.1 configuration file
## This is ELinks configuration file. You can edit it manually,
## if you wish so; this file is edited by ELinks when you save
## options through UI, however only option values will be altered
## and missing options will be added at the end of file; if option
## is not written in this file, but in some file included from it,
## it is NOT counted as missing. Note that all your formatting,
## own comments and so on will be kept as-is.
##
## Obviously, if you don't like what ELinks is going to do with
## this file, you can change it by altering the config.saving_style
## option. Come on, aren't we friendly guys after all?
##############################
# Automatically saved options
#
## config
# Configuration handling options.
## config.saving_style_w [0|1]
# This is internal option used when displaying a warning about obsolete
# config.saving_style. You shouldn't touch it.
set config.saving_style_w = 1
## terminal
# Terminal options.
## terminal.st-256color
# Options specific to this terminal type (according to $TERM value).
## terminal.st-256color.transparency [0|1]
set terminal.st-256color.transparency = 1
## ui
# User interface options.
## ui.language <language>
# Language of user interface. 'System' means that the language will be
# extracted from the environment dynamically.
set ui.language = "System"
##############################
# Automatically saved options
#
## terminal
# Terminal options.
## terminal.st-256color
# Options specific to this terminal type (according to $TERM value).
## terminal.st-256color.colors <num>
set terminal.st-256color.colors = 1
##############################
# Automatically saved options
#
## cookies
# Cookies options.
## cookies.accept_policy <num>
# Cookies accepting policy:
# 0 is accept no cookies
# 1 is ask for confirmation before accepting cookie
# 2 is accept all cookies
set cookies.accept_policy = 0
## ui
# User interface options.
## ui.colors
# Default user interface color settings.
## ui.colors.color
# Color settings for color terminal.
## ui.colors.color.mainmenu
# Main menu bar colors.
## ui.colors.color.mainmenu.normal
# Unselected main menu bar item colors.
## ui.colors.color.mainmenu.normal.text <color|#rrggbb>
# Default text color.
set ui.colors.color.mainmenu.normal.text = "white"
## ui.colors.color.mainmenu.normal.background <color|#rrggbb>
# Default background color.
set ui.colors.color.mainmenu.normal.background = "black"
## ui.colors.color.mainmenu.selected
# Selected main menu bar item colors.
## ui.colors.color.mainmenu.selected.text <color|#rrggbb>
# Default text color.
set ui.colors.color.mainmenu.selected.text = "black"
## ui.colors.color.mainmenu.selected.background <color|#rrggbb>
# Default background color.
set ui.colors.color.mainmenu.selected.background = "white"
## ui.colors.color.mainmenu.hotkey
# Main menu hotkey colors.
## ui.colors.color.mainmenu.hotkey.normal
# Main menu unselected hotkey colors.
## ui.colors.color.mainmenu.hotkey.normal.text <color|#rrggbb>
# Default text color.
set ui.colors.color.mainmenu.hotkey.normal.text = "black"
## ui.colors.color.mainmenu.hotkey.normal.background <color|#rrggbb>
# Default background color.
set ui.colors.color.mainmenu.hotkey.normal.background = "white"
## ui.colors.color.mainmenu.hotkey.selected
# Main menu selected hotkey colors.
## ui.colors.color.mainmenu.hotkey.selected.text <color|#rrggbb>
# Default text color.
set ui.colors.color.mainmenu.hotkey.selected.text = "white"
## ui.colors.color.mainmenu.hotkey.selected.background <color|#rrggbb>
# Default background color.
set ui.colors.color.mainmenu.hotkey.selected.background = "black"
## ui.colors.color.menu
# Menu bar colors.
## ui.colors.color.menu.normal
# Unselected menu item colors.
## ui.colors.color.menu.normal.text <color|#rrggbb>
# Default text color.
set ui.colors.color.menu.normal.text = "white"
## ui.colors.color.menu.normal.background <color|#rrggbb>
# Default background color.
set ui.colors.color.menu.normal.background = "black"
## ui.colors.color.menu.selected
# Selected menu item colors.
## ui.colors.color.menu.selected.text <color|#rrggbb>
# Default text color.
set ui.colors.color.menu.selected.text = "black"
## ui.colors.color.menu.selected.background <color|#rrggbb>
# Default background color.
set ui.colors.color.menu.selected.background = "white"
## ui.colors.color.menu.marked
# Marked menu item colors.
## ui.colors.color.menu.marked.text <color|#rrggbb>
# Default text color.
set ui.colors.color.menu.marked.text = "red"
## ui.colors.color.menu.marked.background <color|#rrggbb>
# Default background color.
set ui.colors.color.menu.marked.background = "black"
## ui.colors.color.menu.hotkey
# Menu item hotkey colors.
## ui.colors.color.menu.hotkey.normal
# Menu item unselected hotkey colors.
## ui.colors.color.menu.hotkey.normal.text <color|#rrggbb>
# Default text color.
set ui.colors.color.menu.hotkey.normal.text = "black"
## ui.colors.color.menu.hotkey.normal.background <color|#rrggbb>
# Default background color.
set ui.colors.color.menu.hotkey.normal.background = "white"
## ui.colors.color.menu.hotkey.selected
# Menu item selected hotkey colors.
## ui.colors.color.menu.hotkey.selected.text <color|#rrggbb>
# Default text color.
set ui.colors.color.menu.hotkey.selected.text = "white"
## ui.colors.color.menu.hotkey.selected.background <color|#rrggbb>
# Default background color.
set ui.colors.color.menu.hotkey.selected.background = "black"
## ui.colors.color.menu.frame
# Menu frame colors.
## ui.colors.color.menu.frame.text <color|#rrggbb>
# Default text color.
set ui.colors.color.menu.frame.text = "white"
## ui.colors.color.menu.frame.background <color|#rrggbb>
# Default background color.
set ui.colors.color.menu.frame.background = "black"
## ui.colors.color.dialog
# Dialog colors.
## ui.colors.color.dialog.generic
# Generic dialog colors.
## ui.colors.color.dialog.generic.text <color|#rrggbb>
# Default text color.
set ui.colors.color.dialog.generic.text = "white"
## ui.colors.color.dialog.generic.background <color|#rrggbb>
# Default background color.
set ui.colors.color.dialog.generic.background = "black"
## ui.colors.color.dialog.frame
# Dialog frame colors.
## ui.colors.color.dialog.frame.text <color|#rrggbb>
# Default text color.
set ui.colors.color.dialog.frame.text = "white"
## ui.colors.color.dialog.frame.background <color|#rrggbb>
# Default background color.
set ui.colors.color.dialog.frame.background = "black"
## ui.colors.color.dialog.title
# Dialog title colors.
## ui.colors.color.dialog.title.text <color|#rrggbb>
# Default text color.
set ui.colors.color.dialog.title.text = "white"
## ui.colors.color.dialog.title.background <color|#rrggbb>
# Default background color.
set ui.colors.color.dialog.title.background = "black"
## ui.colors.color.dialog.text
# Dialog text colors.
## ui.colors.color.dialog.text.text <color|#rrggbb>
# Default text color.
set ui.colors.color.dialog.text.text = "white"
## ui.colors.color.dialog.text.background <color|#rrggbb>
# Default background color.
set ui.colors.color.dialog.text.background = "black"
## ui.colors.color.dialog.checkbox
# Dialog checkbox colors.
## ui.colors.color.dialog.checkbox.text <color|#rrggbb>
# Default text color.
set ui.colors.color.dialog.checkbox.text = "darkred"
## ui.colors.color.dialog.checkbox.background <color|#rrggbb>
# Default background color.
set ui.colors.color.dialog.checkbox.background = "black"
## ui.colors.color.dialog.checkbox-selected
# Dialog selected checkbox colors.
## ui.colors.color.dialog.checkbox-selected.text <color|#rrggbb>
# Default text color.
set ui.colors.color.dialog.checkbox-selected.text = "yellow"
## ui.colors.color.title
# Title bar colors.
## ui.colors.color.title.title-bar
# Generic title bar colors.
## ui.colors.color.title.title-bar.text <color|#rrggbb>
# Default text color.
set ui.colors.color.title.title-bar.text = "white"
## ui.colors.color.title.title-bar.background <color|#rrggbb>
# Default background color.
set ui.colors.color.title.title-bar.background = "black"
## ui.colors.color.title.title-text
# Title bar text colors.
## ui.colors.color.title.title-text.text <color|#rrggbb>
# Default text color.
set ui.colors.color.title.title-text.text = "white"
## ui.colors.color.title.title-text.background <color|#rrggbb>
# Default background color.
set ui.colors.color.title.title-text.background = "black"
## ui.colors.color.status
# Status bar colors.
## ui.colors.color.status.showip-text
# Status bar show ip text colors.
## ui.colors.color.status.showip-text.text <color|#rrggbb>
# Default text color.
set ui.colors.color.status.showip-text.text = "white"
## ui.colors.color.status.showip-text.background <color|#rrggbb>
# Default background color.
set ui.colors.color.status.showip-text.background = "black"
## ui.colors.color.status.status-bar
# Generic status bar colors.
## ui.colors.color.status.status-bar.text <color|#rrggbb>
# Default text color.
set ui.colors.color.status.status-bar.text = "white"
## ui.colors.color.status.status-bar.background <color|#rrggbb>
# Default background color.
set ui.colors.color.status.status-bar.background = "black"
## ui.colors.color.status.status-text
# Status bar text colors.
## ui.colors.color.status.status-text.text <color|#rrggbb>
# Default text color.
set ui.colors.color.status.status-text.text = "white"
## ui.colors.color.status.status-text.background <color|#rrggbb>
# Default background color.
set ui.colors.color.status.status-text.background = "black"
## ui.colors.color.tabs
# Tabs bar colors.
## ui.colors.color.tabs.unvisited
# Tab colors for tabs that have not been selected since they completed
# loading.
## ui.colors.color.tabs.unvisited.text <color|#rrggbb>
# Default text color.
set ui.colors.color.tabs.unvisited.text = "white"
## ui.colors.color.tabs.unvisited.background <color|#rrggbb>
# Default background color.
set ui.colors.color.tabs.unvisited.background = "black"
## ui.colors.color.tabs.normal
# Unselected tab colors.
## ui.colors.color.tabs.normal.text <color|#rrggbb>
# Default text color.
set ui.colors.color.tabs.normal.text = "white"
## ui.colors.color.tabs.normal.background <color|#rrggbb>
# Default background color.
set ui.colors.color.tabs.normal.background = "black"
## ui.colors.color.tabs.loading
# Tab colors for tabs that are loading in the background.
## ui.colors.color.tabs.loading.text <color|#rrggbb>
# Default text color.
set ui.colors.color.tabs.loading.text = "darkred"
## ui.colors.color.tabs.loading.background <color|#rrggbb>
# Default background color.
set ui.colors.color.tabs.loading.background = "black"
## ui.colors.color.tabs.selected
# Selected tab colors.
## ui.colors.color.tabs.selected.text <color|#rrggbb>
# Default text color.
set ui.colors.color.tabs.selected.text = "black"
## ui.colors.color.tabs.selected.background <color|#rrggbb>
# Default background color.
set ui.colors.color.tabs.selected.background = "white"
## ui.colors.color.tabs.separator
# Tab separator colors.
## ui.colors.color.tabs.separator.text <color|#rrggbb>
# Default text color.
set ui.colors.color.tabs.separator.text = "white"
## ui.colors.color.tabs.separator.background <color|#rrggbb>
# Default background color.
set ui.colors.color.tabs.separator.background = "black"
## ui.colors.color.desktop
# Desktop background.
## ui.colors.color.desktop.text <color|#rrggbb>
# Default text color.
set ui.colors.color.desktop.text = "white"
## ui.colors.color.desktop.background <color|#rrggbb>
# Default background color.
set ui.colors.color.desktop.background = "black"
## ui.background_char <num>
# Integer value of background character.
set ui.background_char = 32
## ui.show_ip [0|1]
# Whether to display IP of the document in the status bar.
set ui.show_ip = 1
## ui.show_menu_bar_always [0|1]
# Always show menu bar on the screen.
set ui.show_menu_bar_always = 1
## ui.show_status_bar [0|1]
# Show status bar on the screen.
set ui.show_status_bar = 1
## ui.show_title_bar [0|1]
# Show title bar on the screen.
set ui.show_title_bar = 1
##################################
# Automatically saved keybindings
#
bind "main" "k" = "none"
##############################
# Automatically saved options
#
## document
# Document options.
## document.colors
# Default document color settings.
## document.colors.use_document_colors <num>
# Use colors specified in document:
# 0 is use always the default settings
# 1 is use document colors if available, except background
# 2 is use document colors, including background. This can
# mostly look very impressive, but some sites will appear
# really ugly. Note, that obviously if the background is
# not black, it will break the behaviour of transparency.
set document.colors.use_document_colors = 1
##############################
# Automatically saved options
#
## document
# Document options.
## document.browse
# Document browsing options (mainly interactivity).
## document.browse.forms
# Options for handling of the forms interaction.
## document.browse.forms.confirm_submit [0|1]
# Ask for confirmation when submitting a form.
set document.browse.forms.confirm_submit = 0

168
.config/emacs/init.el Normal file
View File

@ -0,0 +1,168 @@
;; rndusr's init.el
;; configure the package manager
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
;; (package-refresh-contents)
; disable annoying ui features
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(setq auto-save-default nil)
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
(defun keymap-symbol (keymap)
"Return the symbol to which KEYMAP is bound, or nil if no such symbol exists."
(catch 'gotit
(mapatoms (lambda (sym)
(and (boundp sym)
(eq (symbol-value sym) keymap)
(not (eq sym 'keymap))
(throw 'gotit sym))))))
(defun get-local-map () (interactive) (message "Current mapping: %S" (keymap-symbol (current-local-map))))
;; download packages
(unless (package-installed-p 'evil)
(package-install 'evil))
(unless (package-installed-p 'org)
(package-install 'org))
(unless (package-installed-p 'org-drill)
(package-install 'org-drill))
(unless (package-installed-p 'accent)
(package-install 'accent))
(unless (package-installed-p 'elfeed)
(package-install 'elfeed))
(unless (package-installed-p 'hackernews)
(package-install 'hackernews))
(unless (package-installed-p 'emms)
(package-install 'emms))
(unless (package-installed-p 'company)
(package-install 'company))
(unless (package-installed-p 'anaconda-mode)
(package-install 'anaconda-mode))
(unless (package-installed-p 'company-anaconda)
(package-install 'company-anaconda))
(unless (package-installed-p 'calfw)
(package-install 'calfw))
(unless (package-installed-p 'calfw-org)
(package-install 'calfw-org))
(unless (package-installed-p 'calfw-ical)
(package-install 'calfw-ical))
;; activate packages
(require 'evil)
(require 'org)
(require 'calfw)
(require 'calfw-org)
(require 'calfw-ical)
(require 'org-drill)
(require 'accent)
(require 'elfeed)
(require 'hackernews)
(require 'emms)
(require 'company)
(require 'anaconda-mode)
(require 'company-anaconda)
;; configure packages
;; - evil-mode
(evil-set-initial-state 'elfeed-search 'emacs)
;; swap ; and :
(with-eval-after-load 'evil-maps
(define-key evil-motion-state-map (kbd ";") 'evil-ex))
(evil-set-leader 'normal (kbd "<SPC>"))
(defun configreload () (interactive) (load "~/.config/emacs/init.el"))
(defun configread () (interactive) (find-file-noselect "~/dot_testing/config/emacs/init.el"))
(defun nixrebuild () (interactive) (term "rebuild"))
(evil-define-key 'normal 'global (kbd "<leader>rr") 'configreload)
(evil-define-key 'normal 'global (kbd "<leader>re") 'configread)
(evil-define-key 'normal 'global (kbd "<leader>nrr") 'nixrebuild)
(evil-ex-define-cmd "get-current-mapping" 'get-local-map)
(evil-mode 1)
;; company-mode
(add-hook 'after-init-hook 'global-company-mode)
(setq company-idle-delay 1
company-tooltip-idle-delay 10
company-require-match nil
company-frontends
'(company-pseudo-tooltip-unless-just-one-frontend-with-delay
company-preview-frontend
company-echo-metadata-frontend)
company-backends '(company-capf))
(setq company-tooltip-align-annotations t)
(add-to-list 'company-backends 'company-anaconda)
(add-hook 'python-mode-hook 'anaconda-mode)
;; org
(setq org-agenda-files '("~/org"))
(setq calendar-week-start-day 1)
(setq org-todo-keywords '((type "MEETING" "CLASS" "TODO" "REHERSAL" "|" "DONE")))
(setq org-return-follows-link t)
;; calfw
(defun google-calendar (id) (concatenate 'string "https://calendar.google.com/calendar/ical/" id "%40group.calendar.google.com/public/basic.ics"))
(defun my-open-calendar ()
(interactive)
(cfw:open-calendar-buffer
:contents-sources
(list
(cfw:org-create-source "Green")
(cfw:ical-create-source "wcs" (google-calendar "c_037e243v5md54rj8kp1k898oo4") "IndianRed")
(cfw:ical-create-source "band" (google-calendar "i6bong6iferbcuf1u25jg47t7k") "Blue")
(cfw:ical-create-source "schoology" "https://wcschools.schoology.com/calendar/feed/ical/1692031887/ef3eab3f5ac45935472a9fa6f601a63a/ical.ics" "Yellow")
)))
;; emms
(require 'emms-player-simple)
(require 'emms-source-file)
(require 'emms-source-playlist)
(emms-all)
(emms-default-players)
(evil-define-key 'normal 'emms-browser-mode-map (kbd "z") 'emms-browser-expand-one-level)
(evil-define-key 'normal 'emms-browser-mode-map (kbd "RET") 'emms-browser-add-tracks-and-play)
(evil-define-key 'normal 'emms-browser-mode-map (kbd "e") 'emms-browser-add-tracks)
;; - elfeed
(global-set-key (kbd "C-x w") 'elfeed)
(setq elfeed-feeds
'("http://nullprogram.com/feed/"
"https://drewdevault.com/blog/index.xml"
"https://digitallibrary.un.org/rss?ln=en&p=libya&rg=50&c=Resource%20Type&c=UN%20Bodies"
"https://planet.emacslife.com/atom.xml"))
(setq elfeed-db-directory "~/.cache/elfeed")
;; - accent.el
(evil-define-key 'insert 'global (kbd "C-k") 'accent-menu)
;; fonts
(set-face-attribute 'default nil
:font "Fantasque Sans Mono 10"
:foreground "white" :background "gray8")
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages
'(company-anaconda anaconda-mode company emms bongo accent org-drill hackernews evil elfeed)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

View File

@ -3,10 +3,10 @@
name = stupidcomputer
[credential "https://git.beepboop.systems"]
helper = !rbw-git-handler gitea
helper = !git-rbw-wrap gitea
[credential "https://github.com"]
helper = !rbw-git-handler github-pat
helper = !git-rbw-wrap github-pat
[advice]
addIgnoredFile = false

View File

@ -72,7 +72,6 @@ opt.inccommand = 'nosplit'
opt.hidden = true
opt.linebreak = true
opt.path = '.,/usr/include,**'
vim.opt.signcolumn = 'yes'
vim.cmd.colorscheme('earth')
opt.statusline="%f %r%m%q%h%=%y 0x%02B %04l:%03c:%03p"
vim.api.nvim_exec("let &titlestring='%{expand(\"%:p\")}'", true)
@ -116,41 +115,41 @@ globals.netrw_liststyle = 3
globals.netrw_browser_split = 4
-- }}}
-- lazy.nvim {{{
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" }
}, true, {})
vim.fn.getchar()
os.exit(1)
-- packer.nvim {{{
-- taken from packer.nvim readme
local ensure_packer = function()
local fn = vim.fn
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
vim.cmd [[packadd packer.nvim]]
return true
end
return false
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
{ "nvim-lua/plenary.nvim" },
{ "nvim-telescope/telescope.nvim" },
{ "nvim-tree/nvim-tree.lua" },
{ 'dinhhuy258/git.nvim' },
{ "octarect/telescope-menu.nvim" },
{ "VonHeikemen/lsp-zero.nvim" },
{ "neovim/nvim-lspconfig" },
{ "hrsh7th/nvim-cmp" },
{ "hrsh7th/cmp-nvim-lsp" },
{ "L3MON4D3/LuaSnip" },
{ "saadparwaiz1/cmp_luasnip" },
{ "lervag/vimtex" },
{ "https://github.com/protex/better-digraphs.nvim" },
},
checker = { enabled = true },
})
-- }}}
local packer_bootstrap = ensure_packer()
local packer = require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
use 'nvim-lua/plenary.nvim'
use 'nvim-telescope/telescope.nvim'
use 'octarect/telescope-menu.nvim'
use 'VonHeikemen/lsp-zero.nvim'
use 'neovim/nvim-lspconfig'
use 'hrsh7th/nvim-cmp'
use 'hrsh7th/cmp-nvim-lsp'
use 'L3MON4D3/LuaSnip'
use 'saadparwaiz1/cmp_luasnip'
use 'lervag/vimtex'
use 'https://github.com/protex/better-digraphs.nvim'
if packer_bootstrap then
require('packer').sync()
end
end);
-- -- }}}
nnoremap('<leader>ff', function()
require('telescope.builtin').find_files()
end)
@ -167,23 +166,9 @@ lsp_zero.on_attach(function(client, bufnr)
lsp_zero.default_keymaps({buffer = bufnr})
end)
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup({})
lspconfig.texlab.setup({})
lspconfig.nixd.setup({})
lspconfig.pylsp.setup({
settings = {
pylsp = {
plugins = {
pycodestyle = {
ignore = {"W391"},
maxLineLength = 100,
}
}
}
}
})
require('lspconfig').lua_ls.setup({})
require('lspconfig').texlab.setup({})
require('lspconfig').pylyzer.setup({})
-- }}}
-- luasnip configuration {{{
@ -210,31 +195,3 @@ luasnip.add_snippets("tex", {
})
})
-- }}}
-- nvim-tree {{{
require('nvim-tree').setup()
-- }}}
-- nvim-cmp setup {{{
local cmp = require("cmp")
cmp.setup({
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
}),
snippet = {
expand = function(args)
vim.snippet.expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
['<C-h>'] = cmp.mapping.select_next_item({behavior = 'select'}),
['<C-k>'] = cmp.mapping.select_prev_item({behavior = 'select'}),
['<C-Space>'] = cmp.mapping.confirm({select = false}),
}),
})
-- }}}
-- git.nvim setup {{{
require('git').setup()
-- }}}

View File

@ -99,11 +99,6 @@ vim.api.nvim_create_autocmd({"TermOpen"}, {
vim.wo.number = false
end
})
vim.api.nvim_create_autocmd({"TermOpen"}, {
pattern = {"*"},
command = "setlocal nospell",
})
-- }}}
-- netrw options {{{

30
.config/ssh/config Normal file
View File

@ -0,0 +1,30 @@
Host mainsail
User usr
Port 22
Host phone
User u0_a193
Port 8022
Host netbox
HostName beepboop.systems
User ryan
Port 443
Host mainsail-prox
HostName localhost
User usr
Port 55554
ProxyJump netbox
Host mlg-prox
HostName localhost
User usr
Port 2222
ProxyJump mainsail-prox
Host x230t-prox
HostName x230t
User usr
Port 22
ProxyJump mainsail-prox

View File

@ -1,3 +1,3 @@
# start the wm
sxhkd-mode sxhkdrc
mode sxhkdrc
bspwm

View File

@ -1,13 +1,6 @@
# exit mouse mode
Escape
sxhkd-mode sxhkdrc
w
sxhkd-mode sxhkdrc
# send the escape key
]
xdotool key Escape
mode sxhkdrc
# move left
{ctrl +,shift +,_} h
@ -35,16 +28,16 @@ q
# move the mouse to the top of the window
g ; g
bspwm-mouse top
mousehelper top
# ditto for bottom
G
bspwm-mouse bottom
mousehelper bottom
# ditto for left
0
bspwm-mouse left
mousehelper left
# ditto for right
dollar
bspwm-mouse right
mousehelper right

21
.config/sxhkd/phone Normal file
View File

@ -0,0 +1,21 @@
# essentially the same thing as sxhkdrc, but super is replaced with ctrl + b and all shortcuts are chorded
ctrl + b; c
st
ctrl + b; Return
st
ctrl + b; q
bspc node -c
ctrl + b; {_,shift + } {1-9,0}
bspc {desktop -f,node -d} '{1-9,10}'
ctrl + b; {_,ctrl +,shift + }{h,j,k,l}
bspc node -{f,p,s} {west,south,north,east}
ctrl + b; d
tmenu_run
ctrl + b; m
mode phonemouse

43
.config/sxhkd/phonemouse Normal file
View File

@ -0,0 +1,43 @@
# exit mouse mode
w
mode phone
# move left
{ctrl +,shift +,_} h
xdotool mousemove_relative -- {-5,-50,-20} 0
# move down
{ctrl +,shift +,_} j
xdotool mousemove_relative -- 0 {5,50,20}
# move up
{ctrl +,shift +,_} k
xdotool mousemove_relative -- 0 {-5,-50,-20}
# move right
{ctrl +,shift +,_} l
xdotool mousemove_relative -- {5,50,20} 0
# left, middle, right click
{ctrl +,_} {a,s,d}
xdotool {mousedown,click} {1,2,3}
# let go of clicked button
q
xdotool mouseup 1; xdotool mouseup 2; xdotool mouseup 3
# move the mouse to the top of the window
g ; g
mousehelper top
# ditto for bottom
G
mousehelper bottom
# ditto for left
0
mousehelper left
# ditto for right
dollar
mousehelper right

61
.config/sxhkd/sxhkdrc Normal file
View File

@ -0,0 +1,61 @@
# spawn a terminal
super + Return
st
# spawn the launcher
super + d
tmenu_run
# kill sxhkd with USR1 and restart bspwm
super + r
pkill -USR1 -x sxhkd; \
bspc wm -r
super + {_,shift + }n
nws {local,national}
# switch to "mouse mode"
super + m
mode mouse
# kill the current node
super + q
bspc node -c
# kill bspwm
super + e
bspc quit 0
# systemctl suspend
super + shift + e
systemctl suspend
# password menu
super + z
passmenu
# start a browser
super + b
chromium
# manipulate a node
super + {_,ctrl +,shift + }{h,j,k,l}
bspc node -{f,p,s} {west,south,north,east}
# change to or move a node to a desktop
super + {_,shift + } {1-9,0}
bspc {desktop -f,node -d} '0{1-9,0}'
super + space; {_,shift + } {1-9,0}
bspc {desktop -f,node -d} '1{1-9,0}'
# change a node to tiling, floating, or fullscreen
super + {t,f,s}
bspc node -t {tiled,floating,fullscreen}
# x230t specific -- activate the tablet menu
XF86RotateWindows
tabletmenu
shift + Insert
special_ins

View File

@ -0,0 +1,92 @@
sanitize commandline tridactyllocal tridactylsync
" better thean google
set searchengine duckduckgo
" redirect youtube, reddit, twitter to proxies
autocmd DocStart https://www.youtube.com js let vsites = ["invidious.snopyta.org", "yewtu.be", "invidious.kavin.rocks", "vid.puffyan.us"]; tri.excmds.urlmodify("-t", "www.youtube.com", vsites[Math.floor(Math.random() * vsites.length)])
autocmd DocStart https://www.reddit.com js let rsites = ["libredd.it", "libreddit.spike.codes", "libreddit.kavin.rocks", "reddit.invak.id", "reddit.phii.me"]; tri.excmds.urlmodify("-t", "www.reddit.com", rsites[Math.floor(Math.random() * rsites.length)])
autocmd DocStart https://twitter.com js let tsites = ["nitter.dcs0.hu", "twitter.dr460nf1r3.org", "n.ramle.be", "nitter.cz", "nitter.nl"]; tri.excmds.urlmodify("-t", "www.twitter.com", tsites[Math.floor(Math.random() * tsites.length)])
" shamelessly stolen from glacambre
alias clone jsb -p tri.native.run("git clone '" + JS_ARG "' /home/usr/git" + JS_ARG.split("/").slide(-1))
alias so source ~/.tridactylrc
alias cookie sanitize cookies
alias clearhistory sanitize history
unbind <C-f>
set hintchars asdfhjkl
set incsearch true
set modindicatorshowkeys true
colors dark
" crap ton of setprefs
setpref app.normandy.first_run false
setpref app.normandy.migrationsApplied 10
setpref app.shield.optoutstudies.enabled false
setpref browser.aboutConfig.showWarning false
setpref browser.laterrun.enabled false
setpref browser.newtabpage.activity-stream.discoverystream.endpointSpocsClear "http://example.com"
setpref browser.newtabpage.activity-stream.discoverystream.endpoints "http://example.com"
setpref browser.newtabpage.activity-stream.feeds.section.highlights false
setpref browser.newtabpage.activity-stream.feeds.section.topstories false
setpref browser.newtabpage.activity-stream.feeds.snippets false
setpref browser.newtabpage.activity-stream.feeds.telemetry false
setpref browser.newtabpage.activity-stream.feeds.topsites false
setpref browser.newtabpage.activity-stream.impressionId "hmmst"
setpref browser.newtabpage.activity-stream.showSearch false
setpref browser.newtabpage.activity-stream.telemetry false
setpref browser.newtabpage.activity-stream.telemetry.structuredIngestion false
setpref browser.newtabpage.activity-stream.telemetry.structuredIngestion.endpoint "http://example.com"
setpref browser.ping-centre.telemetry false
setpref browser.search.suggest.enabled false
setpref browser.safebrowsing.appRepURL ""
setpref browser.safebrowsing.blockedURIs.enabled false
setpref browser.safebrowsing.downloads.remote.enabled false
setpref browser.safebrowsing.downloads.remote.url ""
setpref browser.safebrowsing.gethashURL ""
setpref browser.safebrowsing.malware.enabled false
setpref browser.safebrowsing.malware.reportURL ""
setpref browser.safebrowsing.phishing.enabled false
setpref browser.safebrowsing.provider.google.gethashURL ""
setpref browser.safebrowsing.provider.google.lists ""
setpref browser.safebrowsing.provider.google.reportMalwareMistakeURL ""
setpref browser.safebrowsing.provider.google.reportPhishMistakeURL ""
setpref browser.safebrowsing.provider.google.reportURL ""
setpref browser.safebrowsing.provider.google.updateURL ""
setpref browser.safebrowsing.provider.google4.dataSharing.enabled false
setpref browser.safebrowsing.provider.google4.dataSharingURL ""
setpref browser.safebrowsing.provider.google4.reportMalwareMistakeURL ""
setpref browser.safebrowsing.provider.google4.reportPhishMistakeURL ""
setpref browser.safebrowsing.provider.google4.reportURL ""
setpref browser.safebrowsing.provider.mozilla.gethashURL ""
setpref browser.safebrowsing.provider.mozilla.updateURL ""
setpref browser.safebrowsing.reportPhishURL ""
setpref browser.safebrowsing.reportURL ""
setpref browser.safebrowsing.updateURL ""
setpref dom.push.connection.enabled false
setpref dom.presentation.receiver.enabled
setpref extensions.pocket.api "example.com"
setpref extensions.pocket.enabled true
setpref geo.enabled false
setpref identity.fxaccounts.pairing.enabled false
setpref privacy.resistFingerprinting true
setpref privacy.trackingprotection.socialtracking.enabled true
setpref security.app_menu.recordEventTelemetry false
setpref security.certerrors.recordEventTelemetry false
setpref security.identitypopup.recordEventTelemetry false
setpref security.protectionspopup.recordEventTelemetry false
setpref toolkit.telemetry.archive.enabled false
setpref toolkit.telemetry.bhrPing.enabled false
setpref toolkit.telemetry.firstShutdownPing.enabled false
setpref toolkit.telemetry.newProfilePing.enabled false
setpref toolkit.telemetry.reportingpolicy.firstRun false
setpref toolkit.telemetry.server "http://example.com"
setpref toolkit.telemetry.server "IANA/IETF"
setpref toolkit.telemetry.shutdownPingSender.enabled false
setpref toolkit.telemetry.unified false
setpref toolkit.telemetry.updatePing.enabled false
setpref browser.newtabpage.activity-stream.discoverystream.enabled false
setpref browser.uiCustomization.state '{"placements":{"widget-overflow-fixed-list":[],"nav-bar":["back-button","forward-button","umatrix_raymondhill_net-browser-action","stop-reload-button","downloads-button","urlbar-container","vim-vixen_i-beam_org-browser-action"],"toolbar-menubar":["menubar-items"],"TabsToolbar":["tabbrowser-tabs","new-tab-button","alltabs-button"],"PersonalToolbar":["personal-bookmarks"]},"seen":["developer-button","umatrix_raymondhill_net-browser-action","vim-vixen_i-beam_org-browser-action"],"dirtyAreaCache":["nav-bar","toolbar-menubar","TabsToolbar","PersonalToolbar"],"currentVersion":16,"newElementCount":4}'
setpref privacy.resistFingerprinting.letterboxing false

6
.gitmodules vendored
View File

@ -1,6 +0,0 @@
[submodule "builds/dwm"]
path = builds/dwm
url = https://git.beepboop.systems/stupidcomputer/dwm
[submodule "builds/dmenu"]
path = builds/dmenu
url = https://git.suckless.org/dmenu

View File

@ -1,19 +1,41 @@
randomuser's dotfiles
=====================
![an image of the desktop while editing this repo's flake.nix](./demo.png)
features
--------
- `bspwm` + `sxhkd` + `st` + `firefox`
- most everything on the desktop save for the browser, media viewers, and desktop background, is a terminal
- on the server, runs gitea + simple-nixos-mailserver
- built with NixOS flakes
installation
------------
`sudo nixos-rebuild --flake .#your-flake-name-here switch`
if you're trying to install `netbox`, then use the `--impure` flag:
`sudo nixos-rebuild --flake .#netbox switch --impure`
for installation onto Termux, run `make`.
things to do
------------
* [ ] integrate `disko` and `sops-nix` into the setup
* [ ] write an app that replaces the nextcloud phonetrack setup
* [ ] establish backup infrastructure for `netbox`
- integrate `disko` and `sops-nix` into the setup
- establish backup infrastructure for `netbox`
- move gmail-mail-bridge into mail-sync repo
* (perhaps figure out how to produce a flake for it)
license
-------
all materials in this repository, except for:
* `./config/pape.jpg`, which is of unknown license, and
* `./builds/st`, which is licensed under MIT, pursuant to `./builds/st/LICENSE`,
* `./home/wallpapers/pape.jpg`, which is of unknown license, and
* `./builds/st`, which is licensed under MIT, persuant to `./builds/st/LICENSE`,
is (c) rndusr, randomuser, stupidcomputer, etc 2024-2025 and licensed under the GPLv3 (see `./LICENSE`)
is (c) rndusr, randomuser, stupidcomputer, etc 2024 and licensed under the GPLv3 (see `./LICENSE`)

View File

@ -1,11 +0,0 @@
{
age = {
secrets = {
nm-home-net-config = {
file = ../../secrets/nm-home-net-config.age;
path = "/etc/NetworkManager/system-connections/main.nmconnection";
};
};
identityPaths = [ "/home/usr/.ssh/id_ed25519" ];
};
}

View File

@ -1 +0,0 @@
sudo nixos-rebuild switch --flake .?submodules=1

View File

@ -1,81 +1,58 @@
{ pkgs, lib, machines, ... }:
{ lib, config, pkgs, ...}:
{
imports = [
../../config/aristotle.nix
./paperless.nix
./sshd.nix
./agenix.nix
./hardware-configuration.nix
../../modules/bootstrap.nix
../../modules/common.nix
../../modules/x11.nix
../../modules/pulse.nix
../../modules/hosts.nix
../../modules/tlp.nix
../../modules/media.nix
../../modules/anki.nix
../../modules/power-control.nix
../../modules/adb.nix
../../modules/rbw.nix
];
programs.adb.enable = true;
environment.systemPackages = with pkgs; [
xscreensaver
texliveFull
libreoffice
boot.loader.grub = {
ecryptfs
ffmpeg
thunderbird
ledger
ranger
];
hardware.bluetooth = {
enable = true;
device = "/dev/nvme0n1";
};
networking = {
hostName = "aristotle";
networkmanager.enable = true;
firewall.allowedTCPPorts = [ 24800 ];
hosts = lib.attrsets.mergeAttrsList [
(machines.mkHosts machines "router" "localnet")
(machines.mkHosts machines "copernicus" "localnet")
(machines.mkHosts machines "phone" "localnet")
(machines.mkHosts machines "netbox" "internet")
] // {
"127.0.0.1" = [ "news.ycombinator.com" ];
};
};
hardware = {
bluetooth = {
enable = true;
settings.General.ControllerMode = "bredr";
};
};
time.timeZone = "America/Chicago";
i18n.defaultLocale = "en_US.UTF-8";
users.users.usr = {
isNormalUser = true;
description = "usr";
extraGroups = [ "networkmanager" "wheel" "input" "adbusers" ];
};
nixpkgs.config.allowUnfree = true;
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
};
services = {
xserver = {
enable = true;
xkb = {
layout = "us";
variant = "";
};
};
libinput.enable = true;
tlp.enable = true;
};
powerManagement.powertop.enable = true;
systemd.services."getty@tty6" = {
overrideStrategy = "asDropin";
serviceConfig.ExecStart = ["" "@${pkgs.coreutils}/bin/cat"];
};
systemd.user.services.ssh-socks5-proxy = {
services.printing.enable = true;
services.avahi = {
enable = true;
description = "SOCKS5 proxy over ssh";
serviceConfig.ExecStart = "${pkgs.openssh}/bin/ssh -ND 127.0.0.1:4000 netbox";
wantedBy = []; # start only when I say so
nssmdns4 = true;
openFirewall = true;
};
users.users.usr.extraGroups = [ "input" ];
services.getty.autologinUser = "usr";
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
hardware.pulseaudio.enable = true;
networking.hostName = "aristotle";
powerManagement.cpuFreqGovernor = "powersave";
system.stateVersion = "24.05";
}

View File

@ -1,24 +1,39 @@
{ config, lib, modulesPath, ... }:
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot = {
initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
initrd.kernelModules = [ ];
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/e10eea5c-4dca-40f7-86cc-02105bc6d4e0";
{ device = "/dev/disk/by-uuid/bcae81bd-95d9-457f-8694-709f887cf2e2";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/CAEA-2672";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [ ];
# 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
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

10
boxes/aristotle/home.nix Normal file
View File

@ -0,0 +1,10 @@
{ lib, inputs, config, pkgs, home, ... }:
{
imports = [
../../home/x11.nix
../../home/chromium
];
home.stateVersion = "24.05";
}

View File

@ -0,0 +1,6 @@
Git.Git
CollegeBoard.Bluebook
AutoHotKey.AutoHotKey
Brave.Brave
Google.Chrome.EXE
Bitwarden.Bitwarden

View File

@ -1,18 +0,0 @@
{ lib, ... }:
{
services.paperless = {
enable = true;
# we're only hosting on loopback, so this is safe
passwordFile = builtins.toFile "admin_pass" "admin";
address = "127.0.0.1"; # see above comment
port = 5000;
};
# start paperless manually so as to not destroy battery life
systemd.services = {
paperless-scheduler.wantedBy = lib.mkForce [];
redis-paperless.wantedBy = lib.mkForce [];
redis-paperless.after = lib.mkForce [];
};
}

View File

@ -1,27 +0,0 @@
{ lib, machines, ... }:
{
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
};
listenAddresses = [
{
addr = "0.0.0.0";
port = 2222;
}
];
};
users.users.usr.openssh.authorizedKeys.keys = with machines; [
copernicus.pubkey
aristotle.pubkey
phone.pubkey
];
networking.firewall.allowedTCPPorts = [ 2222 ];
# don't start the sshd immediately
systemd.services.sshd.wantedBy = lib.mkForce [];
}

View File

@ -1,11 +0,0 @@
{ machines, ... }:
{
age = {
secrets = {
copernicus-wg-priv = {
file = machines.copernicus.wg-privkey;
};
};
identityPaths = [ "/home/usr/.ssh/id_ed25519" ];
};
}

View File

@ -1 +0,0 @@
sudo nixos-rebuild --flake .?submodules=1 switch --impure -I nixos-config=./

View File

@ -1,24 +1,39 @@
{ pkgs, lib, machines, ...}:
{ lib, config, pkgs, ...}:
{
imports = [
./hardware-configuration.nix
./nvidia.nix
./agenix.nix
./services
../../config/copernicus.nix
../../lib/bootstrap.nix
../x230t/special-ssh-magic.nix
../../modules/ssh-phone-home.nix
../../modules/hosts.nix
../../modules/bootstrap.nix
../../modules/common.nix
../../modules/x11.nix
../../modules/rbw.nix
];
virtualisation.docker.enable = true;
users.users.usr.extraGroups = [
"docker"
"adbusers"
];
environment.systemPackages = with pkgs; [
wine
xdotool
qemu
virt-manager
libreoffice
nomacs
vscodium
thunderbird
libreoffice
texliveMedium
kdePackages.kdenlive
audacity
bespokesynth
musescore
unzip
ledger
@ -26,15 +41,16 @@
imagemagick
pciutils
usbutils
pwvucontrol
dunst
libnotify
ffmpeg
mdadm
git-annex
tigervnc
dmenu
(pkgs.callPackage ../../builds/sssg.nix {})
(pkgs.callPackage ../../builds/archutils.nix {})
];
services.hardware.bolt.enable = true; # thunderbolt support
@ -42,13 +58,15 @@
enable = true;
settings = {
General = {
# AutoEnable = true;
AutoEnable = true;
Enable = "Source,Sink,Media,Socket";
# ControllerMode = "bredr";
ControllerMode = "bredr";
};
};
};
virtualisation.virtualbox.host.enable = true;
boot.loader = {
efi = {
canTouchEfiVariables = true;
@ -71,15 +89,6 @@
pipewire = {
enable = true;
extraConfig.pipewire = {
"properties" = {
default.clock.allowed-rates = [ 44100 48000 96000 ];
"log.level" = 4;
"default.clock.quantum" = 256;
"default.clock.min-quantum" = 256;
"default.clock.max-quantum" = 256;
};
};
alsa = {
enable = true;
support32Bit = true;
@ -88,6 +97,7 @@
};
};
programs.adb.enable = true;
powerManagement.cpuFreqGovernor = "performance";
@ -95,15 +105,6 @@
nixpkgs.config.allowUnfree = true;
networking = {
hostName = "copernicus";
interfaces.eno1 = {
useDHCP = true;
ipv4.addresses = [
{
address = "192.168.1.201";
prefixLength = 24;
}
];
};
firewall = {
enable = true;
interfaces = {
@ -111,7 +112,6 @@
allowedTCPPorts = [ 6000 ];
allowedTCPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect
{ from = 10000; to = 10100; } # temp stuff
];
allowedUDPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect
@ -128,29 +128,9 @@
};
};
};
hosts = lib.attrsets.mergeAttrsList [
(machines.mkHosts machines "aristotle" "localnet")
(machines.mkHosts machines "router" "localnet")
(machines.mkHosts machines "phone" "localnet")
(machines.mkHosts machines "netbox" "internet")
];
};
services.getty.autologinUser = "usr";
time.timeZone = "America/Chicago";
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
users.users.usr = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "adbusers" ];
initialPassword = "usr";
};
programs.kdeconnect.enable = true;
system.stateVersion = "24.05"; # don't change this, lol
}

View File

@ -1,4 +1,8 @@
{ config, lib, modulesPath, ... }:
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
@ -6,7 +10,7 @@
boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" "psmouse" "wacom" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
@ -24,6 +28,13 @@
[ { device = "/dev/disk/by-uuid/fc5366cc-2cec-415e-85dd-7c01a4e4fb4f"; }
];
# 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
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

10
boxes/copernicus/home.nix Normal file
View File

@ -0,0 +1,10 @@
{ lib, inputs, config, pkgs, home, ... }:
{
imports = [
../../home/x11.nix
../../home/chromium
];
home.stateVersion = "23.11";
}

View File

@ -1,9 +1,10 @@
{ config, pkgs, ... }:
{ config, lib, pkgs, ... }:
{
# Make sure opengl is enabled
hardware.graphics = {
hardware.opengl = {
enable = true;
enable32Bit = true;
driSupport = true;
driSupport32Bit = true;
};
environment.systemPackages = with pkgs; [

View File

@ -1,6 +1,9 @@
{ lib, config, pkgs, ...}:
{
imports = [
./photoprism.nix
./wireguard.nix
./sshd.nix
./grafana.nix
];
}

View File

@ -0,0 +1,44 @@
{ lib, config, pkgs, ...}:
{
services.grafana = {
enable = true;
settings = {
server = {
http_addr = "10.100.0.2";
http_port = 9802;
domain = "grafana.beepboop.systems";
};
};
};
services.prometheus = {
enable = true;
listenAddress = "10.100.0.2";
port = 9001;
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
listenAddress = "10.100.0.2";
port = 9002;
};
};
scrapeConfigs = [
{
job_name = "copernicus";
static_configs = [{
targets = [ "10.100.0.2:9002" ];
}];
}
{
job_name = "netbox";
static_configs = [{
targets = [ "10.100.0.1:9002" ];
}];
}
];
};
}

View File

@ -0,0 +1,16 @@
{ lib, config, pkgs, ...}:
{
services.photoprism = {
enable = true;
originalsPath = "/var/lib/photoprism/originals";
address = "10.100.0.2";
settings = {
PHOTOPRISM_ADMIN_USER = "usr";
PHOTOPRISM_ADMIN_PASSWORD = "testing"; # THIS IS AN INITIAL PASSWORD -- changed later
PHOTOPRISM_SITE_TITLE = "photos.beepboop.systems";
PHOTOPRISM_SITE_URL = "https://photos.beepboop.systems";
PHOTOPRISM_DEFAULT_LOCALE = "en";
};
};
}

View File

@ -1,31 +0,0 @@
{ machines, ...}:
{
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
};
listenAddresses = [
{
addr = "192.168.1.201";
port = 2222;
}
{
addr = "10.100.0.2";
port = 2222;
}
];
};
networking.firewall.interfaces.eno1 = {
allowedTCPPorts = [ 2222 ];
};
users.users.usr.openssh.authorizedKeys.keys = [
machines.copernicus.pubkey
machines.aristotle.pubkey
machines.phone.pubkey
];
}

View File

@ -1,19 +1,20 @@
{ config, machines, ... }:
{ lib, config, pkgs, ... }:
{
networking = {
firewall.allowedUDPPorts = [ 50000 ];
firewall.allowedUDPPorts = [ 51820 ];
wireguard.interfaces = {
wg0 = {
ips = [ "10.100.0.2/24" ];
listenPort = 50000;
listenPort = 51820;
privateKeyFile = config.age.secrets.copernicus-wg-priv.path;
privateKeyFile = "/home/usr/wg-keys/private";
peers = [
{ # netbox
publicKey = machines.netbox.wg-pubkey;
publicKey = "0fOqAfsYO4HvshMPnlkKL7Z1RChq98hjDr0Q8o7OJFE=";
allowedIPs = [ "10.100.0.0/24" ]; # only stuff in the wg-subnet (10.100.0.*)
endpoint = "149.28.63.115:50000";
endpoint = "149.28.63.115:51820";
persistentKeepalive = 25;
}
];

View File

@ -0,0 +1,82 @@
{ lib, config, pkgs, ...}:
{
imports = [
./hardware-configuration.nix
../../modules/ssh-phone-home.nix
../../modules/bootstrap.nix
../../modules/hosts.nix
../../modules/common.nix
];
# nix optimization
nix.optimise = {
automatic = true;
dates = [ "03:45" ];
};
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda";
networking.hostName = "mainsail";
services.getty.greetingLine = "
welcome to mainsail |`-:_
,----....____ | `+.
( ````----....|___ |
\\ _ ````----....____
\\ _) ```---.._
\\ \\
)`.\\ )`. )`. )`. )`. )`. )`. )`. )`. )`. )`.
-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `
";
environment.systemPackages = with pkgs; [
neovim
git
curl
];
services.home-assistant = {
enable = true;
extraComponents = [
# Components required to complete the onboarding
"netgear"
"hue"
"nest"
"esphome"
"met"
"radio_browser"
];
config = {
# Includes dependencies for a basic setup
# https://www.home-assistant.io/integrations/default_config/
default_config = {};
};
openFirewall = true;
};
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
};
};
services.ssh-phone-home = {
enable = true;
localUser = "usr";
remoteHostname = "beepboop.systems";
remotePort = 443;
remoteUser = "ryan";
bindPort = 55554;
};
users.users.usr.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKbhM3wj0oqjR3pUaZgpfX4Xo4dlzvBTbQ48zHyg7Pwx usr" # x230t
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB2xUbQw9+RCPVw7qCFm4NNCP/MpS2BIArcwMv0KdKOI usr" # mlg
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHZw5bg0TrvSkW/XQa4c+2iLbIKOxfMGbjy5Nb3HSfBv usr" # phone
];
system.stateVersion = "23.11";
}

View File

@ -0,0 +1,32 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "ums_realtek" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/948aeaf8-cb7e-4f85-ae3e-1bc6a25ec156";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/617cb1ae-a788-429a-b0d4-63d46d8a4e1b";
fsType = "ext4";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/d82ae76c-68f4-4e70-9162-5dab5f84375b"; }
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

98
boxes/mlg/default.nix Normal file
View File

@ -0,0 +1,98 @@
{ lib, config, pkgs, ...}:
{
imports = [
./hardware-configuration.nix
./nvidia.nix
../../modules/ssh-phone-home.nix
../../modules/hosts.nix
../../modules/bootstrap.nix
../../modules/common.nix
../../modules/x11.nix
../../modules/pulse.nix
../../modules/discord.nix
# ../../modules/gaming.nix
../../modules/rbw.nix
];
virtualisation.docker.enable = true;
users.users.usr.extraGroups = [
"docker"
];
environment.systemPackages = with pkgs; [
wine
xdotool
qemu
virt-manager
libreoffice
nomacs
vscodium
thunderbird
libreoffice
texliveMedium
ledger
git-annex
];
services.hardware.bolt.enable = true; # thunderbolt support
hardware.bluetooth = {
enable = true;
settings = {
General = {
Enable = "Source,Sink,Media,Socket";
ControllerMode = "bredr";
};
};
};
services.openssh.enable = true;
services.ssh-phone-home = {
enable = true;
localUser = "usr";
remoteHostname = "mainsail";
remotePort = 22;
remoteUser = "usr";
bindPort = 2222;
};
boot.loader = {
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
grub = {
efiSupport = true;
device = "nodev";
};
};
services.printing.enable = true;
services.avahi.enable = true; # runs the Avahi daemon
services.avahi.nssmdns4 = true; # enables the mDNS NSS plug-in
services.avahi.openFirewall = true; # opens the firewall for UDP port 5353
powerManagement.cpuFreqGovernor = "performance";
nixpkgs.config.allowUnfree = true;
networking = {
hostName = "mlg";
firewall = {
enable = true;
allowedTCPPorts = [ 6000 8000 ];
allowedTCPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect
];
allowedUDPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect
];
};
};
programs.kdeconnect.enable = true;
system.stateVersion = "23.11"; # don't change this, lol
}

View File

@ -0,0 +1,41 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# testing
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/eada30c2-ffc5-4410-b1cf-fcea6a4040ff";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/5318-1A44";
fsType = "vfat";
};
swapDevices = [ ];
# 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
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp58s0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp7s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

10
boxes/mlg/home.nix Normal file
View File

@ -0,0 +1,10 @@
{ lib, inputs, config, pkgs, home, ... }:
{
imports = [
../../home/x11.nix
../../home/chromium
];
home.stateVersion = "23.11";
}

39
boxes/mlg/nvidia.nix Normal file
View File

@ -0,0 +1,39 @@
{ config, lib, pkgs, ... }:
{
# Make sure opengl is enabled
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
environment.systemPackages = with pkgs; [
glxinfo
];
# Tell Xorg to use the nvidia driver (also valid for Wayland)
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
# Modesetting is needed for most Wayland compositors
modesetting.enable = true;
# Use the open source version of the kernel module
# Only available on driver 515.43.04+
open = false;
# Enable the nvidia settings menu
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
prime = {
sync.enable = true;
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
};
}

View File

@ -1,37 +0,0 @@
{ machines, ... }:
{
age.secrets = {
gitea-postgres-password = {
file = ../../secrets/gitea-postgres-password.age;
mode = "0700";
owner = "gitea";
group = "gitea";
};
mailaccount = {
file = ../../secrets/mailaccount.age;
};
netbox-wg-priv = {
file = machines.netbox.wg-privkey;
};
radicale-passwd = {
file = ../../secrets/radicale-passwd.age;
owner = "radicale";
group = "radicale";
};
nextcloud-passwd = {
file = ../../secrets/nextcloud-admin-passwd.age;
owner = "nextcloud";
group = "nextcloud";
};
pcomon-secrets-file = {
file = ../../secrets/pcomon-secrets-file.age;
owner = "pcomon";
group = "pcomon";
};
};
}

View File

@ -1,22 +1,27 @@
{ pkgs, lib, machines, ... }:
{
imports = [
./hardware-configuration.nix
../../lib/bootstrap.nix
{ lib, config, pkgs, ... }:
./agenix.nix
./franklincce.nix
./gitea.nix
./mail.nix
./nextcloud.nix
./nginx.nix
./pcomon.nix
./radicale.nix
./ssh.nix
./sslh.nix
./vaultwarden.nix
./wireguard.nix
];
{
imports =
[
./hardware-configuration.nix
../../modules/bootstrap.nix
./radicale.nix
./ssh.nix
./gitea.nix
./radicale.nix
./vaultwarden.nix
./sslh.nix
./rss2email.nix
./fail2ban.nix
./nginx.nix
./franklincce.nix
./wireguard.nix
./photoprism-bridge.nix
./grafana-bridge.nix
./prometheus.nix
./socks.nix
];
nix = {
optimise = {
@ -50,6 +55,7 @@
];
system = {
copySystemConfiguration = true;
stateVersion = "23.05"; # don't change this, lol
};
@ -62,10 +68,10 @@
# we don't want to bring in the entirety of home-manager for this, so just
# write some files as a hack
text = ''
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/config/bash/bashrc /home/ryan/.bashrc
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/config/bash/profile /home/ryan/.bash_profile
${pkgs.coreutils}/bin/mkdir -p /home/ryan/config/nvim
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/config/nvim/init.min.lua /home/ryan/.config/nvim/init.lua
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/.config/bash/bashrc /home/ryan/.bashrc
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/.config/bash/profile /home/ryan/.bash_profile
${pkgs.coreutils}/bin/mkdir -p /home/ryan/.config/nvim
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/.config/nvim/init.min.lua /home/ryan/.config/nvim/init.lua
'';
deps = [];
};
@ -74,10 +80,10 @@
system.activationScripts = {
copyEssentialConfiguration = {
text = ''
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/config/bash/bashrc /root/.bashrc
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/config/bash/profile /root/.bash_profile
${pkgs.coreutils}/bin/mkdir -p /root/config/nvim
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/config/nvim/init.min.lua /root/.config/nvim/init.lua
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/.config/bash/bashrc /root/.bashrc
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/.config/bash/profile /root/.bash_profile
${pkgs.coreutils}/bin/mkdir -p /root/.config/nvim
${pkgs.coreutils}/bin/cp /home/ryan/dot_testing/.config/nvim/init.min.lua /root/.config/nvim/init.lua
'';
deps = [];
};
@ -89,6 +95,14 @@
};
users.users.ryan = {
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKbhM3wj0oqjR3pUaZgpfX4Xo4dlzvBTbQ48zHyg7Pwx usr" # x230t
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILBGh1FHPneg7PCDkhMs2BCJPTIRVJkRTKpOj1w02ydD usr" # copernicus
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGrpVDLQszFKoYbvYKRyVTTpehxR0BVU47SXkz39l2wK usr" # mainsail
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB2xUbQw9+RCPVw7qCFm4NNCP/MpS2BIArcwMv0KdKOI usr" # mlg
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHZw5bg0TrvSkW/XQa4c+2iLbIKOxfMGbjy5Nb3HSfBv usr" # phone
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDCufie2JWc4ylZHIi03uR0RB/79/hTacn9qnlzqs+kaWcdk7eyHqpg3zmVrETCZQxJ8ssZx4+tlwC0+seOjgIfNktfKjiRpes2Sib0MowO3lRgzqJ0pZ5AEA/pc4314meAZP/CibFw54CWxOySEXsCWKm157HVJHpJ7P0HwqzHod4jXxUWKwMoZo5XyOTTMHv4oytcHTydIeiSymw3RtvEtqpBCRE3W5kIiJNuCXnZGZBxvOnhJsQ0FkeXgByeXOLFxUw0ma6Jy/621T2GrBnmFhiSIV+T7xk/cfgP+D1V9x2wCLX5gPQaNzwL03v3xohxnJwRa6EXTR9LzXE7Rhnolbmkb/YPPpI6U0RpueZrHv/1CIA3OSKnQh1cp/jMeP4DfeO+fSY1SsRZICQ3ndlnYkXtalEzGPxeLUgLsh6SxSIK+7jjlDGrJCUbOMHhR+92vBXy7XE8tgO2FuhrAIiroIsaWmZO/7sike3ps3GFEZHZMEe2v3IDqfX/Iecn++U= usr" # aristotle
];
isNormalUser = true;
extraGroups = [ "wheel" "docker" ];
};
@ -115,9 +129,5 @@
};
};
};
hosts = lib.attrsets.mergeAttrsList [
(machines.mkHosts machines "copernicus" "wgnet")
(machines.mkHosts machines "aristotle" "wgnet")
];
};
}

42
boxes/netbox/fail2ban.nix Normal file
View File

@ -0,0 +1,42 @@
{ lib, config, pkgs, ... }:
{
services.fail2ban = {
enable = true;
ignoreIP = [
"192.168.1.0/24"
];
extraPackages = [pkgs.ipset];
banaction = "iptables-ipset-proto6-allports";
jails = {
"nginx-bruteforce" = ''
enabled = true
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
'';
};
};
environment.etc = {
"fail2ban/filter.d/nginx-bruteforce.conf".text = ''
[Definition]
failregex = ^<HOST>.*GET.*(matrix/server|\.php|admin|wp\-).* HTTP/\d.\d\" 404.*$
'';
"fail2ban/filter.d/postfix-bruteforce.conf".text = ''
[Definition]
failregex = warning: [\w\.\-]+\[<HOST>\]: SASL LOGIN authentication failed.*$
journalmatch = _SYSTEMD_UNIT=postfix.service
'';
};
}

View File

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ lib, config, pkgs, ... }:
{
virtualisation.docker.enable = true;

View File

@ -1,17 +1,18 @@
{ config, ... }:
{ lib, config, pkgs, ... }:
{
services.gitea = {
enable = true;
appName = "beepboop.systems"; # Give the site a name
database = {
type = "postgres";
passwordFile = config.age.secrets.gitea-postgres-password.path;
passwordFile = "/etc/gittea-pass";
};
settings.security.INSTALL_LOCK = true;
settings.service = {
SHOW_REGISTRATION_BUTTON = false;
DISABLE_REGISTRATION = true;
};
settings.ui.DEFAULT_THEME = "arc-green";
settings.api.ENABLE_SWAGGER = false;
settings.server = {
DOMAIN = "git.beepboop.systems";

View File

@ -0,0 +1,16 @@
{ lib, config, pkgs, ... }:
{
services.nginx.virtualHosts."grafana.beepboop.systems" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://10.100.0.2:9802";
proxyWebsockets = true;
extraConfig = ''
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_buffering off;
'';
};
};
}

View File

@ -1,4 +1,8 @@
{ lib, ... }:
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ ];
@ -21,6 +25,10 @@
[ { device = "/dev/disk/by-uuid/57fbd850-1ced-4e21-9e52-4f3b529c61b0"; }
];
# 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
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.ens3.useDHCP = lib.mkDefault true;

View File

@ -1,24 +0,0 @@
{ config, inputs, ... }:
{
imports = [
inputs.simple-nixos-mailserver.nixosModule
];
mailserver = {
enable = true;
fqdn = "mail.beepboop.systems";
domains = [ "beepboop.systems" ];
loginAccounts = {
"ryan@beepboop.systems" = {
# nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt' > /hashed/password/file/location
hashedPasswordFile = config.age.secrets.mailaccount.path;
aliases = [
"info@beepboop.systems"
"postmaster@beepboop.systems"
];
};
};
certificateScheme = "acme-nginx";
};
}

View File

@ -1,24 +0,0 @@
{ config, pkgs, ... }:
{
services.nextcloud = {
enable = true;
https = true;
package = pkgs.nextcloud30;
hostName = "nextcloud.beepboop.systems";
config.adminpassFile = config.age.secrets.nextcloud-passwd.path;
settings.overwriteprotocol = "https";
extraApps = {
phonetrack = pkgs.fetchNextcloudApp {
sha256 = "sha256-zQt+3t86HZJVT/wiETHkPdTwV6Qy+iNkH3/THtTe1Xs=";
license = "agpl3Only";
url = "https://github.com/julien-nc/phonetrack/releases/download/v0.8.1/phonetrack-0.8.1.tar.gz";
};
};
extraAppsEnable = true;
};
services.nginx.virtualHosts."${config.services.nextcloud.hostName}" = {
forceSSL = true;
enableACME = true;
};
}

View File

@ -1,3 +1,4 @@
{ lib, config, pkgs, ... }:
{
services.nginx.enable = true;
services.nginx.clientMaxBodySize = "100m";
@ -16,19 +17,6 @@
};
services.nginx.virtualHosts."tfb.beepboop.systems" = {
forceSSL = true;
enableACME = true;
locations."/" = {
extraConfig = ''
return 301 https://marching.beepboop.systems;
'';
};
locations."/groupme" = {
proxyPass = "http://10.100.0.2:7439";
};
};
services.nginx.virtualHosts."marching.beepboop.systems" = {
forceSSL = true;
enableACME = true;
root = "/var/www/tfb.beepboop.systems";
@ -38,9 +26,6 @@
absolute_redirect off;
'';
};
locations."/groupme" = {
proxyPass = "http://10.100.0.2:7439";
};
};
security.acme = {

View File

@ -1,27 +0,0 @@
{ config, pkgs, ... }:
let
pcomon = (pkgs.callPackage ../../builds/pcomon.nix {});
in {
users.users.pcomon = {
isSystemUser = true;
group = "pcomon";
};
users.groups.pcomon = {};
systemd.services.pcomon = {
serviceConfig.type = "oneshot";
script = ''
${pkgs.coreutils}/bin/mkdir -p /run/pcomon
${pkgs.coreutils}/bin/chown -R pcomon:pcomon /run/pcomon
${pcomon}/bin/pcomon ${config.age.secrets.pcomon-secrets-file.path}
'';
};
systemd.timers.pcomon = {
wantedBy = [ "timers.target" ];
partOf = [ "pcomon.service" ];
timerConfig.OnCalendar = "*:*:0/30";
};
}

View File

@ -0,0 +1,16 @@
{ lib, config, pkgs, ... }:
{
services.nginx.virtualHosts."photos.beepboop.systems" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://10.100.0.2:2342";
proxyWebsockets = true;
extraConfig = ''
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_buffering off;
'';
};
};
}

View File

@ -0,0 +1,13 @@
{ lib, config, pkgs, ... }:
{
services.prometheus = {
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
listenAddress = "10.100.0.1";
port = 9002;
};
};
};
}

View File

@ -1,11 +1,11 @@
{ config, ... }:
{ lib, config, pkgs, ... }:
{
services.radicale = {
enable = true;
settings = {
auth = {
type = "htpasswd";
htpasswd_filename = config.age.secrets.radicale-passwd.path;
htpasswd_filename = "radicale-passwd";
htpasswd_encryption = "plain";
};
};

View File

@ -0,0 +1,24 @@
{ lib, config, pkgs, ... }:
{
services.rss2email = {
enable = true;
to = "ryan@beepboop.systems";
feeds = {
"eff" = {
url = "https://www.eff.org/rss/updates.xml";
};
"nixos" = {
url = "https://nixos.org/blog/announcements-rss.xml";
};
"drewdevault" = {
url = "https://drewdevault.com/blog/index.xml";
};
"nullprogram" = {
url = "https://nullprogram.com/feed/";
};
"computersarebad" = {
url = "https://computer.rip/rss.xml";
};
};
};
}

14
boxes/netbox/socks.nix Normal file
View File

@ -0,0 +1,14 @@
{ lib, config, pkgs, ... }:
{
services._3proxy = {
enable = true;
services = [
{
type = "socks";
auth = [ "none" ];
bindAddress = "10.100.0.1";
bindPort = 3128;
}
];
};
}

View File

@ -1,62 +1,13 @@
{ pkgs, machines, ... }:
{ lib, config, pkgs, ... }:
{
services.openssh = {
enable = true;
ports = [55555];
settings = {
X11Forwarding = false;
AllowTcpForwarding = true;
PermitRootLogin = "no";
PasswordAuthentication = false;
};
};
users.users.ryan.openssh.authorizedKeys.keys = [
machines.copernicus.pubkey
machines.aristotle.pubkey
machines.phone.pubkey
];
# save ip addresses in cache from repeat logins
services.nginx.virtualHosts."localhost" = {
listen = [{ addr = "127.0.0.1"; port = 9414; }];
extraConfig = ''
location / {
proxy_pass_request_headers off;
proxy_pass https://ipinfo.io/;
proxy_cache_key $scheme://$host$uri$is_args$query_string;
proxy_cache_valid 203 1d;
}
'';
};
environment.etc."ssh/sshrc".text = ''
login_ip="''${SSH_CLIENT%% *}"
is_in_ignored=$(grep "$login_ip" /etc/ssh/ignored_ips -c)
if [ "$is_in_ignored" -gt 0 ]; then
exit
fi
time=$(date "+%T%:z")
geodata=$(
curl -s 127.0.0.1:9414/$login_ip |
sed '1d;$d;/readme/d;s/^ //g'
)
${pkgs.mailutils}/bin/mail \
ryan@beepboop.systems -r "ssh" \
-s "ssh login from $login_ip at $time" \
<<EOF
Hi there,
\`netbox\` was just logged into from $login_ip at $time (America/Chicago).
It was not in /etc/ssh/ignored_ips.
If this is you, that's great! If not, there is most certainly
an unauthorized user connected to the machine -- in which case, the
prudent course of action is to shut the machine down.
For your information, here is geolocation data from $login_ip.
$geodata
EOF
'';
}

View File

@ -1,21 +1,19 @@
{ lib, config, pkgs, ... }:
{
services.sslh = {
enable = true;
settings = {
protocols = [
{
host = "localhost";
name = "ssh";
port = "55555";
service = "ssh";
}
{
host = "localhost";
name = "tls";
port = "442";
}
];
transparent = true;
};
settings.protocols = [
{
host = "localhost";
name = "ssh";
port = "55555";
service = "ssh";
}
{
host = "localhost";
name = "tls";
port = "442";
}
];
};
}

View File

@ -1,3 +1,4 @@
{ lib, config, pkgs, ... }:
{
services.vaultwarden.enable = true;
services.vaultwarden.config = {

View File

@ -1,4 +1,5 @@
{ config, machines, pkgs, ... }:
{ lib, config, pkgs, ... }:
{
networking = {
nat = {
@ -6,13 +7,13 @@
externalInterface = "eth0";
internalInterfaces = [ "wg0" ];
};
firewall.allowedUDPPorts = [ 50000 ];
firewall.allowedUDPPorts = [ 51820 ];
wireguard.interfaces = {
wg0 = {
ips = [ "10.100.0.1/24" ];
listenPort = 50000;
listenPort = 51820;
postSetup = ''
${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE
@ -21,15 +22,15 @@
${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE
'';
privateKeyFile = config.age.secrets.netbox-wg-priv.path;
privateKeyFile = "/home/ryan/wg-keys/private";
peers = [
{ # copernicus
publicKey = machines.copernicus.wg-pubkey;
publicKey = "JlH1X4KRT+B8Uau+qTLtBqyapkbGClIj1db7znU77kc=";
allowedIPs = [ "10.100.0.2/32" ];
}
{ # aristotle
publicKey = machines.aristotle.wg-pubkey;
publicKey = "Sw2yyMhyS8GOCWm1VuGn3Y7cfx606dXOGK5mux8ckQU=";
allowedIPs = [ "10.100.0.3/32" ];
}
];

View File

@ -0,0 +1,7 @@
{ config, pkgs, ... }:
{
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
}

31
boxes/phone/default.nix Normal file
View File

@ -0,0 +1,31 @@
{ config, lib, pkgs, ... }:
{
imports = [
./bootstrap.nix
];
home-manager = {
backupFileExtension = "hm-bak";
useGlobalPkgs = true;
config = ./home.nix;
};
environment.packages = with pkgs; [
tigervnc
git
tmux
hostname
tigervnc
xorg.xinit
# tar
# awk
# sed
elinks
];
environment.etcBackupExtension = ".bak";
system.stateVersion = "23.05";
time.timeZone = "America/Chicago";
}

18
boxes/phone/home.nix Normal file
View File

@ -0,0 +1,18 @@
{ lib, pkgs, home, ... }:
{
imports = [
../../home/nvim
../../home/ssh
../../home/git # needed for flakes
../../home/vdirsyncer
../../home/isync
../../home/khal
../../home/todoman
../../home/msmtp
../../home/neomutt
../../home/rbw
( import ../../home/bash { isRoot = true; } )
];
home.stateVersion = "23.05";
}

View File

@ -1,2 +1 @@
app_cache/
gpapp_cache/

View File

@ -1,3 +0,0 @@
com.ministrycentered.PlanningCenter
com.groupme.android
com.brivo.pass

View File

@ -4,31 +4,3 @@ for i in $(cat apps); do
curl "$i" --max-redirs 999 -L -C - -o "app_cache/$output_name"
adb install "app_cache/$output_name"
done
mkdir -p gpapp_cache
for i in $(cat gpapps); do
apkeep -a "$i" ./gpapp_cache/
done
for i in $(ls gpapp_cache/ | grep xapk); do
# this is specific to planning center online
xapk_playground=$(mktemp)
rm $xapk_playground
mkdir $xapk_playground
cp gpapp_cache/$i $xapk_playground
cd $xapk_playground
mkdir out
unzip $i -d out
cd -
cd $xapk_playground/out
rm icon.png
rm manifest.json
adb install-multiple *
cd -
done
cd gpapp_cache
for i in $(ls | grep '\.apk'); do
adb install $i
done

View File

@ -1,7 +0,0 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
packages = [
pkgs.apkeep
];
}

View File

@ -1,4 +1,2 @@
git-annex-install
git-annex-install.*
git-annex.linux

View File

@ -21,17 +21,18 @@ utils-sh:
rebuild-sh:
mkdir -p ~/.local/bin
cp ../../../builds/rebuild/* ~/.local/bin
pip-pkgs:
pip3 install vdirsyncer
pip3 install khal
# pip3 install khard
termux-pkgs:
pkg install -y \
pkg install \
tur-repo \
x11-repo
pkg install -y \
pkg install \
neovim \
python-pip \
feh \
@ -64,9 +65,10 @@ termux-pkgs:
pandoc \
wget \
which \
rsync \
openssl \
chromium
openssl
pkg install \
chromium # from tur-repo
termux-dots:
mkdir -p ~/.local/bin

20
boxes/virtbox/default.nix Normal file
View File

@ -0,0 +1,20 @@
{ lib, config, pkgs, ...}:
{
imports = [
./hardware-configuration.nix
../../modules/bootstrap.nix
../../modules/hosts.nix
../../modules/common.nix
../../modules/x11.nix
../../modules/pulse.nix
../../modules/discord.nix
];
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/vda";
networking.hostName = "virtbox";
system.stateVersion = "23.11";
}

View File

@ -0,0 +1,31 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/7b70ab88-296c-4737-90b2-267cb2432dc1";
fsType = "ext4";
};
swapDevices = [ ];
# 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
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

9
boxes/virtbox/home.nix Normal file
View File

@ -0,0 +1,9 @@
{ lib, inputs, config, pkgs, home, ... }:
{
imports = [
../../home/x11.nix
];
home.stateVersion = "23.11";
}

66
boxes/x230t/default.nix Normal file
View File

@ -0,0 +1,66 @@
{ lib, config, pkgs, ...}:
{
imports = [
./hardware-configuration.nix
./special-ssh-magic.nix
../../modules/bootstrap.nix
../../modules/common.nix
../../modules/x11.nix
../../modules/pulse.nix
../../modules/hosts.nix
../../modules/tlp.nix
../../modules/media.nix
../../modules/anki.nix
../../modules/power-control.nix
../../modules/adb.nix
../../modules/rbw.nix
];
environment.systemPackages = with pkgs; [
xscreensaver
texliveFull
libreoffice
ecryptfs
ffmpeg
thunderbird
ledger
ranger
];
hardware.bluetooth = {
enable = true;
};
services.printing.enable = true;
services.avahi = {
enable = true;
nssmdns = true;
openFirewall = true;
};
services.udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="input", KERNEL=="event[0-20]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", MODE:="0666" GROUP="usr", SYMLINK+="input/touchscreen"
'';
users.users.usr.extraGroups = [ "input" ];
services.getty.autologinUser = "usr";
boot.loader = {
grub = {
timeoutStyle = "hidden";
enable = true;
device = "/dev/sda";
splashImage = null;
};
timeout = 1;
};
hardware.pulseaudio.enable = true;
networking.hostName = "x230t";
system.stateVersion = "23.11";
}

View File

@ -0,0 +1,33 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/772f67d6-9434-42f1-aa3e-153e41affe4c";
fsType = "ext4";
};
swapDevices = [ ];
# 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
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s25.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

10
boxes/x230t/home.nix Normal file
View File

@ -0,0 +1,10 @@
{ lib, inputs, config, pkgs, home, ... }:
{
imports = [
../../home/x11.nix
../../home/chromium
];
home.stateVersion = "23.11";
}

View File

@ -0,0 +1,6 @@
{ lib, config, pkgs, ...}:
{
services.sshd.enable = true;
systemd.services.sshd.wantedBy = lib.mkForce [];
}

39
builds/archutils.nix Normal file
View File

@ -0,0 +1,39 @@
{ stdenv
, lib
, pkgs
, makeWrapper
, sxhkd
, bash
, feh
, jq
, fzy
, curl
, texliveFull
}:
stdenv.mkDerivation rec {
pname = "archutils";
version = "1.01";
src = ./archutils;
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
bash
feh
jq
curl
fzy
texliveFull
];
installPhase = ''
mkdir -p $out/bin
for i in $(ls $src/); do
cp $src/$i $out/bin
ln -sf $out/bin/tmenu_run $out/bin/regenerate
wrapProgram $out/bin/$i --prefix PATH : ${lib.makeBinPath [ bash feh jq curl fzy texliveFull ]}
done
'';
}

View File

@ -0,0 +1,118 @@
#!/bin/sh
working_directory=$(date +%Y-%m-%d)
human_readable=$(date "+%d %b %Y")
cd ~/annex/briefs/
mkdir "$working_directory"
cd "$working_directory"
cat > main.tex <<EOF
\documentclass[oneside]{article}
\usepackage{amssymb}
\usepackage[left=1.5cm, right=1.5cm, top=1.5cm, bottom=1.5cm]{geometry}
\pagenumbering{gobble}
\begin{document}
\noindent {\Large Ryan Marina} \hspace{\fill} {\Large Briefing for $human_readable}
\noindent \textsc{Internal Document System} \hspace{\fill} $ \square $ \textit{scanned?} $ \square $ \textit{not scanned?}
\noindent \textit{Digital Archive Supplement} \hspace{\fill} internal notes: \rule{3cm}{0.4pt}
\noindent \texttt{iref:annex/briefs/$working_directory}
\vspace{0.4cm}
\noindent \textsc{Schedule}
\vspace{-0.30cm}
\noindent \rule{\textwidth}{0.4pt}
EOF
schedule=$(
khal list today today --format "{calendar}|{categories}|{start-time}|{end-time}|{title}" |
grep -E '^home\|school\||band\|'
)
IFS='
'
for class in $schedule; do
echo "$class" |
awk -F'|' '{
print "\\noindent " $5 " \\hspace{\\fill} \\textit{(" $3 "-" $4 ")}\n\n"
}' >> main.tex
done
cat >> main.tex <<EOF
\vspace{0.4cm}
\noindent \textsc{Unresolved Items}
\vspace{-0.30cm}
\noindent \rule{\textwidth}{0.4pt}
EOF
todo_items=$(
todo --porcelain |
jq -r '.[].summary'
)
IFS='
'
for todo in $todo_items; do
printf '\\noindent $ \\square $ %s\n\n' "$todo" >> main.tex
done
cat >> main.tex <<EOF
\vspace{0.4cm}
EOF
# generate notices
ssh netbox df -h |
grep /dev/vda3 |
awk -F' ' '{print "\\item \\texttt{" $1 "} on \\texttt{netbox} is at " $5 " utilization."}' |
sed 's/\%/\\%/g' > notices.tex
if [ -f notices.tex ]; then
cat >> main.tex <<EOF
\noindent \textsc{Procedural Notices}
\vspace{-0.30cm}
\noindent \rule{\textwidth}{0.4pt}
\begin{enumerate}
\input{notices}
\end{enumerate}
\vspace{0.4cm}
EOF
fi
cat >> main.tex <<EOF
\noindent \textsc{Items to be Appended to the Agenda}
\vspace{-0.30cm}
\noindent \rule{\textwidth}{0.4pt}
\end{document}
EOF
pdflatex main.tex
printf "[!] briefing generated\n"
printf "file:///home/usr/annex/briefs/%s/main.pdf\n" "$working_directory"

Some files were not shown because too many files have changed in this diff Show More