From 8cc0168d2a251bc911264b67b7e9706857a3f511 Mon Sep 17 00:00:00 2001 From: randomuser Date: Mon, 30 Oct 2023 16:15:31 -0500 Subject: [PATCH 1/3] changes --- boxes/inspiron.nix | 12 ------------ boxes/mainsail.nix | 37 +++++++++++++++++++++++++++++++++++++ boxes/netbox.nix | 17 ----------------- builds/utils/sh/disp | 10 +++++++--- 4 files changed, 44 insertions(+), 32 deletions(-) delete mode 100644 boxes/inspiron.nix create mode 100644 boxes/mainsail.nix 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..a19aad4 --- /dev/null +++ b/boxes/mainsail.nix @@ -0,0 +1,37 @@ +{ lib, config, pkgs, ...}: + +{ + imports = [ + ../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"; + }; + }; + + services.getty.greetingLine = " + welcome to mainsail |`-:_ + ,----....____ | `+. + ( ````----....|___ | + \\ _ ````----....____ + \\ _) ```---.._ + \\ \\ + )`.\\ )`. )`. )`. )`. )`. )`. )`. )`. )`. )`. +-' `-' `-' `-' `-' `-' `-' `-' `-' `-' `-' ` + "; + + environment.systemPackages = with pkgs; [ + vscodium + ]; +} diff --git a/boxes/netbox.nix b/boxes/netbox.nix index c2f9975..5cda31e 100644 --- a/boxes/netbox.nix +++ b/boxes/netbox.nix @@ -122,23 +122,6 @@ ''; }; - 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. diff --git a/builds/utils/sh/disp b/builds/utils/sh/disp index 013c511..9453a3e 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,7 @@ if [ "$(exists "DP-1")" -gt 1 ]; then exit 0 fi - -# default configuration's fine +if [ "$(exists "HDMI-1")" -gt 1 ] && [ "$(hostname)" = "mainsail" ]; then + printf "mainsail selected\nHDMI-1 detected only, doing that\n" + bspc monitor HDMI-1 -d 1 2 3 4 5 6 7 8 9 +fi From d3fc9ff203cca2a9825484565fbb32e0733fa00d Mon Sep 17 00:00:00 2001 From: randomuser Date: Wed, 15 Nov 2023 21:04:50 -0600 Subject: [PATCH 2/3] misc changes --- boxes/mainsail.nix | 33 ++++++++++++++++++++++++++++++++- builds/utils.nix | 3 ++- builds/utils/sh/mode | 4 ++++ common/desktop.nix | 1 + config/sx/sxrc | 2 +- config/sxhkd/mouse | 20 ++++++++++++++++++++ config/sxhkd/sxhkdrc | 21 +++------------------ 7 files changed, 63 insertions(+), 21 deletions(-) create mode 100755 builds/utils/sh/mode create mode 100644 config/sxhkd/mouse diff --git a/boxes/mainsail.nix b/boxes/mainsail.nix index a19aad4..d420b9b 100644 --- a/boxes/mainsail.nix +++ b/boxes/mainsail.nix @@ -2,6 +2,7 @@ { imports = [ + ../common/steam.nix ../common/desktop.nix ]; @@ -19,6 +20,27 @@ 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 |`-:_ @@ -32,6 +54,15 @@ "; environment.systemPackages = with pkgs; [ - vscodium + vscodium-fhs + libreoffice + + anki + youtube-tui + kdenlive + libreoffice + i3 + gcc + gnumake ]; } diff --git a/builds/utils.nix b/builds/utils.nix index c82333e..9f070e6 100644 --- a/builds/utils.nix +++ b/builds/utils.nix @@ -1,5 +1,6 @@ { stdenv , lib +, sxhkd , bash , feh , jq @@ -24,7 +25,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 curl ]} done ''; 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/common/desktop.nix b/common/desktop.nix index 3f71a54..62efae6 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/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..28aa7ac --- /dev/null +++ b/config/sxhkd/mouse @@ -0,0 +1,20 @@ +q + mode sxhkdrc + +{ctrl +,shift +,_} h + xdotool mousemove_relative -- {-5,-50,-20} 0 + +{ctrl +,shift +,_} j + xdotool mousemove_relative -- 0 {-5,-50,-20} + +{ctrl +,shift +,_} k + xdotool mousemove_relative -- 0 {5,50,20} + +{ctrl +,shift +,_} l + xdotool mousemove_relative -- {5,50,20} 0 + +{ctrl +,_} {a,s,d} + xdotool {mousedown,click} {1,2,3} + +g + xdotool mouseup 1; xdotool mouseup 2; xdotool mouseup 3 diff --git a/config/sxhkd/sxhkdrc b/config/sxhkd/sxhkdrc index 7a2e4e1..1909839 100644 --- a/config/sxhkd/sxhkdrc +++ b/config/sxhkd/sxhkdrc @@ -16,32 +16,17 @@ super + r bspc wm -r super + w - disp && wallpaper && statusbar + disp && wallpaper && statusbar && keyboard super + {_,shift + }n nws {local,national} -super + ctrl + n - net - -super + ctrl + t - st -e htop +super + m + mode mouse {XF86AudioRaiseVolume,XF86AudioLowerVolume} vol {inc,dec} -super + b - fire - -super + shift + b - fire -P - -super + ctrl + b - chromium - -super + {_,shift + }v - vol {inc,dec} - # bspwm super + q bspc node -c From 3fc2dc19aabb92c5c989e0e68b6e5556b0485e45 Mon Sep 17 00:00:00 2001 From: randomuser Date: Tue, 21 Nov 2023 11:09:16 -0600 Subject: [PATCH 3/3] add additional configuration --- boxes/mainsail.nix | 2 +- builds/rebuild.nix | 26 ++++++++++++++++++++++ builds/{utils/sh => rebuild}/rebuild | 0 builds/utils/sh/disp | 9 +++++--- common/main.nix | 2 ++ config/nvim/init.lua | 32 ---------------------------- config/sxhkd/mouse | 4 ++-- config/sxhkd/sxhkdrc | 2 +- 8 files changed, 38 insertions(+), 39 deletions(-) create mode 100644 builds/rebuild.nix rename builds/{utils/sh => rebuild}/rebuild (100%) diff --git a/boxes/mainsail.nix b/boxes/mainsail.nix index d420b9b..b2808c2 100644 --- a/boxes/mainsail.nix +++ b/boxes/mainsail.nix @@ -58,7 +58,7 @@ libreoffice anki - youtube-tui + ytfzf kdenlive libreoffice i3 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/sh/disp b/builds/utils/sh/disp index 9453a3e..f6eb3a1 100755 --- a/builds/utils/sh/disp +++ b/builds/utils/sh/disp @@ -15,7 +15,10 @@ if [ "$(exists "DP-1")" -gt 1 ]; then exit 0 fi -if [ "$(exists "HDMI-1")" -gt 1 ] && [ "$(hostname)" = "mainsail" ]; then - printf "mainsail selected\nHDMI-1 detected only, doing that\n" - bspc monitor HDMI-1 -d 1 2 3 4 5 6 7 8 9 +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/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/sxhkd/mouse b/config/sxhkd/mouse index 28aa7ac..65308bb 100644 --- a/config/sxhkd/mouse +++ b/config/sxhkd/mouse @@ -5,10 +5,10 @@ q xdotool mousemove_relative -- {-5,-50,-20} 0 {ctrl +,shift +,_} j - xdotool mousemove_relative -- 0 {-5,-50,-20} + xdotool mousemove_relative -- 0 {5,50,20} {ctrl +,shift +,_} k - xdotool mousemove_relative -- 0 {5,50,20} + xdotool mousemove_relative -- 0 {-5,-50,-20} {ctrl +,shift +,_} l xdotool mousemove_relative -- {5,50,20} 0 diff --git a/config/sxhkd/sxhkdrc b/config/sxhkd/sxhkdrc index 1909839..17dff35 100644 --- a/config/sxhkd/sxhkdrc +++ b/config/sxhkd/sxhkdrc @@ -41,7 +41,7 @@ super + {_,ctrl +,shift + }{h,j,k,l} bspc node -{f,p,s} {west,south,north,east} super + {_,shift + } {1-9,0} - bspc {desktop -f,node -d} '^{1-9,10}' + bspc {desktop -f,node -d} '{1-9,10}' super + {t,f,s} bspc node -t {tiled,floating,fullscreen}