Compare commits
204 Commits
statusbar-
...
master
Author | SHA1 | Date |
---|---|---|
stupidcomputer | b73c435f5a | |
stupidcomputer | b6b86824de | |
stupidcomputer | ae22abd986 | |
stupidcomputer | 3d87c8bfca | |
stupidcomputer | 8efb0b321a | |
stupidcomputer | 4ab7330eb5 | |
stupidcomputer | a5b1bc0b80 | |
stupidcomputer | b084dc49e1 | |
stupidcomputer | 71659092dc | |
stupidcomputer | fd07fdbb34 | |
stupidcomputer | 66424aa9b1 | |
stupidcomputer | 18ccd71602 | |
stupidcomputer | 6f2c96613b | |
stupidcomputer | 7f4055435b | |
stupidcomputer | 657287d513 | |
stupidcomputer | 4640167eb0 | |
stupidcomputer | 3edb488963 | |
stupidcomputer | a03d535034 | |
stupidcomputer | 005df66d02 | |
stupidcomputer | e7a6168d72 | |
stupidcomputer | 6667309c1a | |
stupidcomputer | 19585d432a | |
stupidcomputer | fe89438ad2 | |
stupidcomputer | c736b1c6a8 | |
stupidcomputer | d0f532f15c | |
stupidcomputer | a4284d5904 | |
stupidcomputer | 287d092972 | |
stupidcomputer | a2a94368c6 | |
stupidcomputer | d0b8013497 | |
stupidcomputer | 15f2580cab | |
stupidcomputer | b2de08b2dc | |
stupidcomputer | 2001e824a5 | |
stupidcomputer | 2b2db129b1 | |
stupidcomputer | 29e75e319f | |
stupidcomputer | 2045d94da3 | |
stupidcomputer | a7964a221f | |
stupidcomputer | 66a6fc1a7c | |
stupidcomputer | 672f385a2a | |
stupidcomputer | 808ce0fefc | |
stupidcomputer | af0395badd | |
stupidcomputer | 5aceed436c | |
stupidcomputer | 55cb186947 | |
stupidcomputer | 8478a2f7cc | |
stupidcomputer | 37743be5dd | |
stupidcomputer | 625a5bcc04 | |
stupidcomputer | 51b091a6a3 | |
stupidcomputer | 6a8d7e2c5c | |
stupidcomputer | 4169e02552 | |
stupidcomputer | 6de18e3c81 | |
stupidcomputer | a9a92371dd | |
stupidcomputer | e1b6469287 | |
stupidcomputer | bafc27a047 | |
stupidcomputer | 339b39efcd | |
stupidcomputer | 7a488636f4 | |
stupidcomputer | 93d923f109 | |
stupidcomputer | 95d727c4a5 | |
stupidcomputer | d2cb348769 | |
stupidcomputer | e5cf3a102d | |
stupidcomputer | 9e8baced38 | |
stupidcomputer | 67881fcad5 | |
stupidcomputer | 58a6ddd306 | |
stupidcomputer | 4bc1865a2e | |
stupidcomputer | 7b5954997e | |
stupidcomputer | e604037100 | |
stupidcomputer | bf7565e916 | |
stupidcomputer | a1f763ab67 | |
stupidcomputer | 0f3c6a3874 | |
stupidcomputer | 885bc145f8 | |
stupidcomputer | 36c2b69932 | |
stupidcomputer | 9ac137dcbb | |
stupidcomputer | b3abec4911 | |
stupidcomputer | 5ece5b7bc9 | |
stupidcomputer | 3f06705f89 | |
stupidcomputer | 4c16d744a4 | |
stupidcomputer | 542d05f0df | |
stupidcomputer | c569ba00d7 | |
stupidcomputer | 40731b3740 | |
stupidcomputer | 928c65dfc4 | |
stupidcomputer | 4064d774ad | |
stupidcomputer | b1ab4677ab | |
stupidcomputer | 22ce9198e8 | |
stupidcomputer | 7db704a59c | |
stupidcomputer | af38624f59 | |
stupidcomputer | 3001ba4dde | |
stupidcomputer | cc89c4ed0e | |
stupidcomputer | b0ad4e58f0 | |
stupidcomputer | c824d7a6b5 | |
stupidcomputer | b1c87c3b86 | |
stupidcomputer | 2be886d132 | |
stupidcomputer | 221b97c41c | |
stupidcomputer | 7ef78737d5 | |
stupidcomputer | 7f0dde3687 | |
stupidcomputer | c569ae410d | |
stupidcomputer | b47225c26b | |
stupidcomputer | a167c6161f | |
stupidcomputer | f5da4b013b | |
stupidcomputer | 9c811c5b77 | |
stupidcomputer | fdd8c5144f | |
stupidcomputer | ce0b116cbb | |
stupidcomputer | c015833774 | |
stupidcomputer | d16d8f2991 | |
stupidcomputer | 403af5a796 | |
stupidcomputer | bf93ab10c0 | |
stupidcomputer | 6946936158 | |
stupidcomputer | e35562e6a4 | |
stupidcomputer | e08c671a95 | |
stupidcomputer | 8dc19fd4ab | |
stupidcomputer | 07980aa0db | |
stupidcomputer | 85bf27d8b3 | |
stupidcomputer | 9cb6b9e34d | |
stupidcomputer | 2653aa81dd | |
stupidcomputer | 5decb4c14c | |
stupidcomputer | db8a710e51 | |
stupidcomputer | 18e99c3b15 | |
stupidcomputer | efd46a51ba | |
stupidcomputer | 0a145e9ac8 | |
stupidcomputer | 38bee39349 | |
stupidcomputer | 5e27475b23 | |
stupidcomputer | 935964a047 | |
stupidcomputer | b268a84393 | |
stupidcomputer | ca4515d440 | |
stupidcomputer | 8ed9beffba | |
stupidcomputer | ecbd242551 | |
stupidcomputer | 43a639af99 | |
stupidcomputer | fc7bee4b2b | |
stupidcomputer | 74a6e7658a | |
stupidcomputer | 2cc261dc68 | |
stupidcomputer | e58604ad2c | |
stupidcomputer | 6baa5c0e96 | |
stupidcomputer | 264ef86797 | |
stupidcomputer | f4d9057f44 | |
stupidcomputer | f98acbb12a | |
stupidcomputer | bd1731aae8 | |
stupidcomputer | 1b300b233e | |
stupidcomputer | 90e4234f2a | |
stupidcomputer | b834f6e76a | |
stupidcomputer | 5f17ccf995 | |
stupidcomputer | c23635a853 | |
stupidcomputer | b32e3af440 | |
stupidcomputer | fc7c140bc1 | |
stupidcomputer | 3f85eab3ba | |
stupidcomputer | ec0f618a60 | |
stupidcomputer | 94e1957b55 | |
stupidcomputer | a514c944bd | |
stupidcomputer | aa91852de0 | |
stupidcomputer | 26fa23ab80 | |
stupidcomputer | 0672122eb1 | |
stupidcomputer | 115deb8fc0 | |
stupidcomputer | 413796ae2a | |
stupidcomputer | 858bfb84d0 | |
stupidcomputer | 1703177ade | |
stupidcomputer | fc785fa6dd | |
stupidcomputer | 1210e716f3 | |
stupidcomputer | e781396a19 | |
stupidcomputer | 085fadf2d0 | |
stupidcomputer | 6cfbe5e003 | |
stupidcomputer | 0e5d3288f2 | |
stupidcomputer | c1ff21e877 | |
stupidcomputer | 53a9878e82 | |
stupidcomputer | 237f7c2691 | |
stupidcomputer | fd3f89ce28 | |
stupidcomputer | 66b98eab2e | |
stupidcomputer | e7e75d747c | |
stupidcomputer | 236529f36a | |
stupidcomputer | d9f3b42108 | |
stupidcomputer | 5620e61f31 | |
stupidcomputer | 5161262388 | |
stupidcomputer | a0866a7bfd | |
stupidcomputer | 36b441f054 | |
stupidcomputer | 1be3c2feaa | |
stupidcomputer | 6e80934f75 | |
stupidcomputer | cb5a278470 | |
stupidcomputer | db20d9e047 | |
stupidcomputer | edceb9cf4e | |
stupidcomputer | 8563eede63 | |
stupidcomputer | f7c7671dce | |
stupidcomputer | 032df33f95 | |
stupidcomputer | f28f9837f6 | |
stupidcomputer | 921c36dc0f | |
stupidcomputer | 427885772a | |
stupidcomputer | b2256fdc19 | |
stupidcomputer | 9053b258c0 | |
stupidcomputer | 1bd70f34ca | |
stupidcomputer | c713065135 | |
stupidcomputer | 56193d308a | |
stupidcomputer | 56e59a8331 | |
stupidcomputer | 43c689ff90 | |
stupidcomputer | 4da2c989cd | |
stupidcomputer | bd1bbdfb1f | |
stupidcomputer | c40fc1eebf | |
stupidcomputer | 1648db66d2 | |
stupidcomputer | f2ff0448aa | |
stupidcomputer | 246e43bae7 | |
stupidcomputer | 7ae57a2f0d | |
stupidcomputer | 883a0e6ee6 | |
stupidcomputer | 8c7ba43b93 | |
stupidcomputer | 6ede499b2f | |
stupidcomputer | 9a64781d08 | |
stupidcomputer | 900e8e2445 | |
stupidcomputer | 937e2c648a | |
stupidcomputer | 45bbbac20c | |
stupidcomputer | ca80f73ef2 | |
stupidcomputer | d106210de2 | |
stupidcomputer | f2d4c7c364 |
|
@ -0,0 +1,4 @@
|
|||
.config
|
||||
mimeapps.list
|
||||
pulse/
|
||||
chromium/
|
|
@ -0,0 +1 @@
|
|||
hist
|
|
@ -1,8 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
# if not interactive, don't do anything
|
||||
[ -z "$PS1" ] && return
|
||||
|
||||
# some housekeeping
|
||||
shopt -s autocd
|
||||
set -o vi # vim mode
|
||||
alias ls="ls --color=auto"
|
||||
alias ll="ls -lah --color=auto"
|
||||
function cd() {
|
||||
|
@ -14,12 +15,49 @@ 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="\h:\w\$ "
|
||||
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}')"
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
# paths and stuff
|
||||
export PATH="$PATH:$HOME/.local/bin"
|
||||
|
||||
if [ $(hostname) = "localhost" ]; then # this is phone
|
||||
export PATH="$PATH:$HOME/dot_testing/boxes/phone/out-of-tree/git-annex.linux"
|
||||
fi
|
||||
export MANPATH="$(manpath -q):$HOME/.local/share/man"
|
||||
export EDITOR="nvim"
|
||||
mkdir -p "$HOME/.local/bin" "$HOME/.share/man"
|
||||
|
@ -51,6 +55,9 @@ export ELINKS_CONFDIR="$HOME/.config/elinks"
|
|||
# dbus configuration
|
||||
export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus"
|
||||
|
||||
# make nix-shell respect our PS1
|
||||
export NIX_SHELL_PRESERVE_PROMPT=1
|
||||
|
||||
# source the bashrc(s)
|
||||
[ -f $HOME/.config/bash/bashrc ] && . $HOME/.config/bash/bashrc
|
||||
[ -f $HOME/.bashrc ] && . $HOME/.bashrc
|
||||
|
|
|
@ -26,3 +26,5 @@ bspc config top_padding 20
|
|||
|
||||
# post-wm configuration
|
||||
disp
|
||||
|
||||
bspc desktop -f 1
|
||||
|
|
Binary file not shown.
|
@ -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
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
mpv ~/.config/dunst/beep.m4a
|
|
@ -0,0 +1,3 @@
|
|||
bookmarks
|
||||
globhist
|
||||
gotohist
|
|
@ -3,10 +3,19 @@
|
|||
name = stupidcomputer
|
||||
|
||||
[credential "https://git.beepboop.systems"]
|
||||
username = stupidcomputer
|
||||
helper = !git-rbw-wrap gitea
|
||||
|
||||
[credential "https://github.com"]
|
||||
helper = !git-rbw-wrap github-pat
|
||||
|
||||
[advice]
|
||||
addIgnoredFile = false
|
||||
|
||||
[init]
|
||||
defaultBranch = main
|
||||
|
||||
[help]
|
||||
autocorrect = prompt
|
||||
|
||||
[push]
|
||||
autoSetupRemote = true
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
IMAPStore main-remote
|
||||
Host mail.beepboop.systems
|
||||
Port 993
|
||||
User ryan@beepboop.systems
|
||||
PassCmd "rbw get mail.beepboop.systems"
|
||||
SSLType IMAPS
|
||||
# termux is weird
|
||||
CertificateFile /data/data/com.termux/files/usr/etc/tls
|
||||
|
||||
MaildirStore main-local
|
||||
Path ~/Mail/main/
|
||||
Inbox ~/Mail/main/INBOX
|
||||
Subfolders Verbatim
|
||||
|
||||
Channel main
|
||||
Far :main-remote:
|
||||
Near :main-local:
|
||||
Create Both
|
||||
Expunge Both
|
||||
Patterns *
|
||||
SyncState *
|
|
@ -0,0 +1,19 @@
|
|||
[addressbooks]
|
||||
[[main]]
|
||||
path = ~/vdir/people/main/20cda0dd-5922-4905-8956-859c989a6519
|
||||
[general]
|
||||
default_action = list
|
||||
editor = nvim
|
||||
merge_editor = nvim, -d
|
||||
|
||||
[contact table]
|
||||
display = first_name
|
||||
group_by_addressbook = no
|
||||
reverse = no
|
||||
show_nicknames = no
|
||||
show_uids = yes
|
||||
show_kinds = no
|
||||
sort = last_name
|
||||
localize_dates = yes
|
||||
preferred_phone_number_type = pref, cell, home
|
||||
preferred_email_address_type = pref, work, home
|
|
@ -17,7 +17,7 @@ set spoolfile = +INBOX
|
|||
set record = "+Sent"
|
||||
set trash = "+Trash"
|
||||
set postponed = "+Drafts"
|
||||
mailboxes +SMS +INBOX "+College Messages"
|
||||
mailboxes +SMS +INBOX "+College Messages" +"Internship 24"
|
||||
|
||||
unset wait_key
|
||||
macro index S "<shell-escape>mbsync --config=$HOME/.config/isync/config main; vdirsyncer sync<enter>"
|
||||
|
@ -26,3 +26,4 @@ set use_threads = yes
|
|||
set sort_aux = reverse-last-date-received
|
||||
|
||||
set imap_keepalive = 300
|
||||
set query_command = "khard email --parsable --search-in-source-files '%s'"
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
plugin
|
|
@ -92,6 +92,7 @@ function setTabbing(lang, width)
|
|||
end
|
||||
|
||||
setTabbing("python", 4)
|
||||
setTabbing("htmldjango", 4)
|
||||
setTabbing("javascript", 4)
|
||||
setTabbing("css", 4)
|
||||
setTabbing("html", 4)
|
||||
|
|
|
@ -0,0 +1,111 @@
|
|||
-- init.min.lua - a stripped down init.vim for environments
|
||||
-- in which packer.nvim is inappropriate
|
||||
|
||||
-- helper functions {{{
|
||||
local keymapper = vim.keymap
|
||||
local globals = vim.g
|
||||
local opt = vim.o
|
||||
local cmd = vim.cmd
|
||||
function nnoremap(l, r)
|
||||
keymapper.set('n', l, r) -- noremap is implied
|
||||
end
|
||||
|
||||
function inoremap(l, r)
|
||||
keymapper.set('i', l, r)
|
||||
end
|
||||
|
||||
function tnoremap(l, r)
|
||||
keymapper.set('t', l, r)
|
||||
end
|
||||
-- }}}
|
||||
|
||||
-- custom mappings {{{
|
||||
globals.mapleader = ' '
|
||||
nnoremap(';', ':')
|
||||
nnoremap(':', ';')
|
||||
nnoremap('<leader><leader>', ':')
|
||||
|
||||
-- source init.vim
|
||||
-- requires rebuilding the configuration first
|
||||
nnoremap('<leader>rr', function()
|
||||
cmd.source('~/.config/nvim/init.lua')
|
||||
end)
|
||||
-- edit init.vim
|
||||
nnoremap('<leader>re', function()
|
||||
cmd.edit('~/dot_testing/config/nvim/init.lua')
|
||||
end)
|
||||
-- openup netrw
|
||||
nnoremap('<leader>fs', function()
|
||||
cmd.Lexplore()
|
||||
end)
|
||||
|
||||
inoremap('qp', '<c-g>u<Esc>[s1z=`]a<c-g>u')
|
||||
inoremap("<C-a>", "<Esc>mZ0i<Tab><Esc>`ZlA")
|
||||
inoremap('jk', '<Esc>')
|
||||
inoremap('zz', '<Esc>:w!<CR>a')
|
||||
|
||||
tnoremap('<Esc>', '<C-\\><C-n>')
|
||||
-- }}}
|
||||
|
||||
-- vim options {{{
|
||||
opt.compatible = false
|
||||
opt.number = true
|
||||
opt.foldmethod = 'marker'
|
||||
opt.encoding = 'utf8'
|
||||
opt.list = true
|
||||
opt.lcs = 'tab:->,trail:_,eol:^'
|
||||
opt.clipboard = 'unnamedplus'
|
||||
opt.spell = true
|
||||
opt.spelllang = "en_us"
|
||||
opt.title = true
|
||||
opt.ts = 2
|
||||
opt.sw = 2
|
||||
opt.hlsearch = true
|
||||
opt.incsearch = true
|
||||
opt.ignorecase = true
|
||||
opt.smartcase = true
|
||||
opt.inccommand = 'nosplit'
|
||||
opt.hidden = true
|
||||
opt.linebreak = true
|
||||
opt.path = '.,/usr/include,**'
|
||||
opt.statusline="%f %r%m%q%h%=%y 0x%02B %04l:%03c:%03p"
|
||||
vim.api.nvim_exec("let &titlestring='%{expand(\"%:p\")}'", true)
|
||||
|
||||
globals.vimtex_view_method = 'zathura'
|
||||
-- }}}
|
||||
|
||||
-- autocommands {{{
|
||||
function setTabbing(lang, width)
|
||||
vim.api.nvim_create_autocmd({"Filetype"}, {
|
||||
pattern = {lang},
|
||||
callback = function()
|
||||
vim.bo.expandtab = true
|
||||
vim.bo.tabstop = width
|
||||
vim.bo.shiftwidth = width
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
setTabbing("python", 4)
|
||||
setTabbing("htmldjango", 4)
|
||||
setTabbing("javascript", 4)
|
||||
setTabbing("css", 4)
|
||||
setTabbing("html", 4)
|
||||
setTabbing("nix", 2)
|
||||
|
||||
vim.api.nvim_create_autocmd({"TermOpen"}, {
|
||||
pattern = {"*"},
|
||||
callback = function()
|
||||
vim.wo.number = false
|
||||
end
|
||||
})
|
||||
-- }}}
|
||||
|
||||
-- netrw options {{{
|
||||
globals.netrw_winsize = -28
|
||||
globals.netrw_banner = 0
|
||||
-- for tree view
|
||||
globals.netrw_liststyle = 3
|
||||
-- use previous window to open files
|
||||
globals.netrw_browser_split = 4
|
||||
-- }}}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"base_url": "https://bitwarden.beepboop.systems",
|
||||
"email": "bit@beepboop.systems",
|
||||
"identity_url": null,
|
||||
"lock_timeout": 3600
|
||||
}
|
|
@ -2,6 +2,10 @@ Host mainsail
|
|||
User usr
|
||||
Port 22
|
||||
|
||||
Host phone
|
||||
User u0_a193
|
||||
Port 8022
|
||||
|
||||
Host netbox
|
||||
HostName beepboop.systems
|
||||
User ryan
|
|
@ -1,3 +1,3 @@
|
|||
# start the wm
|
||||
sxhkd &
|
||||
mode sxhkdrc
|
||||
bspwm
|
||||
|
|
|
@ -2,6 +2,13 @@
|
|||
Escape
|
||||
mode sxhkdrc
|
||||
|
||||
w
|
||||
mode sxhkdrc
|
||||
|
||||
# send the escape key
|
||||
]
|
||||
xdotool key Escape
|
||||
|
||||
# move left
|
||||
{ctrl +,shift +,_} h
|
||||
xdotool mousemove_relative -- {-5,-50,-20} 0
|
||||
|
|
|
@ -2,20 +2,29 @@
|
|||
super + Return
|
||||
st
|
||||
|
||||
ctrl + b; c
|
||||
st
|
||||
|
||||
ctrl + b; Return
|
||||
st
|
||||
|
||||
# spawn the launcher
|
||||
super + d
|
||||
tmenu_run
|
||||
|
||||
ctrl + b; d
|
||||
tmenu_run
|
||||
|
||||
# kill sxhkd with USR1 and restart bspwm
|
||||
super + r
|
||||
pkill -USR1 -x sxhkd; \
|
||||
bspc wm -r
|
||||
|
||||
# reinitialize ancillary services
|
||||
super + w
|
||||
disp && keyboard
|
||||
ctrl + b; r
|
||||
pkill -USR1 -x sxhkd; \
|
||||
bspc wm -r
|
||||
|
||||
# control the national weather service
|
||||
# show nws radar
|
||||
super + {_,shift + }n
|
||||
nws {local,national}
|
||||
|
||||
|
@ -23,14 +32,25 @@ super + {_,shift + }n
|
|||
super + m
|
||||
mode mouse
|
||||
|
||||
ctrl + b; m
|
||||
mode mouse
|
||||
|
||||
# kill the current node
|
||||
super + q
|
||||
bspc node -c
|
||||
|
||||
ctrl + b; q
|
||||
bspc node -c
|
||||
|
||||
# kill bspwm
|
||||
super + e
|
||||
bspc quit 0
|
||||
|
||||
ctrl + b; e
|
||||
bspc quit 0; \
|
||||
pkill X # phone starts bspwm differently
|
||||
# to take everything down, we need to kill X
|
||||
|
||||
# systemctl suspend
|
||||
super + shift + e
|
||||
systemctl suspend
|
||||
|
@ -39,17 +59,40 @@ super + shift + e
|
|||
super + z
|
||||
passmenu
|
||||
|
||||
ctrl + b; z
|
||||
passmenu
|
||||
|
||||
# manipulate a node
|
||||
super + {_,ctrl +,shift + }{h,j,k,l}
|
||||
bspc node -{f,p,s} {west,south,north,east}
|
||||
|
||||
ctrl + b; {_,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} '{1-9,10}'
|
||||
bspc {desktop -f,node -d} '0{1-9,0}'
|
||||
|
||||
super + space; {_,shift + } {1-9,0}
|
||||
bspc {desktop -f,node -d} '1{1-9,0}'
|
||||
|
||||
ctrl + b; {_,shift + } {1-9,0}
|
||||
bspc {desktop -f,node -d} '0{1-9,0}'
|
||||
|
||||
# change a node to tiling, floating, or fullscreen
|
||||
super + {t,f,s}
|
||||
bspc node -t {tiled,floating,fullscreen}
|
||||
|
||||
ctrl + b; {t,f,s}
|
||||
bspc node -t {tiled,floating,fullscreen}
|
||||
|
||||
# x230t specific -- activate the tablet menu
|
||||
XF86RotateWindows
|
||||
tabletmenu
|
||||
|
||||
shift + Insert
|
||||
special_ins
|
||||
|
||||
# phone specific -- send the escape key since we can't use it
|
||||
super + b; [
|
||||
xdotool key Escape
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
path = "~/vdir/calendar/personal/*"
|
||||
date_format = "%m-%d-%Y"
|
||||
time_format = "%H:%M"
|
||||
default_due = 0
|
||||
default_list = "edfbeaf1-e9f3-4d94-a512-40cdafdbc7a0"
|
||||
|
|
|
@ -56,11 +56,10 @@ type = "carddav"
|
|||
|
||||
url = "https://radicale.beepboop.systems/ryan/20cda0dd-5922-4905-8956-859c989a6519/"
|
||||
username = "ryan"
|
||||
password.fetch = ["command", "rbw", "get", "beepboop.systems radicale instance"]
|
||||
password.fetch = ["command", "rbw", "get", "radicale"]
|
||||
|
||||
[storage band_calendar_remote]
|
||||
type = "http"
|
||||
|
||||
url = "https://calendar.google.com/calendar/ical/i6bong6iferbcuf1u25jg47t7k%40group.calendar.google.com/public/basic.ics"
|
||||
|
||||
[storage pco_remote]
|
||||
|
@ -77,4 +76,4 @@ type = "caldav"
|
|||
|
||||
url = "https://radicale.beepboop.systems/ryan/edfbeaf1-e9f3-4d94-a512-40cdafdbc7a0/"
|
||||
username = "ryan"
|
||||
password.fetch = ["command", "rbw", "get", "beepboop.systems radicale instance"]
|
||||
password.fetch = ["command", "rbw", "get", "radicale"]
|
||||
|
|
|
@ -0,0 +1,300 @@
|
|||
# XScreenSaver Preferences File
|
||||
# Written by xscreensaver-settings 6.08 for usr on Sat Aug 31 19:23:22 2024.
|
||||
# https://www.jwz.org/xscreensaver/
|
||||
|
||||
timeout: 0:10:00
|
||||
cycle: 0:10:00
|
||||
lock: False
|
||||
lockTimeout: 0:00:00
|
||||
passwdTimeout: 0:00:30
|
||||
visualID: default
|
||||
installColormap: True
|
||||
verbose: False
|
||||
splash: True
|
||||
splashDuration: 0:00:05
|
||||
demoCommand: xscreensaver-settings
|
||||
nice: 10
|
||||
fade: True
|
||||
unfade: True
|
||||
fadeSeconds: 0:00:03
|
||||
ignoreUninstalledPrograms:False
|
||||
dpmsEnabled: False
|
||||
dpmsQuickOff: False
|
||||
dpmsStandby: 2:00:00
|
||||
dpmsSuspend: 2:00:00
|
||||
dpmsOff: 4:00:00
|
||||
grabDesktopImages: True
|
||||
grabVideoFrames: False
|
||||
chooseRandomImages: False
|
||||
imageDirectory:
|
||||
|
||||
mode: one
|
||||
selected: 24
|
||||
|
||||
textMode: url
|
||||
textLiteral: XScreenSaver
|
||||
textFile:
|
||||
textProgram: fortune
|
||||
textURL: https://en.wikipedia.org/w/index.php?title=Special:NewPages&feed=rss
|
||||
dialogTheme: default
|
||||
settingsGeom: 761,550 0,0
|
||||
|
||||
programs: \
|
||||
maze --root \n\
|
||||
GL: superquadrics --root \n\
|
||||
attraction --root \n\
|
||||
blitspin --root \n\
|
||||
greynetic --root \n\
|
||||
helix --root \n\
|
||||
hopalong --root \n\
|
||||
imsmap --root \n\
|
||||
- noseguy --root \n\
|
||||
- pyro --root \n\
|
||||
qix --root \n\
|
||||
- rocks --root \n\
|
||||
rorschach --root \n\
|
||||
decayscreen --root \n\
|
||||
flame --root \n\
|
||||
halo --root \n\
|
||||
slidescreen --root \n\
|
||||
pedal --root \n\
|
||||
bouboule --root \n\
|
||||
- braid --root \n\
|
||||
coral --root \n\
|
||||
deco --root \n\
|
||||
drift --root \n\
|
||||
- fadeplot --root \n\
|
||||
galaxy --root --delay 82787 --ncolors 143 \
|
||||
--no-spin \n\
|
||||
goop --root \n\
|
||||
grav --root \n\
|
||||
ifs --root \n\
|
||||
GL: jigsaw --root \n\
|
||||
julia --root \n\
|
||||
- kaleidescope --root \n\
|
||||
GL: moebius --root \n\
|
||||
moire --root \n\
|
||||
GL: morph3d --root \n\
|
||||
mountain --root \n\
|
||||
munch --root \n\
|
||||
penrose --root \n\
|
||||
GL: pipes --root \n\
|
||||
rdbomb --root \n\
|
||||
GL: rubik --root \n\
|
||||
- sierpinski --root \n\
|
||||
slip --root \n\
|
||||
GL: sproingies --root \n\
|
||||
starfish --root \n\
|
||||
strange --root \n\
|
||||
swirl --root \n\
|
||||
triangle --root \n\
|
||||
xjack --root \n\
|
||||
xlyap --root \n\
|
||||
GL: atlantis --root \n\
|
||||
bsod --root \n\
|
||||
GL: bubble3d --root \n\
|
||||
GL: cage --root \n\
|
||||
- crystal --root \n\
|
||||
cynosure --root \n\
|
||||
discrete --root \n\
|
||||
distort --root \n\
|
||||
epicycle --root \n\
|
||||
flow --root \n\
|
||||
GL: glplanet --root \n\
|
||||
interference --root \n\
|
||||
kumppa --root \n\
|
||||
GL: lament --root \n\
|
||||
moire2 --root \n\
|
||||
GL: sonar --root \n\
|
||||
GL: stairs --root \n\
|
||||
truchet --root \n\
|
||||
- vidwhacker --root \n\
|
||||
- webcollage --root \n\
|
||||
blaster --root \n\
|
||||
bumps --root \n\
|
||||
ccurve --root \n\
|
||||
compass --root \n\
|
||||
deluxe --root \n\
|
||||
- demon --root \n\
|
||||
GL: extrusion --root \n\
|
||||
- loop --root \n\
|
||||
penetrate --root \n\
|
||||
petri --root \n\
|
||||
phosphor --root \n\
|
||||
GL: pulsar --root \n\
|
||||
ripples --root \n\
|
||||
shadebobs --root \n\
|
||||
GL: sierpinski3d --root \n\
|
||||
spotlight --root \n\
|
||||
squiral --root \n\
|
||||
wander --root \n\
|
||||
xflame --root \n\
|
||||
xmatrix --root \n\
|
||||
GL: gflux --root \n\
|
||||
- nerverot --root \n\
|
||||
xrayswarm --root \n\
|
||||
xspirograph --root \n\
|
||||
GL: circuit --root \n\
|
||||
GL: dangerball --root \n\
|
||||
- GL: dnalogo --root \n\
|
||||
GL: engine --root \n\
|
||||
GL: flipscreen3d --root \n\
|
||||
GL: gltext --root \n\
|
||||
GL: menger --root \n\
|
||||
GL: molecule --root \n\
|
||||
rotzoomer --root \n\
|
||||
scooter --root \n\
|
||||
speedmine --root \n\
|
||||
GL: starwars --root \n\
|
||||
GL: stonerview --root \n\
|
||||
vermiculate --root \n\
|
||||
whirlwindwarp --root \n\
|
||||
zoom --root \n\
|
||||
anemone --root \n\
|
||||
apollonian --root \n\
|
||||
GL: boxed --root \n\
|
||||
GL: cubenetic --root \n\
|
||||
GL: endgame --root \n\
|
||||
euler2d --root \n\
|
||||
fluidballs --root \n\
|
||||
GL: flurry --root \n\
|
||||
- GL: glblur --root \n\
|
||||
GL: glsnake --root \n\
|
||||
halftone --root \n\
|
||||
GL: juggler3d --root \n\
|
||||
GL: lavalite --root \n\
|
||||
- polyominoes --root \n\
|
||||
GL: queens --root \n\
|
||||
- GL: sballs --root \n\
|
||||
GL: spheremonics --root \n\
|
||||
twang --root \n\
|
||||
- GL: antspotlight --root \n\
|
||||
apple2 --root \n\
|
||||
GL: atunnel --root \n\
|
||||
barcode --root \n\
|
||||
GL: blinkbox --root \n\
|
||||
GL: blocktube --root \n\
|
||||
GL: bouncingcow --root \n\
|
||||
cloudlife --root \n\
|
||||
GL: cubestorm --root \n\
|
||||
eruption --root \n\
|
||||
GL: flipflop --root \n\
|
||||
GL: flyingtoasters --root \n\
|
||||
fontglide --root \n\
|
||||
GL: gleidescope --root \n\
|
||||
GL: glknots --root \n\
|
||||
GL: glmatrix --root \n\
|
||||
- GL: glslideshow --root \n\
|
||||
GL: hypertorus --root \n\
|
||||
- GL: jigglypuff --root \n\
|
||||
metaballs --root \n\
|
||||
GL: mirrorblob --root \n\
|
||||
piecewise --root \n\
|
||||
GL: polytopes --root \n\
|
||||
pong --root \n\
|
||||
popsquares --root \n\
|
||||
GL: surfaces --root \n\
|
||||
xanalogtv --root \n\
|
||||
abstractile --root \n\
|
||||
anemotaxis --root \n\
|
||||
- GL: antinspect --root \n\
|
||||
fireworkx --root \n\
|
||||
fuzzyflakes --root \n\
|
||||
interaggregate --root \n\
|
||||
intermomentary --root \n\
|
||||
memscroller --root \n\
|
||||
GL: noof --root \n\
|
||||
pacman --root \n\
|
||||
GL: pinion --root \n\
|
||||
GL: polyhedra --root \n\
|
||||
- GL: providence --root \n\
|
||||
substrate --root \n\
|
||||
wormhole --root \n\
|
||||
- GL: antmaze --root \n\
|
||||
GL: boing --root \n\
|
||||
boxfit --root \n\
|
||||
GL: carousel --root \n\
|
||||
celtic --root \n\
|
||||
GL: crackberg --root \n\
|
||||
GL: cube21 --root \n\
|
||||
fiberlamp --root \n\
|
||||
GL: fliptext --root \n\
|
||||
GL: glhanoi --root \n\
|
||||
GL: tangram --root \n\
|
||||
GL: timetunnel --root \n\
|
||||
GL: glschool --root \n\
|
||||
GL: topblock --root \n\
|
||||
GL: cubicgrid --root \n\
|
||||
cwaves --root \n\
|
||||
GL: gears --root \n\
|
||||
GL: glcells --root \n\
|
||||
GL: lockward --root \n\
|
||||
m6502 --root \n\
|
||||
GL: moebiusgears --root \n\
|
||||
GL: voronoi --root \n\
|
||||
GL: hypnowheel --root \n\
|
||||
GL: klein --root \n\
|
||||
- lcdscrub --root \n\
|
||||
GL: photopile --root \n\
|
||||
GL: skytentacles --root \n\
|
||||
GL: rubikblocks --root \n\
|
||||
GL: companioncube --root \n\
|
||||
GL: hilbert --root \n\
|
||||
GL: tronbit --root \n\
|
||||
GL: geodesic --root \n\
|
||||
hexadrop --root \n\
|
||||
GL: kaleidocycle --root \n\
|
||||
GL: quasicrystal --root \n\
|
||||
GL: unknownpleasures --root \n\
|
||||
binaryring --root \n\
|
||||
GL: cityflow --root \n\
|
||||
GL: geodesicgears --root \n\
|
||||
GL: projectiveplane --root \n\
|
||||
GL: romanboy --root \n\
|
||||
tessellimage --root \n\
|
||||
GL: winduprobot --root \n\
|
||||
GL: splitflap --root \n\
|
||||
GL: cubestack --root \n\
|
||||
GL: cubetwist --root \n\
|
||||
GL: discoball --root \n\
|
||||
GL: dymaxionmap --root \n\
|
||||
GL: energystream --root \n\
|
||||
GL: hexstrut --root \n\
|
||||
GL: hydrostat --root \n\
|
||||
GL: raverhoop --root \n\
|
||||
GL: splodesic --root \n\
|
||||
GL: unicrud --root \n\
|
||||
GL: esper --root \n\
|
||||
GL: vigilance --root \n\
|
||||
GL: crumbler --root \n\
|
||||
filmleader --root \n\
|
||||
glitchpeg --root \n\
|
||||
GL: handsy --root \n\
|
||||
GL: maze3d --root \n\
|
||||
GL: peepers --root \n\
|
||||
GL: razzledazzle --root \n\
|
||||
vfeedback --root \n\
|
||||
GL: deepstars --root \n\
|
||||
GL: gravitywell --root \n\
|
||||
GL: beats --root \n\
|
||||
GL: covid19 --root \n\
|
||||
GL: etruscanvenus --root \n\
|
||||
GL: gibson --root \n\
|
||||
GL: headroom --root \n\
|
||||
GL: sphereeversion --root \n\
|
||||
binaryhorizon --root \n\
|
||||
marbling --root \n\
|
||||
GL: chompytower --root \n\
|
||||
GL: hextrail --root \n\
|
||||
GL: mapscroller --root \n\
|
||||
GL: nakagin --root \n\
|
||||
GL: squirtorus --root \n\
|
||||
GL: cubocteversion --root \n\
|
||||
droste --root \n\
|
||||
GL: papercube --root \n\
|
||||
GL: skulloop --root \n\
|
||||
|
||||
|
||||
pointerHysteresis: 10
|
||||
authWarningSlack: 20
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
stupidcomputer <ryan@beepboop.systems> <randomuser@tilde.club>
|
||||
stupidcomputer <ryan@beepboop.systems>
|
||||
stupidcomputer <ryan@beepboop.systems> <rndusr@beepboop.systems>
|
||||
stupidcomputer <ryan@beepboop.systems> <Unixsys@github.com>
|
12
README.md
12
README.md
|
@ -20,7 +20,7 @@ if you're trying to install `netbox`, then use the `--impure` flag:
|
|||
|
||||
`sudo nixos-rebuild --flake .#netbox switch --impure`
|
||||
|
||||
for alternate installations on non-NixOS hosts, a Makefile will be made available
|
||||
for installation onto Termux, run `make`.
|
||||
|
||||
things to do
|
||||
------------
|
||||
|
@ -33,7 +33,9 @@ things to do
|
|||
license
|
||||
-------
|
||||
|
||||
all materials, except for:
|
||||
a) `./home/wallpapers/pape.jpg`, which is of unknown licenses, and
|
||||
b) ./builds/st, which is licensed under MIT, persuant to ./builds/st/LICENSE,
|
||||
is licensed under the GPLv3.
|
||||
all materials in this repository, except for:
|
||||
|
||||
* `./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 and licensed under the GPLv3 (see `./LICENSE`)
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
{ lib, config, pkgs, ...}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./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
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
xscreensaver
|
||||
texliveFull
|
||||
libreoffice
|
||||
|
||||
ecryptfs
|
||||
ffmpeg
|
||||
thunderbird
|
||||
ledger
|
||||
ranger
|
||||
];
|
||||
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.printing.enable = true;
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
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";
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
# 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" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ 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;
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{ lib, inputs, config, pkgs, home, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../home/x11.nix
|
||||
../../home/chromium
|
||||
];
|
||||
|
||||
home.stateVersion = "24.05";
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
Git.Git
|
||||
CollegeBoard.Bluebook
|
||||
AutoHotKey.AutoHotKey
|
||||
Brave.Brave
|
||||
Google.Chrome.EXE
|
||||
Bitwarden.Bitwarden
|
|
@ -0,0 +1,141 @@
|
|||
{ lib, config, pkgs, ...}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./nvidia.nix
|
||||
./services
|
||||
../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
|
||||
puddletag
|
||||
musescore
|
||||
unzip
|
||||
ledger
|
||||
|
||||
unzip
|
||||
imagemagick
|
||||
pciutils
|
||||
usbutils
|
||||
pwvucontrol
|
||||
|
||||
dunst
|
||||
libnotify
|
||||
ffmpeg
|
||||
mdadm
|
||||
git-annex
|
||||
tigervnc
|
||||
|
||||
(pkgs.callPackage ../../builds/archutils.nix {})
|
||||
(pkgs.callPackage ../../builds/sssg.nix {})
|
||||
];
|
||||
|
||||
services.hardware.bolt.enable = true; # thunderbolt support
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
settings = {
|
||||
General = {
|
||||
AutoEnable = true;
|
||||
Enable = "Source,Sink,Media,Socket";
|
||||
ControllerMode = "bredr";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.virtualbox.host.enable = true;
|
||||
|
||||
boot.loader = {
|
||||
efi = {
|
||||
canTouchEfiVariables = true;
|
||||
efiSysMountPoint = "/boot";
|
||||
};
|
||||
grub = {
|
||||
efiSupport = true;
|
||||
device = "nodev";
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
# enable printing
|
||||
printing.enable = true;
|
||||
avahi = {
|
||||
enable = true; # runs the Avahi daemon
|
||||
nssmdns4 = true; # enables the mDNS NSS plug-in
|
||||
openFirewall = true; # opens the firewall for UDP port 5353
|
||||
};
|
||||
|
||||
pipewire = {
|
||||
enable = true;
|
||||
alsa = {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
};
|
||||
pulse.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
programs.adb.enable = true;
|
||||
|
||||
powerManagement.cpuFreqGovernor = "performance";
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
networking = {
|
||||
hostName = "copernicus";
|
||||
firewall = {
|
||||
enable = true;
|
||||
interfaces = {
|
||||
eno1 = {
|
||||
allowedTCPPorts = [ 6000 ];
|
||||
allowedTCPPortRanges = [
|
||||
{ from = 1714; to = 1764; } # KDE Connect
|
||||
];
|
||||
allowedUDPPortRanges = [
|
||||
{ from = 1714; to = 1764; } # KDE Connect
|
||||
];
|
||||
};
|
||||
wg0 = {
|
||||
# allow everything bound to the wg0 interface
|
||||
allowedTCPPortRanges = [
|
||||
{ from = 1; to = 35565; }
|
||||
];
|
||||
allowedUDPPortRanges = [
|
||||
{ from = 1; to = 35565; }
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.kdeconnect.enable = true;
|
||||
|
||||
system.stateVersion = "24.05"; # don't change this, lol
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
# 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 = [ "vmd" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/8182bde6-7213-4108-9dbf-951f76870207";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/0D21-265A";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ { 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;
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{ lib, inputs, config, pkgs, home, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../home/x11.nix
|
||||
../../home/chromium
|
||||
];
|
||||
|
||||
home.stateVersion = "23.11";
|
||||
}
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{ lib, config, pkgs, ...}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./wireguard.nix
|
||||
./grafana.nix
|
||||
./nextcloud.nix
|
||||
];
|
||||
}
|
|
@ -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" ];
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
{ lib, config, pkgs, ...}:
|
||||
|
||||
{
|
||||
services.nextcloud = {
|
||||
enable = true;
|
||||
package = pkgs.nextcloud30;
|
||||
hostName = "nextcloud.beepboop.systems";
|
||||
config.adminpassFile = "/etc/nextcloud-admin";
|
||||
settings.overwriteprotocol = "https";
|
||||
extraApps = {
|
||||
inherit (config.services.nextcloud.package.packages.apps) contacts calendar tasks;
|
||||
phonetrack = pkgs.fetchNextcloudApp {
|
||||
sha256 = "sha256-V92f+FiS5vZEkq15A51pHoDpUOBfUOEVIcsXdP/rSMQ=";
|
||||
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}".listen = [ {
|
||||
addr = "10.100.0.2";
|
||||
port = 5028;
|
||||
} ];
|
||||
}
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
{
|
||||
networking = {
|
||||
firewall.allowedUDPPorts = [ 50000 ];
|
||||
|
||||
wireguard.interfaces = {
|
||||
wg0 = {
|
||||
ips = [ "10.100.0.2/24" ];
|
||||
listenPort = 50000;
|
||||
|
||||
privateKeyFile = "/home/usr/wg-keys/private";
|
||||
peers = [
|
||||
{ # netbox
|
||||
publicKey = "0fOqAfsYO4HvshMPnlkKL7Z1RChq98hjDr0Q8o7OJFE=";
|
||||
allowedIPs = [ "10.100.0.0/24" ]; # only stuff in the wg-subnet (10.100.0.*)
|
||||
endpoint = "149.28.63.115:50000";
|
||||
persistentKeepalive = 25;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -8,6 +8,12 @@
|
|||
../../modules/common.nix
|
||||
];
|
||||
|
||||
# nix optimization
|
||||
nix.optimise = {
|
||||
automatic = true;
|
||||
dates = [ "03:45" ];
|
||||
};
|
||||
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/sda";
|
||||
|
||||
|
@ -69,6 +75,7 @@
|
|||
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";
|
||||
|
|
|
@ -9,11 +9,19 @@
|
|||
../../modules/bootstrap.nix
|
||||
../../modules/common.nix
|
||||
../../modules/x11.nix
|
||||
../../modules/pulse.nix
|
||||
../../modules/discord.nix
|
||||
../../modules/gaming.nix
|
||||
# ../../modules/gaming.nix
|
||||
../../modules/rbw.nix
|
||||
];
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
|
||||
|
||||
users.users.usr.extraGroups = [
|
||||
"docker"
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
wine
|
||||
xdotool
|
||||
|
@ -27,6 +35,7 @@
|
|||
libreoffice
|
||||
texliveMedium
|
||||
ledger
|
||||
git-annex
|
||||
];
|
||||
|
||||
services.hardware.bolt.enable = true; # thunderbolt support
|
||||
|
@ -63,7 +72,7 @@
|
|||
|
||||
services.printing.enable = true;
|
||||
services.avahi.enable = true; # runs the Avahi daemon
|
||||
services.avahi.nssmdns = true; # enables the mDNS NSS plug-in
|
||||
services.avahi.nssmdns4 = true; # enables the mDNS NSS plug-in
|
||||
services.avahi.openFirewall = true; # opens the firewall for UDP port 5353
|
||||
|
||||
powerManagement.cpuFreqGovernor = "performance";
|
||||
|
@ -71,8 +80,19 @@
|
|||
nixpkgs.config.allowUnfree = true;
|
||||
networking = {
|
||||
hostName = "mlg";
|
||||
firewall.enable = true;
|
||||
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
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
sudo nixos-rebuild --flake . switch --impure -I nixos-config=./
|
|
@ -5,10 +5,35 @@
|
|||
[
|
||||
./hardware-configuration.nix
|
||||
../../modules/bootstrap.nix
|
||||
../../builds/gmail_mail_bridge.nix
|
||||
|
||||
./radicale.nix
|
||||
./ssh.nix
|
||||
./gitea.nix
|
||||
./radicale.nix
|
||||
./vaultwarden.nix
|
||||
./sslh.nix
|
||||
./rss2email.nix
|
||||
./fail2ban.nix
|
||||
./nginx.nix
|
||||
./franklincce.nix
|
||||
./wireguard.nix
|
||||
./nextcloud-bridge.nix
|
||||
./grafana-bridge.nix
|
||||
./prometheus.nix
|
||||
./socks.nix
|
||||
];
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
nix = {
|
||||
optimise = {
|
||||
automatic = true;
|
||||
dates = [ "02:30" ];
|
||||
};
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "03:15";
|
||||
options = "-d";
|
||||
};
|
||||
};
|
||||
|
||||
time.timeZone = "America/Chicago";
|
||||
|
||||
|
@ -26,272 +51,83 @@
|
|||
tree
|
||||
dig
|
||||
htop
|
||||
gnumake
|
||||
neovim
|
||||
];
|
||||
|
||||
services.gmail_mail_bridge.enable = true;
|
||||
|
||||
system.copySystemConfiguration = true;
|
||||
system.stateVersion = "23.05"; # don't change this, lol
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/vda";
|
||||
|
||||
services.sslh = {
|
||||
enable = true;
|
||||
settings.protocols = [
|
||||
{
|
||||
host = "localhost";
|
||||
name = "ssh";
|
||||
port = "55555";
|
||||
service = "ssh";
|
||||
}
|
||||
{
|
||||
host = "localhost";
|
||||
name = "tls";
|
||||
port = "442";
|
||||
}
|
||||
];
|
||||
system = {
|
||||
copySystemConfiguration = true;
|
||||
stateVersion = "23.05"; # don't change this, lol
|
||||
};
|
||||
|
||||
networking.hostName = "netbox";
|
||||
|
||||
services.radicale = {
|
||||
enable = true;
|
||||
config = ''
|
||||
[auth]
|
||||
type = htpasswd
|
||||
htpasswd_filename = radicale-passwd
|
||||
htpasswd_encryption = plain
|
||||
'';
|
||||
};
|
||||
|
||||
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/";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
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
|
||||
services.journald.extraConfig = ''
|
||||
SystemMaxUse=1G
|
||||
'';
|
||||
|
||||
"postfix-bruteforce" = ''
|
||||
enabled = true
|
||||
filter = postfix-bruteforce
|
||||
maxretry = 6
|
||||
findtime = 600
|
||||
system.userActivationScripts = {
|
||||
copyEssentialConfiguration = {
|
||||
# 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
|
||||
'';
|
||||
deps = [];
|
||||
};
|
||||
};
|
||||
|
||||
environment.etc = {
|
||||
"fail2ban/filter.d/nginx-bruteforce.conf".text = ''
|
||||
[Definition]
|
||||
failregex = ^<HOST>.*GET.*(matrix/server|\.php|admin|wp\-).* HTTP/\d.\d\" 404.*$
|
||||
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
|
||||
'';
|
||||
deps = [];
|
||||
};
|
||||
};
|
||||
|
||||
"fail2ban/filter.d/postfix-bruteforce.conf".text = ''
|
||||
[Definition]
|
||||
failregex = warning: [\w\.\-]+\[<HOST>\]: SASL LOGIN authentication failed.*$
|
||||
journalmatch = _SYSTEMD_UNIT=postfix.service
|
||||
'';
|
||||
boot.loader = {
|
||||
grub.enable = true;
|
||||
grub.device = "/dev/vda";
|
||||
};
|
||||
|
||||
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 AAAAC3NzaC1lZDI1NTE5AAAAILuVT5W3kzjzsuMIWk1oeGtL8jZGtAhRSx8dK8oBJQcG u0_a291" # 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" ];
|
||||
};
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
ports = [55555];
|
||||
};
|
||||
|
||||
services.endlessh.enable = true;
|
||||
services.endlessh.port = 22;
|
||||
services.vaultwarden.enable = true;
|
||||
services.vaultwarden.config = {
|
||||
DOMAIN = "https://bitwarden.beepboop.systems";
|
||||
SIGNUPS_ALLOWED = false;
|
||||
};
|
||||
|
||||
networking.usePredictableInterfaceNames = false;
|
||||
|
||||
services.gitea = {
|
||||
enable = true;
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
services.postgresql = {
|
||||
enable = true; # Ensure postgresql is enabled
|
||||
authentication = ''
|
||||
local gitea all ident map=gitea-users
|
||||
'';
|
||||
identMap = # Map the gitea user to postgresql
|
||||
''
|
||||
gitea-users gitea gitea
|
||||
'';
|
||||
};
|
||||
|
||||
services.nginx.enable = true;
|
||||
services.nginx.clientMaxBodySize = "100m";
|
||||
services.nginx.defaultSSLListenPort = 442;
|
||||
|
||||
services.nginx.virtualHosts."beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
root = "/var/www/beepboop.systems";
|
||||
locations."/" = {
|
||||
extraConfig = ''
|
||||
if ($request_uri ~ ^/(.*)\.html(\?|$)) {
|
||||
return 302 /$1;
|
||||
}
|
||||
try_files $uri $uri.html $uri/ =404;
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."git.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:3001";
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."bit.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
globalRedirect = "bitwarden.beepboop.systems";
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."bitwarden.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:8000";
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."radicale.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:5232";
|
||||
extraConfig = ''
|
||||
proxy_set_header X-Script-Name /;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass_header Authorization;
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."calendar.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
globalRedirect = "radicale.beepboop.systems";
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."cal.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
globalRedirect = "radicale.beepboop.systems";
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."skillissue.agency" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
root = "/var/www/skillissue.agency";
|
||||
};
|
||||
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
email = "nickforanick@protonmail.com";
|
||||
};
|
||||
|
||||
# services.roundcube = {
|
||||
# enable = true;
|
||||
# # this is the url of the vhost, not necessarily the same as the fqdn of
|
||||
# # the mailserver
|
||||
# hostName = "cube.beepboop.systems";
|
||||
# extraConfig = ''
|
||||
# # starttls needed for authentication, so the fqdn required to match
|
||||
# # the certificate
|
||||
# $config['smtp_server'] = "tls://${config.mailserver.fqdn}";
|
||||
# $config['smtp_user'] = "%u";
|
||||
# $config['smtp_pass'] = "%p";
|
||||
# '';
|
||||
# };
|
||||
|
||||
services.nginx.virtualHosts."roundcube.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
globalRedirect = "cube.beepboop.systems";
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."mail.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/bridge-submit" = {
|
||||
extraConfig = ''
|
||||
proxy_pass http://localhost:8041;
|
||||
'';
|
||||
};
|
||||
locations."/" = {
|
||||
extraConfig = ''
|
||||
return 301 https://cube.beepboop.systems;
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall = {
|
||||
networking = {
|
||||
usePredictableInterfaceNames = false;
|
||||
networkmanager.enable = true;
|
||||
hostName = "netbox";
|
||||
|
||||
firewall = {
|
||||
enable = true;
|
||||
interfaces = {
|
||||
eth0 = {
|
||||
allowedTCPPorts = [ 80 443 ];
|
||||
};
|
||||
wg0 = {
|
||||
# allow everything bound to the wg0 interface
|
||||
allowedTCPPortRanges = [
|
||||
{ from = 1; to = 35565; }
|
||||
];
|
||||
allowedUDPPortRanges = [
|
||||
{ from = 1; to = 35565; }
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
{
|
||||
virtualisation.docker.enable = true;
|
||||
|
||||
services.nginx.virtualHosts."franklincce.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:1337";
|
||||
};
|
||||
};
|
||||
|
||||
# WARNING WARNING WARNING
|
||||
# the below is SUPER BAD and should not be copied ANYWHERE
|
||||
# the docker container should be initialized by a flake or other nix concept,
|
||||
# not this nonsense
|
||||
|
||||
systemd.services.franklincce = {
|
||||
description = "the docker container that runs the franklincce app";
|
||||
|
||||
environment = { # this is EVIL, NEVER DO THIS!!!111!
|
||||
NIX_PATH = "nixpkgs=flake:nixpkgs:/nix/var/nix/profiles/per-user/root/channels";
|
||||
};
|
||||
|
||||
script = ''
|
||||
cd /home/ryan
|
||||
|
||||
# don't fail if cloning the git repo fails
|
||||
${pkgs.git}/bin/git clone https://git.beepboop.systems/stupidcomputer/yig yig || true
|
||||
|
||||
cd /home/ryan/yig
|
||||
${pkgs.nix}/bin/nix-shell --command make
|
||||
'';
|
||||
|
||||
serviceConfig = {
|
||||
User = "ryan";
|
||||
};
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
{
|
||||
services.gitea = {
|
||||
enable = true;
|
||||
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;
|
||||
DISABLE_REGISTRATION = true;
|
||||
};
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
services.postgresql = {
|
||||
enable = true; # Ensure postgresql is enabled
|
||||
authentication = ''
|
||||
local gitea all ident map=gitea-users
|
||||
'';
|
||||
identMap = # Map the gitea user to postgresql
|
||||
''
|
||||
gitea-users gitea gitea
|
||||
'';
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."git.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:3001";
|
||||
};
|
||||
locations."/bridge" = {
|
||||
proxyPass = "http://localhost:5000";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -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;
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."nextcloud.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://10.100.0.2:5028";
|
||||
proxyWebsockets = true;
|
||||
extraConfig = ''
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Host $host;
|
||||
proxy_buffering off;
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
{
|
||||
services.nginx.enable = true;
|
||||
services.nginx.clientMaxBodySize = "100m";
|
||||
services.nginx.defaultSSLListenPort = 442;
|
||||
|
||||
services.nginx.virtualHosts."beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
root = "/var/www/beepboop.systems";
|
||||
locations."/" = {
|
||||
extraConfig = ''
|
||||
port_in_redirect off;
|
||||
absolute_redirect off;
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."tfb.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
root = "/var/www/tfb.beepboop.systems";
|
||||
locations."/" = {
|
||||
extraConfig = ''
|
||||
port_in_redirect off;
|
||||
absolute_redirect off;
|
||||
'';
|
||||
};
|
||||
locations."/groupme" = {
|
||||
proxyPass = "http://10.100.0.2:7439";
|
||||
};
|
||||
};
|
||||
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "nickforanick@protonmail.com";
|
||||
};
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
{
|
||||
services.prometheus = {
|
||||
exporters = {
|
||||
node = {
|
||||
enable = true;
|
||||
enabledCollectors = [ "systemd" ];
|
||||
listenAddress = "10.100.0.1";
|
||||
port = 9002;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
{
|
||||
services.radicale = {
|
||||
enable = true;
|
||||
settings = {
|
||||
auth = {
|
||||
type = "htpasswd";
|
||||
htpasswd_filename = "radicale-passwd";
|
||||
htpasswd_encryption = "plain";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."radicale.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:5232";
|
||||
extraConfig = ''
|
||||
proxy_set_header X-Script-Name /;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass_header Authorization;
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."calendar.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
globalRedirect = "radicale.beepboop.systems";
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."cal.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
globalRedirect = "radicale.beepboop.systems";
|
||||
};
|
||||
}
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
{
|
||||
services._3proxy = {
|
||||
enable = true;
|
||||
services = [
|
||||
{
|
||||
type = "socks";
|
||||
auth = [ "none" ];
|
||||
bindAddress = "10.100.0.1";
|
||||
bindPort = 3128;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
ports = [55555];
|
||||
settings = {
|
||||
X11Forwarding = false;
|
||||
PermitRootLogin = "no";
|
||||
PasswordAuthentication = false;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +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";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
{
|
||||
services.vaultwarden.enable = true;
|
||||
services.vaultwarden.config = {
|
||||
DOMAIN = "https://bitwarden.beepboop.systems";
|
||||
SIGNUPS_ALLOWED = false;
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."bit.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
globalRedirect = "bitwarden.beepboop.systems";
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."bitwarden.beepboop.systems" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:8000";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
{
|
||||
networking = {
|
||||
nat = {
|
||||
enable = true;
|
||||
externalInterface = "eth0";
|
||||
internalInterfaces = [ "wg0" ];
|
||||
};
|
||||
firewall.allowedUDPPorts = [ 50000 ];
|
||||
|
||||
wireguard.interfaces = {
|
||||
wg0 = {
|
||||
ips = [ "10.100.0.1/24" ];
|
||||
|
||||
listenPort = 50000;
|
||||
|
||||
postSetup = ''
|
||||
${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE
|
||||
'';
|
||||
postShutdown = ''
|
||||
${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE
|
||||
'';
|
||||
|
||||
privateKeyFile = "/home/ryan/wg-keys/private";
|
||||
|
||||
peers = [
|
||||
{ # copernicus
|
||||
publicKey = "JlH1X4KRT+B8Uau+qTLtBqyapkbGClIj1db7znU77kc=";
|
||||
allowedIPs = [ "10.100.0.2/32" ];
|
||||
}
|
||||
{ # aristotle
|
||||
publicKey = "Sw2yyMhyS8GOCWm1VuGn3Y7cfx606dXOGK5mux8ckQU=";
|
||||
allowedIPs = [ "10.100.0.3/32" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
app_cache/
|
||||
gpapp_cache/
|
|
@ -0,0 +1,18 @@
|
|||
https://f-droid.org/repo/com.termux_1020.apk
|
||||
https://f-droid.org/repo/com.termux.api_51.apk
|
||||
https://f-droid.org/repo/com.termux.widget_13.apk
|
||||
https://f-droid.org/repo/com.coboltforge.dontmind.multivnc_101.apk
|
||||
https://f-droid.org/repo/com.kylecorry.trail_sense_124.apk
|
||||
https://f-droid.org/repo/org.ligi.survivalmanual_428.apk
|
||||
https://github.com/bitwarden/android/releases/download/v2024.4.0/com.x8bit.bitwarden.apk
|
||||
https://f-droid.org/repo/at.bitfire.icsdroid_81.apk
|
||||
https://f-droid.org/repo/ws.xsoh.etar_47.apk
|
||||
https://f-droid.org/repo/at.bitfire.davdroid_404030200.apk
|
||||
https://f-droid.org/repo/org.oxycblt.auxio_53.apk
|
||||
https://f-droid.org/repo/de.danoeh.antennapod_3050095.apk
|
||||
https://f-droid.org/repo/eu.faircode.email_2241.apk
|
||||
https://f-droid.org/repo/org.koreader.launcher.fdroid_105232.apk
|
||||
https://f-droid.org/repo/at.techbee.jtx_209010003.apk
|
||||
https://f-droid.org/repo/mn.tck.semitone_4.apk
|
||||
https://f-droid.org/repo/de.moekadu.tuner_38.apk
|
||||
https://f-droid.org/repo/io.github.domi04151309.home_1100.apk
|
|
@ -0,0 +1,3 @@
|
|||
com.ministrycentered.PlanningCenter
|
||||
com.groupme.android
|
||||
com.brivo.pass
|
|
@ -0,0 +1,34 @@
|
|||
mkdir -p app_cache
|
||||
for i in $(cat apps); do
|
||||
output_name=$(echo $i | awk -F'/' '{print $NF}')
|
||||
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
|
|
@ -0,0 +1,7 @@
|
|||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
pkgs.mkShell {
|
||||
packages = [
|
||||
pkgs.apkeep
|
||||
];
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
git-annex-install
|
||||
git-annex-install.*
|
||||
git-annex.linux
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
termux: termux-pkgs termux-dots utils-sh rebuild-sh st pip-pkgs git-annex.linux sssg statusbar-polyfill
|
||||
|
||||
list: options # alias
|
||||
options:
|
||||
@echo specific options
|
||||
@echo st - rebuild st
|
||||
@echo utils-sh - copy utilities
|
||||
@echo pip-pkgs - install pip packages
|
||||
@echo termux-pkgs - install termux pkgs
|
||||
@echo termux-dots - install termux dotfiles
|
||||
@echo git-annex.linux - install git-annex
|
||||
@echo sssg - install sssg
|
||||
|
||||
st:
|
||||
-cd ../../../builds/st/ && CFLAGS="-DIS_PHONE" CC=clang make && cp st ~/.local/bin/st
|
||||
|
||||
utils-sh:
|
||||
mkdir -p ~/.local/bin
|
||||
cp ../../../builds/utils/* ~/.local/bin
|
||||
|
||||
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 \
|
||||
tur-repo \
|
||||
x11-repo
|
||||
|
||||
pkg install -y \
|
||||
neovim \
|
||||
python-pip \
|
||||
feh \
|
||||
xdotool \
|
||||
git \
|
||||
tig \
|
||||
tigervnc \
|
||||
sxhkd \
|
||||
clang \
|
||||
elinks \
|
||||
tmux \
|
||||
fontconfig \
|
||||
xorgproto \
|
||||
fzy \
|
||||
man \
|
||||
libxft \
|
||||
firefox \
|
||||
mupdf \
|
||||
texlive-bin \
|
||||
htop \
|
||||
rbw \
|
||||
pkg-config \
|
||||
xorg-xrandr \
|
||||
bspwm \
|
||||
termux-api \
|
||||
jq \
|
||||
xclip \
|
||||
isync \
|
||||
neomutt \
|
||||
pandoc \
|
||||
wget \
|
||||
which \
|
||||
rsync \
|
||||
openssl \
|
||||
chromium
|
||||
|
||||
termux-dots:
|
||||
mkdir -p ~/.local/bin
|
||||
ln -sf $(CURDIR)/../../../.config ~/.config
|
||||
ln -sf $(CURDIR)/../../../.config/ssh/config ~/.ssh/config
|
||||
ln -sf ~/.config/bash/bashrc ~/.bashrc
|
||||
ln -sf ~/.config/bash/profile ~/.bash_profile
|
||||
mkdir -p ~/.local/share
|
||||
cp $(CURDIR)/../../../home/wallpapers/pape.jpg ~/.local/share
|
||||
mkdir -p ~/.shortcuts
|
||||
cp $(CURDIR)/shortcuts/* ~/.shortcuts
|
||||
|
||||
git-annex.linux:
|
||||
bash install-git-annex.sh
|
||||
|
||||
sssg:
|
||||
-cp ~/git/sssg/sssg.sh ~/.local/bin/sssg
|
||||
-chmod +x ~/.local/bin/sssg
|
||||
|
||||
statusbar-polyfill:
|
||||
cp ~/dot_testing/builds/statusbar/termux-statusbar-polyfill ~/.local/bin
|
|
@ -0,0 +1,7 @@
|
|||
wget https://git-annex.branchable.com/install/Android/git-annex-install
|
||||
MY_WD=$(pwd)
|
||||
|
||||
source git-annex-install || printf "failed\n"
|
||||
|
||||
cd "$MY_WD"
|
||||
mv ~/git-annex.linux ./
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
|
||||
today=$(date "+%m/%d/%Y")
|
||||
|
||||
printf "Inputting height and weight information for today\n\n"
|
||||
printf "Height?\n"
|
||||
|
||||
read -p "?>" height
|
||||
|
||||
printf "Weight?\n"
|
||||
|
||||
read -p "?>" weight
|
||||
|
||||
cd ~/pdbs
|
||||
printf "\n%s %i" "$today" "$weight" >> weight.timeseries
|
||||
printf "\n%s %i" "$today" "$height" >> height.timeseries
|
||||
|
||||
git add weight.timeseries height.timeseries
|
||||
git commit -m "added height, weight data for $today"
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
|
||||
today=$(date "+%m/%d/%Y")
|
||||
ledgerdate=$(date "+%Y/%m/%d")
|
||||
|
||||
printf "Inputting an expense for today\n\n"
|
||||
printf "Payee name?\n"
|
||||
|
||||
read -p "?>" payee
|
||||
|
||||
printf "Amount?\n"
|
||||
|
||||
read -p "?>" amount
|
||||
|
||||
cd ~/pdbs
|
||||
printf '%s * %s\n\tExpenses:%s $%s\n\tAssets:Greencard 4154\n\n' "$ledgerdate" "$payee" "$payee" "$amount" >> phone.ledger
|
||||
|
||||
git add phone.ledger
|
||||
git commit -m "added an expense for $today"
|
|
@ -0,0 +1,9 @@
|
|||
register_habits=$(ls ~/pdbs/ |
|
||||
grep '\.habit$' |
|
||||
fzy)
|
||||
|
||||
if [ -z "$register_habits" ]; then
|
||||
echo "you didn't choose one!"
|
||||
else
|
||||
date "+%m/%d/%Y" >> ~/pdbs/$register_habits
|
||||
fi
|
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh
|
||||
|
||||
day5=$(date --date="5 days ago" "+%m/%d/%Y")
|
||||
day4=$(date --date="4 days ago" "+%m/%d/%Y")
|
||||
day3=$(date --date="3 days ago" "+%m/%d/%Y")
|
||||
day2=$(date --date="2 days ago" "+%m/%d/%Y")
|
||||
day1=$(date --date="1 days ago" "+%m/%d/%Y")
|
||||
today=$(date "+%m/%d/%Y")
|
||||
|
||||
# $1 -- habit filename
|
||||
show_past_habit () {
|
||||
printf "%25s =========\n" "$1"
|
||||
donein5days=$(grep -c "$day5" "$HOME/pdbs/$1")
|
||||
donein4days=$(grep -c "$day4" "$HOME/pdbs/$1")
|
||||
donein3days=$(grep -c "$day3" "$HOME/pdbs/$1")
|
||||
donein2days=$(grep -c "$day2" "$HOME/pdbs/$1")
|
||||
donein1days=$(grep -c "$day1" "$HOME/pdbs/$1")
|
||||
donetoday=$(grep -c "$today" "$HOME/pdbs/$1")
|
||||
|
||||
printf "%.5s %.5s %.5s %.5s %.5s %.5s\n%5s %5s %5s %5s %5s %5s\n\n" \
|
||||
"$day5" "$day4" "$day3" "$day2" "$day1" "$today" \
|
||||
"$donein5days" "$donein4days" "$donein3days" \
|
||||
"$donein2days" "$donein1days" "$donetoday"
|
||||
}
|
||||
|
||||
habits=$(ls ~/pdbs | grep '\.habit$')
|
||||
for i in $habits; do
|
||||
show_past_habit "$i"
|
||||
done
|
||||
|
||||
read THROWAWAY
|
|
@ -7,6 +7,7 @@
|
|||
../../modules/hosts.nix
|
||||
../../modules/common.nix
|
||||
../../modules/x11.nix
|
||||
../../modules/pulse.nix
|
||||
../../modules/discord.nix
|
||||
];
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
../../modules/bootstrap.nix
|
||||
../../modules/common.nix
|
||||
../../modules/x11.nix
|
||||
../../modules/pulse.nix
|
||||
../../modules/hosts.nix
|
||||
../../modules/tlp.nix
|
||||
../../modules/media.nix
|
||||
|
@ -25,6 +26,7 @@
|
|||
ffmpeg
|
||||
thunderbird
|
||||
ledger
|
||||
ranger
|
||||
];
|
||||
|
||||
hardware.bluetooth = {
|
||||
|
@ -58,7 +60,6 @@
|
|||
|
||||
hardware.pulseaudio.enable = true;
|
||||
|
||||
|
||||
networking.hostName = "x230t";
|
||||
|
||||
system.stateVersion = "23.11";
|
||||
|
|
|
@ -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
|
||||
'';
|
||||
}
|
|
@ -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"
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
temp=$(mktemp)
|
||||
|
||||
nvim $temp
|
||||
|
||||
IFS='
|
||||
'
|
||||
for i in $(cat $temp); do
|
||||
todo new "$i"
|
||||
done
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
generate_daily_brief | tail -1 | sed 's|file://||g' | xargs lp -d EPSONTHING
|
|
@ -1,19 +0,0 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
let
|
||||
cfg = config.services.gmail_mail_bridge;
|
||||
appEnv = pkgs.python3.withPackages (p: with p; [ waitress (callPackage ./gmail_mail_bridge/default.nix {}) ]);
|
||||
in {
|
||||
options.services.gmail_mail_bridge = {
|
||||
enable = lib.mkEnableOption "Enable the gmail_mail_bridge";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
systemd.services.gmail_mail_bridge = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${appEnv}/bin/waitress-serve --port=8041 gmail_mail_bridge:app";
|
||||
StandardOutput = "journal";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
__pycache_/
|
|
@ -1,10 +0,0 @@
|
|||
synchronize email from gmail accounts whose OAuth access is heavily restricted
|
||||
|
||||
background
|
||||
----------
|
||||
|
||||
my school district disabled external OAuth access to email, which is not cool. this script gets around this and creates a bridge so you can recieve emails from your school email.
|
||||
|
||||
do note that this is heavily unpolished and most definately insecure. there are some hardcoded credentials (which you can change, it just takes a little technical know-how)
|
||||
|
||||
have fun!
|
|
@ -1,20 +0,0 @@
|
|||
{ pkgs, pythonPackages ? (import <nixpkgs> {}).python3Packages }:
|
||||
pythonPackages.buildPythonPackage {
|
||||
name = "gmail_mail_bridge";
|
||||
src = ./gmail_mail_bridge;
|
||||
|
||||
propagatedBuildInputs = [ pythonPackages.flask pkgs.system-sendmail ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/${pythonPackages.python.sitePackages}
|
||||
cp -r . $out/${pythonPackages.python.sitePackages}/gmail_mail_bridge
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
shellHook = "export FLASK_APP=gmail_mail_bridge";
|
||||
|
||||
format = "other";
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
from flask import Flask
|
||||
from flask import request
|
||||
from flask import redirect
|
||||
from flask import abort
|
||||
|
||||
import logging
|
||||
|
||||
import smtplib
|
||||
import email
|
||||
|
||||
from subprocess import Popen, PIPE, STDOUT
|
||||
|
||||
pre_shared_secret = "amongus sussy imposter"
|
||||
to = "ryan@beepboop.systems"
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
def handle_post(request):
|
||||
msg = email.message_from_string(request.form["payload"])
|
||||
del msg["To"]
|
||||
msg["To"] = to
|
||||
if not msg["From"]:
|
||||
msg["From"] = "unknown-sender@mail.beepboop.systems"
|
||||
|
||||
s = smtplib.SMTP('localhost')
|
||||
s.send_message(msg)
|
||||
s.quit()
|
||||
|
||||
@app.route("/bridge-submit", methods = ["GET", "POST"])
|
||||
def testing():
|
||||
if request.method == 'POST':
|
||||
data = request.form
|
||||
if data['auth'] == pre_shared_secret:
|
||||
handle_post(request)
|
||||
else:
|
||||
return 'you didn\'t use post'
|
||||
return "default answer"
|
|
@ -1,12 +0,0 @@
|
|||
{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-23.11") {} }:
|
||||
|
||||
pkgs.mkShell {
|
||||
packages = [
|
||||
(pkgs.python3.withPackages (ps: [
|
||||
ps.flask
|
||||
]))
|
||||
|
||||
pkgs.curl
|
||||
pkgs.jq
|
||||
];
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
// google-side synchronization
|
||||
// add a minute-wise trigger for mail synchronization
|
||||
// go to the sidebar, select triggers, add a new one, configure it
|
||||
// to run syncMail every minute
|
||||
|
||||
function syncMail() {
|
||||
var threads = GmailApp.search("label:need_processing");
|
||||
var label = GmailApp.getUserLabelByName("need_processing");
|
||||
for (var thread of threads) {
|
||||
for (var message of GmailApp.getMessagesForThread(thread)) {
|
||||
var formData = {
|
||||
auth: 'amongus sussy imposter',
|
||||
payload: message.getRawContent(),
|
||||
};
|
||||
var options = {
|
||||
'method' : 'POST',
|
||||
'payload' : formData
|
||||
};
|
||||
var resp = UrlFetchApp.fetch('https://mail.beepboop.systems/bridge-submit', options);
|
||||
}
|
||||
thread.removeLabel(label);
|
||||
}
|
||||
}
|
|
@ -18,6 +18,8 @@ stdenv.mkDerivation rec {
|
|||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp $src/rebuild $out/bin
|
||||
cp $src/git-rebuild $out/bin
|
||||
cp $src/nix-sanitation $out/bin
|
||||
wrapProgram $out/bin/rebuild --prefix PATH : ${lib.makeBinPath [ bash ]}
|
||||
'';
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
# make sure we're in dot_testing
|
||||
cd ~/dot_testing
|
||||
|
||||
git pull
|
||||
git stash
|
||||
git rebase
|
||||
|
||||
rebuild
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
printf "clearing out nix caches\n"
|
||||
|
||||
sudo nix-collect-garbage -d
|
||||
nix-collect-garbage -d
|
||||
sudo nix-store --optimize
|
|
@ -1,4 +1,18 @@
|
|||
#!/bin/sh
|
||||
|
||||
cd ~/dot_testing
|
||||
if [ "$(hostname)" = "localhost" ]; then
|
||||
# we're on a phone
|
||||
cd boxes/phone/out-of-tree
|
||||
make $@
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -f "boxes/$(hostname)/custom_command" ]; then
|
||||
eval "$(cat boxes/$(hostname)/custom_command)"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -f "flake.nix" ]; then
|
||||
sudo nixos-rebuild --flake . switch $@
|
||||
else
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, pkgs
|
||||
, fetchgit
|
||||
, makeWrapper
|
||||
, bash
|
||||
, pandoc
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "sssg";
|
||||
version = "1.00";
|
||||
|
||||
src = fetchgit {
|
||||
url = "https://git.beepboop.systems/stupidcomputer/sssg";
|
||||
hash = "sha256-b0lbHsu628CKPNC6HDLApZQ4HsinTrXCoFqr1KdVIYE=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ bash pandoc ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
|
||||
cp $src/sssg.sh $out/bin/sssg
|
||||
wrapProgram $out/bin/sssg --prefix PATH : ${lib.makeBinPath [ bash pandoc ]}
|
||||
'';
|
||||
}
|
|
@ -7,6 +7,7 @@
|
|||
, fontconfig
|
||||
, freetype
|
||||
, ncurses
|
||||
, lightMode ? false
|
||||
, extraLibs ? [ ]
|
||||
}:
|
||||
|
||||
|
@ -19,7 +20,8 @@ stdenv.mkDerivation rec {
|
|||
nativeBuildInputs = [ pkg-config fontconfig freetype ncurses ];
|
||||
buildInputs = [ libX11 libXft ] ++ extraLibs;
|
||||
|
||||
buildPhase = ''
|
||||
buildPhase = lib.optionalString (lightMode == true) "cp lightmode.h colors.h;" +
|
||||
''
|
||||
make
|
||||
'';
|
||||
|
||||
|
|
|
@ -3,7 +3,12 @@
|
|||
/*
|
||||
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
|
||||
*/
|
||||
#ifdef IS_PHONE
|
||||
static char *font = "Monospace:pixelsize=34:antialias=true:autohint=true";
|
||||
#else
|
||||
static char *font = "Fantasque Sans Mono:pixelsize=14:antialias=true:autohint=true";
|
||||
#endif
|
||||
|
||||
static int borderpx = 2;
|
||||
|
||||
/*
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
/* Terminal colors (16 first used in escape sequence) */
|
||||
static const char *colorname[] = {
|
||||
/* solarized light */
|
||||
"#eee8d5", /* 0: black */
|
||||
"#dc322f", /* 1: red */
|
||||
"#859900", /* 2: green */
|
||||
"#b58900", /* 3: yellow */
|
||||
"#268bd2", /* 4: blue */
|
||||
"#d33682", /* 5: magenta */
|
||||
"#2aa198", /* 6: cyan */
|
||||
"#073642", /* 7: white */
|
||||
"#fdf6e3", /* 8: brblack */
|
||||
"#cb4b16", /* 9: brred */
|
||||
"#93a1a1", /* 10: brgreen */
|
||||
"#839496", /* 11: bryellow */
|
||||
"#657b83", /* 12: brblue */
|
||||
"#6c71c4", /* 13: brmagenta*/
|
||||
"#586e75", /* 14: brcyan */
|
||||
"#002b36", /* 15: brwhite */
|
||||
};
|
|
@ -0,0 +1,2 @@
|
|||
{ pkgs ? import <nixpkgs> {} }:
|
||||
pkgs.callPackage ./derivation.nix {}
|
|
@ -0,0 +1,10 @@
|
|||
{ lib, python3Packages }:
|
||||
with python3Packages;
|
||||
buildPythonApplication {
|
||||
pname = "statusbar";
|
||||
version = "1.0";
|
||||
|
||||
propagatedBuildInputs = [ ];
|
||||
|
||||
src = ./.;
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
from setuptools import setup, find_packages
|
||||
|
||||
setup(
|
||||
name = 'pystatus',
|
||||
version = '1.0.0',
|
||||
author = 'stupidcomputer',
|
||||
author_email = 'ryan@beepboop.systems',
|
||||
url = 'https://git.beepboop.systems/stupidcomputer/dot_testing',
|
||||
description = 'simple statusbar content program',
|
||||
license = 'GPLv3',
|
||||
entry_points = {
|
||||
'console_scripts': [
|
||||
'statusbar = statusbar.statusbar:main'
|
||||
]
|
||||
},
|
||||
classifiers = (
|
||||
"Programming Language :: Python :: 3",
|
||||
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
||||
"Operating System :: POSIX :: Linux",
|
||||
"Environment :: Console"
|
||||
),
|
||||
zip_safe = False
|
||||
)
|
|
@ -0,0 +1 @@
|
|||
__pycache__/
|
|
@ -0,0 +1,215 @@
|
|||
from multiprocessing import Process, Queue
|
||||
from collections import defaultdict
|
||||
from sys import argv, stdout
|
||||
from math import floor
|
||||
from socket import gethostname
|
||||
import datetime
|
||||
import signal
|
||||
import subprocess
|
||||
import re
|
||||
|
||||
import os, socket, time
|
||||
|
||||
def find_all_belonging_to_monitor(splitted, monitor):
|
||||
splitted = [i[1:] if i[1:] == monitor else i for i in splitted]
|
||||
our_monitor = splitted.index(monitor)
|
||||
next_monitor = None
|
||||
for i in range(our_monitor, len(splitted)):
|
||||
if splitted[i][0].lower() == "m":
|
||||
next_monitor = i
|
||||
break
|
||||
|
||||
if not next_monitor:
|
||||
next_monitor = len(splitted) - 1
|
||||
|
||||
return splitted[our_monitor:next_monitor]
|
||||
|
||||
def generate_desktop_string(monitor_array):
|
||||
output = []
|
||||
for i in monitor_array:
|
||||
if i[0] == "O":
|
||||
output.append("*{}".format(i[1:]))
|
||||
|
||||
if i[0] == "o":
|
||||
output.append("{}".format(i[1:]))
|
||||
|
||||
if i[0] == "F":
|
||||
output.append("*{}".format(i[1:]))
|
||||
|
||||
return ' '.join(output)
|
||||
|
||||
def filemodfactory(filename: str, modname: str):
|
||||
def filemod(queue, _):
|
||||
orig = 0
|
||||
while True:
|
||||
new = os.path.getmtime(filename)
|
||||
if(new > orig):
|
||||
with open(filename, 'r') as f:
|
||||
queue.put({
|
||||
"module": modname,
|
||||
"data": f.read().rstrip()
|
||||
})
|
||||
orig = new
|
||||
time.sleep(0.1)
|
||||
|
||||
return filemod
|
||||
|
||||
def new_mail(queue, _):
|
||||
while True:
|
||||
try:
|
||||
dir_output = os.listdir("/home/usr/Mail/main/INBOX/new")
|
||||
except FileNotFoundError: # we're on the phone, no mail here
|
||||
return
|
||||
dir_output = len(dir_output)
|
||||
queue.put({
|
||||
"module": "newmail",
|
||||
"data": str(dir_output)
|
||||
})
|
||||
time.sleep(20)
|
||||
|
||||
def bspwm(queue, monitor):
|
||||
client = socket.socket(
|
||||
socket.AF_UNIX,
|
||||
socket.SOCK_STREAM
|
||||
)
|
||||
try:
|
||||
client.connect("/tmp/bspwm_1_0-socket")
|
||||
except: # perhaps we're on the phone?
|
||||
client.connect("/data/data/com.termux/files/usr/tmp/bspwm_1_0-socket")
|
||||
|
||||
message = "subscribe\0".encode()
|
||||
client.send(message)
|
||||
while True:
|
||||
resp = client.recv(1024).decode().rstrip()
|
||||
splitted = resp[1:].split(":")
|
||||
if not monitor == "all":
|
||||
monitor_array = find_all_belonging_to_monitor(splitted, monitor)
|
||||
else:
|
||||
monitor_array = splitted
|
||||
queue.put({
|
||||
"module": "bspwm",
|
||||
"data": generate_desktop_string(monitor_array)
|
||||
})
|
||||
|
||||
client.close()
|
||||
|
||||
def clock(queue, _):
|
||||
while True:
|
||||
queue.put({
|
||||
"module": "clock",
|
||||
"data": datetime.datetime.now().strftime("%d/%m | %H:%M")
|
||||
})
|
||||
|
||||
time.sleep(60)
|
||||
|
||||
def filecheckerfactory(filename: str, modname: str, timeout=60):
|
||||
def filechecker(queue, _):
|
||||
while True:
|
||||
try:
|
||||
file = open(filename)
|
||||
buf = file.read(128).rstrip()
|
||||
queue.put({
|
||||
"module": modname,
|
||||
"data": buf
|
||||
})
|
||||
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
time.sleep(timeout)
|
||||
|
||||
return filechecker
|
||||
|
||||
battery = filecheckerfactory("/sys/class/power_supply/BAT0/capacity", "bat")
|
||||
batterystatus = filecheckerfactory("/sys/class/power_supply/BAT0/status", "batstat")
|
||||
sxhkdmode = filemodfactory("/home/usr/.cache/statusbar/sxhkd_mode", "sxhkdmode")
|
||||
|
||||
def render(modules) -> str:
|
||||
columns, _ = os.get_terminal_size(0)
|
||||
|
||||
left = "{} | {}({})".format(modules["clock"], modules["bspwm"], modules["sxhkdmode"])
|
||||
right = "{} {}({})".format(modules["newmail"], modules["bat"], modules["batstat"])
|
||||
padding = " " * (columns - len(left) - len(right) - 0)
|
||||
|
||||
output = left + padding + right
|
||||
|
||||
# special battery trickery
|
||||
try:
|
||||
batt_percentage = int(modules["bat"]) / 100
|
||||
except ValueError:
|
||||
batt_percentage = 1
|
||||
|
||||
highlighted = floor(columns * batt_percentage)
|
||||
|
||||
output = "\033[?25l\033[2J\033[H\033[4m" + \
|
||||
output[:highlighted] + \
|
||||
"\033[24m" + \
|
||||
output[highlighted:]
|
||||
|
||||
print(output, end='')
|
||||
stdout.flush()
|
||||
|
||||
def start_statusbars():
|
||||
# is there an actually good xrandr library?
|
||||
xrandr = subprocess.Popen(['xrandr'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
output = list(xrandr.stdout)
|
||||
output = [i.decode("utf-8") for i in output if " connected" in i.decode("utf-8")]
|
||||
serialized = []
|
||||
for i in output:
|
||||
splitted = i.split(' ')
|
||||
print(splitted)
|
||||
displayname = splitted[0]
|
||||
geometry = splitted[2]
|
||||
if geometry == "primary":
|
||||
geometry = splitted[3]
|
||||
|
||||
try:
|
||||
geometry_splitted = [int(i) for i in geometry.replace('x', '+').split('+')]
|
||||
except ValueError:
|
||||
continue
|
||||
geometry_splitted[1] = 20
|
||||
print(displayname, geometry_splitted)
|
||||
os.system("st -c statusbar -p -g {}x{}+{}+{} -e statusbar {} & disown".format(
|
||||
*map(str, geometry_splitted),
|
||||
displayname
|
||||
))
|
||||
|
||||
def main():
|
||||
try:
|
||||
os.mkdir("/home/usr/.cache/statusbar")
|
||||
except FileExistsError:
|
||||
pass
|
||||
except FileNotFoundError:
|
||||
# we're on the phone
|
||||
try:
|
||||
os.mkdir("/data/data/com.termux/files/home/.cache/statusbar")
|
||||
except FileExistsError:
|
||||
pass
|
||||
|
||||
if argv[1] == "start_statusbars":
|
||||
hostname = gethostname()
|
||||
|
||||
if not hostname == "localhost": # if we're not the phone
|
||||
start_statusbars()
|
||||
else:
|
||||
# we are the phone
|
||||
os.system("/data/data/com.termux/files/usr/bin/bash -c 'st -c statusbar -p -g {}x{}+{}+{} -e termux-statusbar-polyfill {} & disown'".format(
|
||||
1920, 50, 0, 980,
|
||||
"VNC-0"
|
||||
))
|
||||
|
||||
return
|
||||
|
||||
queue = Queue()
|
||||
modules = [bspwm, clock, battery, batterystatus, sxhkdmode, new_mail]
|
||||
[Process(target=module, args=(queue, argv[1])).start() for module in modules]
|
||||
|
||||
module_outputs = defaultdict(lambda: "")
|
||||
|
||||
while True:
|
||||
result = queue.get()
|
||||
module_outputs[result["module"]] = result["data"]
|
||||
render(module_outputs)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
python3 ~/dot_testing/builds/statusbar/statusbar/statusbar.py $@
|
|
@ -1,8 +1,6 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
# for statusbar
|
||||
, pkg-config
|
||||
, libxcb
|
||||
, pkgs
|
||||
# shell scripts stuff
|
||||
, makeWrapper
|
||||
, sshuttle
|
||||
|
@ -11,17 +9,19 @@
|
|||
, bash
|
||||
, feh
|
||||
, jq
|
||||
, ffmpeg
|
||||
, fzy
|
||||
, figlet
|
||||
, curl
|
||||
, ytfzf
|
||||
, xrandr
|
||||
, xrectsel
|
||||
, ffcast
|
||||
, svkbd
|
||||
, xkbset
|
||||
, rbw
|
||||
, xclip
|
||||
, libsForQt5
|
||||
, xmessage
|
||||
, imagemagick
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
|
@ -30,23 +30,15 @@ stdenv.mkDerivation rec {
|
|||
|
||||
src = ./utils;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper pkg-config libxcb ];
|
||||
buildInputs = [ libxcb bash feh xrandr jq curl fzy ytfzf ffmpeg sshuttle svkbd scrcpy xkbset rbw xclip libsForQt5.kolourpaint ];
|
||||
|
||||
buildPhase = ''
|
||||
ls
|
||||
make
|
||||
'';
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ bash feh xrandr jq curl fzy ytfzf sshuttle svkbd scrcpy rbw xclip ffcast xkbset xmessage imagemagick ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
|
||||
for i in $(ls $src/sh); do
|
||||
cp $src/sh/$i $out/bin
|
||||
ln -sf $out/bin/tmenu_run $out/bin/regenerate
|
||||
wrapProgram $out/bin/$i --prefix PATH : ${lib.makeBinPath [ sxhkd bash feh xrandr jq figlet curl fzy ytfzf ffmpeg sshuttle svkbd scrcpy libsForQt5.kolourpaint ]}
|
||||
for i in $(ls $src/); do
|
||||
cp $src/$i $out/bin
|
||||
wrapProgram $out/bin/$i --prefix PATH : ${lib.makeBinPath [ sxhkd bash feh xrandr jq figlet curl fzy xkbset ytfzf sshuttle svkbd scrcpy xrectsel ffcast xmessage imagemagick ]}
|
||||
done
|
||||
|
||||
cp c/status/main $out/bin/statusbar
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
.PHONY: main
|
||||
main:
|
||||
make -C c/status -f Makefile
|
|
@ -1,5 +0,0 @@
|
|||
TODO LIST
|
||||
---------
|
||||
|
||||
- fix paste
|
||||
- make the c programs less buggy and let them not suck as much
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue