diff --git a/boxes/inspiron.nix b/boxes/inspiron.nix deleted file mode 100644 index 513d4e6..0000000 --- a/boxes/inspiron.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ lib, config, pkgs, ...}: - -{ - imports = [ - ../common/desktop.nix - ]; - - boot.loader.grub.enable = true; - boot.loader.grub.device = "/dev/sda"; - - networking.hostName = "mainsail"; -} diff --git a/boxes/mainsail.nix b/boxes/mainsail.nix new file mode 100644 index 0000000..f9d274e --- /dev/null +++ b/boxes/mainsail.nix @@ -0,0 +1,85 @@ +{ lib, config, pkgs, ...}: + +{ + imports = [ + ../common/steam.nix + ../common/desktop.nix + ]; + + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sda"; + + networking.hostName = "mainsail"; + + services.paperless = { + enable = true; + passwordFile = "/etc/paperless-password"; + port = 3004; + address = "localhost"; + extraConfig = { + PAPERLESS_URL = "https://paperless.beepboop.systems"; + }; + }; + programs.adb.enable = true; + users.users.usr.extraGroups = ["adbusers"]; + + environment.etc."nextcloud-admin-pass".text = "aslkfjaslkdfjsalkdfjlKJFLKJDLFKJLSKDJFLSKDJFLSKDJFLSKDFJ"; + services.nextcloud = { + enable = true; + hostName = "beepboop.systems"; + config.adminpassFile = "/etc/nextcloud-admin-pass"; + package = pkgs.nextcloud27; + # Instead of using pkgs.nextcloud27Packages.apps, + # we'll reference the package version specified above + extraApps = with config.services.nextcloud.package.packages.apps; { + inherit news contacts calendar tasks; + }; + extraAppsEnable = true; + }; + + systemd.targets.sleep.enable = false; + systemd.targets.suspend.enable = false; + systemd.targets.hibernate.enable = false; + systemd.targets.hybrid-sleep.enable = false; + + services.getty.greetingLine = " + welcome to mainsail |`-:_ + ,----....____ | `+. + ( ````----....|___ | + \\ _ ````----....____ + \\ _) ```---.._ + \\ \\ + )`.\\ )`. )`. )`. )`. )`. )`. )`. )`. )`. )`. +-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `-' ` + "; + + environment.systemPackages = with pkgs; [ + vscodium-fhs + libreoffice + + anki + ytfzf + kdenlive + libreoffice + i3 + gcc + gnumake + ]; + + systemd.user.services.paperless-activate = { + script = '' + while true; do + # restart every 5 minutes + echo "starting link" + ssh -v -NR 3004:localhost:3004 -p 55555 useracc@beepboop.systems & disown + sudo ssh -v -NR 4000:localhost:80 -p 55555 useracc@beepboop.systems & disown + echo "waiting" + sleep $((60 * 5)) + echo "killing and restarting" + pkill ssh + done + ''; + + wantedBy = [ "multi-user.target" ]; + }; +} diff --git a/boxes/netbox.nix b/boxes/netbox.nix index c2f9975..464c97d 100644 --- a/boxes/netbox.nix +++ b/boxes/netbox.nix @@ -69,6 +69,12 @@ root = "/var/www/beepboop.systems"; }; + services.nginx.virtualHosts."cloud.beepboop.systems" = { + forceSSL = true; + enableACME = true; + locations."/".proxyPass = "http://localhost:4000"; + }; + services.nginx.virtualHosts."git.beepboop.systems" = { forceSSL = true; enableACME = true; @@ -105,7 +111,7 @@ security.acme = { acceptTerms = true; - email = "nickforanick@protonmail.com"; + defaults.email = "nickforanick@protonmail.com"; }; services.roundcube = { @@ -122,26 +128,9 @@ ''; }; - services.paperless = { - enable = true; - passwordFile = "/etc/paperless-password"; - port = 3004; - address = "localhost"; - extraConfig = { - PAPERLESS_URL = "https://paperless.beepboop.systems"; - }; - }; - - # services.ntfy-sh = { - # enable = true; - # settings = { - # listen-http = ":3500"; - # }; - # }; - services.vaultwarden.enable = true; # Open ports in the firewall. networking.firewall.enable = false; - networking.firewall.allowedTCPPorts = [ 55555 80 443 ]; + networking.firewall.allowedTCPPorts = [ 5232 55555 80 443 ]; } diff --git a/builds/rebuild.nix b/builds/rebuild.nix new file mode 100644 index 0000000..e03af19 --- /dev/null +++ b/builds/rebuild.nix @@ -0,0 +1,26 @@ +{ stdenv +, lib +, bash +, makeWrapper +}: + +stdenv.mkDerivation rec { + pname = "rebuild"; + version = "1.00"; + + src = ./rebuild; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ bash ]; + + buildPhase = ""; + + installPhase = '' + mkdir -p $out/bin + cp $src/rebuild $out/bin + wrapProgram $out/bin/rebuild --prefix PATH : ${lib.makeBinPath [ bash ]} + ''; + + phases = [ "buildPhase" "installPhase" ]; +} + diff --git a/builds/utils/sh/rebuild b/builds/rebuild/rebuild similarity index 100% rename from builds/utils/sh/rebuild rename to builds/rebuild/rebuild diff --git a/builds/utils.nix b/builds/utils.nix index c82333e..d4612be 100644 --- a/builds/utils.nix +++ b/builds/utils.nix @@ -1,8 +1,10 @@ { stdenv , lib +, sxhkd , bash , feh , jq +, figlet , curl , xrandr , makeWrapper @@ -24,7 +26,7 @@ stdenv.mkDerivation rec { for i in $(ls $src/sh); do cp $src/sh/$i $out/bin - wrapProgram $out/bin/$i --prefix PATH : ${lib.makeBinPath [ bash feh xrandr jq curl ]} + wrapProgram $out/bin/$i --prefix PATH : ${lib.makeBinPath [ sxhkd bash feh xrandr jq figlet curl ]} done ''; diff --git a/builds/utils/sh/bspwm-toggle-gaps b/builds/utils/sh/bspwm-toggle-gaps deleted file mode 100755 index 776fc5a..0000000 --- a/builds/utils/sh/bspwm-toggle-gaps +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -gaps="$(bspc config top_padding)" - -if [ "$gaps" -eq 20 ]; then - bspc config window_gap 0 - bspc config top_padding 18 -else - bspc config window_gap 3 - bspc config top_padding 20 -fi diff --git a/builds/utils/sh/cfg b/builds/utils/sh/cfg deleted file mode 100755 index 8c90cb1..0000000 --- a/builds/utils/sh/cfg +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -sel="$(find -L ~/dot_testing 2>/dev/null | fzy)" -[ "$?" -eq 1 ] && exit 1 - -nvim "$sel" diff --git a/builds/utils/sh/disp b/builds/utils/sh/disp index 013c511..f6eb3a1 100755 --- a/builds/utils/sh/disp +++ b/builds/utils/sh/disp @@ -4,7 +4,9 @@ exists() { xrandr | grep ' connected' | grep -c "${1}" } -bspc monitor eDP-1 -d 1 2 3 4 5 6 7 8 9 +if [ ! "$(hostname)" = "mainsail" ]; then + bspc monitor eDP-1 -d 1 2 3 4 5 6 7 8 9 +fi if [ "$(exists "DP-1")" -gt 1 ]; then printf "two" @@ -13,5 +15,10 @@ if [ "$(exists "DP-1")" -gt 1 ]; then exit 0 fi - -# default configuration's fine +if [ "$(hostname)" = "mainsail" ]; then + # this is a tower, so there's only one configuration + printf "mainsail detected\n" + xrandr --output VGA-1 --left-of HDMI-1 + bspc monitor VGA-1 -d 1 3 5 7 9 + bspc monitor HDMI-1 -d 2 4 6 8 0 +fi diff --git a/builds/utils/sh/fire b/builds/utils/sh/fire deleted file mode 100755 index 298f915..0000000 --- a/builds/utils/sh/fire +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -HOME="/home/usr/.local/share/firefox" firefox "$@" diff --git a/builds/utils/sh/firew b/builds/utils/sh/firew deleted file mode 100755 index cfae372..0000000 --- a/builds/utils/sh/firew +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -# wrapper script to make firefox suck less - -RHOME="${HOME}" - -firefox_data_location="$HOME/firefoxdumpster" -[ -z "$3" ] || url="$3" - -# start a profile chooser -if [ -z "$2" ]; then - profile=$(printf "programming\nschool\ntmp-school\ntmp\nchromium\n" | tmenu) -else - profile="$2" -fi - -[ -z "$profile" ] && exit - -if [ "$profile" = "tmp" ]; then - # firefox doesn't start in a directory within /tmp - # so we create one in $HOME/.cache - - tmp=$(basename $(mktemp)) - mkdir -p "${RHOME}/.cache/${tmp}" - rm -r "/tmp/$tmp" - HOME="/home/$(whoami)/.local/share/firefox" firefox --profile "${RHOME}/.cache/${tmp}" --no-remote "$url" - rm -r "${RHOME}/.cache/${tmp}" - exit -fi - -if [ "$profile" = "chromium" ]; then - HOME="/home/$(whoami)/.local/share/firefox" chromium - exit -fi - -# start firefox -mkdir -p "${firefox_data_location}/profile" -HOME="/home/$(whoami)/.local/share/firefox" firefox --profile "${firefox_data_location}/${profile}" --no-remote "$url" -exit - -printf "failed to specify a profile. exiting.\n" -exit 1 diff --git a/builds/utils/sh/git-credential-gitpass b/builds/utils/sh/git-credential-gitpass deleted file mode 100755 index 749d7fb..0000000 --- a/builds/utils/sh/git-credential-gitpass +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -printf "password=%s\n" "$(pash s tildegit)" diff --git a/builds/utils/sh/mode b/builds/utils/sh/mode new file mode 100755 index 0000000..86973d2 --- /dev/null +++ b/builds/utils/sh/mode @@ -0,0 +1,4 @@ +# mode - change the current effective sxhkd configuration + +pkill sxhkd +sxhkd -c ~/.config/sxhkd/$1 & disown diff --git a/builds/utils/sh/pash-dmenu b/builds/utils/sh/pash-dmenu deleted file mode 100755 index 3929379..0000000 --- a/builds/utils/sh/pash-dmenu +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -sel="$(pash l | tmenu)" -[ "$?" -eq 1 ] && exit 0 - -# requires bspc rule -a st-gpg-menu state=floating -st -c st-gpg-menu -e pash-dmenu-backend "$sel" diff --git a/builds/utils/sh/pash-dmenu-backend b/builds/utils/sh/pash-dmenu-backend deleted file mode 100755 index 86d61d6..0000000 --- a/builds/utils/sh/pash-dmenu-backend +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -printf "%s\n" "$1" -pash c "$1" -bspc node -d '^9' -sleep 15 diff --git a/builds/utils/sh/paste b/builds/utils/sh/paste deleted file mode 100755 index 87987e0..0000000 --- a/builds/utils/sh/paste +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -[ "$1" = "" ] && exit 1 -[ -f "$1" ] && curl -F"file=@${1}" https://0x0.st && exit 0 diff --git a/builds/utils/sh/sfeed_yt_add b/builds/utils/sh/sfeed_yt_add deleted file mode 100755 index 4cd2937..0000000 --- a/builds/utils/sh/sfeed_yt_add +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -[ -z "$1" ] && exit 1 -[ -z "$2" ] && exit 1 - -printf "[info] this utility is used for adding youtube urls as rss feeds\n" - -feed="$(curl "$1" -s | \ - grep 'youtube/www\.youtube\.com/channel/.\{24\}' -o | \ - awk -F'/' '{print "https://www.youtube.com/feeds/videos.xml?channel_id=" $NF}' | \ - sed 1q)" - -[ -z "$feed" ] && printf "[err] error processing the feed. are you sure it's *www*.youtube.com and not youtube.com?\n" && exit 1 - -sfeedrc="$HOME/.config/sfeed/sfeedrc" - -ed "$sfeedrc" < /' | \ + sed 's/^\# //g' + done + ;; + *) + echo "???????????????" + ;; +esac diff --git a/builds/utils/sh/vim-swap-handler b/builds/utils/sh/vim-swap-handler deleted file mode 100755 index 06082af..0000000 --- a/builds/utils/sh/vim-swap-handler +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# when the vim SwapExists autocommand is fired, this script is -# called with the path of the file in question. - -# mad props to daniel conway for having this big brain idea - -# note to self: protect $1 from expansion as it can contain a -# ~ - -[ "$#" -eq 0 ] && exit 2 - -window=$( - xdotool search --name "$1" | \ - sed 1q -) - -desk=$( - xdotool get_desktop_for_window "$window" 2>/dev/null || printf "none" -) - -[ "$desk" = "none" ] && exit 1 -desk=$((desk + 1)) - -bspc desktop -f "^${desk}" -killall -10 simplestatus -xdotool set_window --urgency 1 "$window" - -exit 0 diff --git a/common/desktop.nix b/common/desktop.nix index 47692dd..f6f1493 100644 --- a/common/desktop.nix +++ b/common/desktop.nix @@ -63,6 +63,7 @@ in { pinentry-curses magic-wormhole xbrightness + xdotool figlet unzip diff --git a/common/main.nix b/common/main.nix index beebdae..4f22544 100644 --- a/common/main.nix +++ b/common/main.nix @@ -28,6 +28,8 @@ in { dig htop gnumake + + (pkgs.callPackage ../builds/rebuild.nix {}) ]; system.copySystemConfiguration = true; diff --git a/config/nvim/init.lua b/config/nvim/init.lua index 0a5b4b8..82fad69 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -157,11 +157,6 @@ local packer = require('packer').startup(function(use) use 'lervag/vimtex' use 'https://github.com/protex/better-digraphs.nvim' use 'https://github.com/itchyny/calendar.vim' - use { - "empat94/nvim-rss", - requires = { "tami5/sqlite.lua" }, - rocks = "luaexpat", - } use { "folke/which-key.nvim", config = function() @@ -178,33 +173,6 @@ local packer = require('packer').startup(function(use) end); -- }}} --- lsp configuration {{{ -local lsp = require('lsp-zero').preset({}) - -lsp.on_attach(function(client, bufnr) - lsp.default_keymaps({buffer = bufnr}) -end) - -local lspconfig = require('lspconfig') - -lsp.ensure_installed({ - 'rnix', - 'jedi_language_server', -}) - -lspconfig.lua_ls.setup(lsp.nvim_lua_ls()) -lspconfig.rnix.setup({}) -lspconfig.jedi_language_server.setup({}) - -lsp.setup() --- }}} - -require("nvim-rss").setup({ - feeds_dir = "/home/usr", - date_format = "%x %r", - verbose = false, -}) - nnoremap('ff', function() require('telescope.builtin').find_files() end) diff --git a/config/sx/sxrc b/config/sx/sxrc index 5f80a2b..7b564f2 100755 --- a/config/sx/sxrc +++ b/config/sx/sxrc @@ -1,6 +1,6 @@ # adjust some keybindings keyboard - +# # start the wm sxhkd & bspwm diff --git a/config/sxhkd/mouse b/config/sxhkd/mouse new file mode 100644 index 0000000..535b5d6 --- /dev/null +++ b/config/sxhkd/mouse @@ -0,0 +1,27 @@ +# exit mouse mode +q + mode sxhkdrc + +# move left +{ctrl +,shift +,_} h + xdotool mousemove_relative -- {-5,-50,-20} 0 + +# move down +{ctrl +,shift +,_} j + xdotool mousemove_relative -- 0 {5,50,20} + +# move up +{ctrl +,shift +,_} k + xdotool mousemove_relative -- 0 {-5,-50,-20} + +# move right +{ctrl +,shift +,_} l + xdotool mousemove_relative -- {5,50,20} 0 + +# left, middle, right click +{ctrl +,_} {a,s,d} + xdotool {mousedown,click} {1,2,3} + +# let go of clicked button +g + xdotool mouseup 1; xdotool mouseup 2; xdotool mouseup 3 diff --git a/config/sxhkd/sxhkdrc b/config/sxhkd/sxhkdrc index 7a2e4e1..19b1862 100644 --- a/config/sxhkd/sxhkdrc +++ b/config/sxhkd/sxhkdrc @@ -1,68 +1,48 @@ -# rndusr's sxhkdrc - -# program launching + sxhkd reload - +# spawn a terminal super + Return - st + st +# spawn the launcher super + d - tmenu_run - -super + z - pash-dmenu + tmenu_run +# kill sxhkd with USR1 and restart bspwm super + r - pkill -USR1 -x sxhkd; \ - bspc wm -r + pkill -USR1 -x sxhkd; \ + bspc wm -r +# reinitialize ancillary services super + w - disp && wallpaper && statusbar + disp && wallpaper && statusbar && keyboard +# control the national weather service super + {_,shift + }n - nws {local,national} + nws {local,national} -super + ctrl + n - net +# switch to "mouse mode" +super + m + mode mouse -super + ctrl + t - st -e htop - -{XF86AudioRaiseVolume,XF86AudioLowerVolume} - vol {inc,dec} - -super + b - fire - -super + shift + b - fire -P - -super + ctrl + b - chromium - -super + {_,shift + }v - vol {inc,dec} - -# bspwm +# kill the current node super + q - bspc node -c + bspc node -c +# kill bspwm super + e - bspc quit 0 + bspc quit 0 +# systemctl suspend super + shift + e - systemctl suspend + systemctl suspend +# manipulate a node super + {_,ctrl +,shift + }{h,j,k,l} - bspc node -{f,p,s} {west,south,north,east} + 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} '{1-9,10}' +# change a node to tiling, floating, or fullscreen super + {t,f,s} - bspc node -t {tiled,floating,fullscreen} - -super + shift + t - bspwm-toggle-gaps - -alt + F4 - exit + bspc node -t {tiled,floating,fullscreen} diff --git a/modules/mail.nix b/modules/mail.nix index bc686b1..af5f33c 100644 --- a/modules/mail.nix +++ b/modules/mail.nix @@ -30,6 +30,11 @@ in { "postmaster@beepboop.systems" ]; }; + + "mailsynchronization@beepboop.systems" = { + # nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt' > /hashed/password/file/location + hashedPasswordFile = "/etc/ryan-beepboop-systemsuser-pass"; + }; }; certificateScheme = "acme-nginx"; };