change everything

This commit is contained in:
randomuser 2023-09-23 03:42:22 -05:00
parent fb0ea84388
commit ee083f8279
16 changed files with 216 additions and 136 deletions

10
boxes/iso.nix Normal file
View File

@ -0,0 +1,10 @@
{ config, pkgs, ... }:
{
imports = [
<nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix>
# Provide an initial copy of the NixOS channel so that the user
# doesn't need to run "nix-channel --update" first.
<nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
];
}

View File

@ -18,6 +18,7 @@
};
environment.systemPackages = with pkgs; [
neovim
# nothing more needed, at the moment
];

View File

@ -15,20 +15,30 @@
zathura
lilypond
virt-manager
virtualbox
xsane
# virtualbox
xsane
android-studio
mpc-cli
emacs
nyxt
cmus
];
users.extraGroups.vboxusers.members = [ "usr" ];
virtualisation.virtualbox.host.enable = true;
virtualisation.virtualbox.host.enableExtensionPack = true;
# users.extraGroups.vboxusers.members = [ "usr" ];
# virtualisation.virtualbox.host.enable = true;
# virtualisation.virtualbox.host.enableExtensionPack = true;
services.tlp.enable = true;
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
services.printing.enable = true;
services.avahi.enable = true;
services.avahi.nssmdns = true;
# for a WiFi printer
services.avahi.openFirewall = true;
networking.nameservers = [ "1.1.1.1" "9.9.9.9" ];
networking.hostName = "xps";

View File

@ -1,6 +1,7 @@
{ stdenv
, lib
, bash
, gnupg
, makeWrapper
, fetchgit
}:
@ -14,7 +15,7 @@ stdenv.mkDerivation rec {
sha256 = "sha256-0L3N7F4BwVdu4rR5xpUEIHcX/x64Gni8JTUki5kGH24=";
};
nativeBuildInputs = [ makeWrapper ];
nativeBuildInputs = [ makeWrapper gnupg ];
installPhase = ''
mkdir -p $out/bin

View File

@ -1,4 +0,0 @@
#!/bin/sh
brightness=$(printf "250\n500\n1000\n2000\n3000\n4000\n" | tmenu)
st -c st-gpg-menu -e sh -c "sudo sh -c \"echo $brightness >> /sys/class/backlight/intel_backlight/brightness\""

View File

@ -1,6 +1,6 @@
#!/bin/sh
sel="$(find -L ~/.config 2>/dev/null | fzy)"
sel="$(find -L ~/dot_testing 2>/dev/null | fzy)"
[ "$?" -eq 1 ] && exit 1
nvim "$sel"

View File

@ -4,24 +4,14 @@ exists() {
xrandr | grep ' connected' | grep -c "${1}"
}
bspc monitor -d 1 2 3 4 5 6 7 8 9
bspc monitor eDP-1 -d 1 2 3 4 5 6 7 8 9
if [ "$(exists "HDMI-2")" -eq 1 ] && [ "$(exists "LVDS-1")" -eq 1 ]; then
if [ "$(exists "DP-1")" -gt 1 ]; then
printf "two"
xrandr --output HDMI-2 --right-of LVDS-1 --auto
xrandr --output VGA-1 --off --auto
bspc monitor LVDS-1 -d 1 2 3 4 5 6 7 8 9
bspc monitor HDMI-2 -d 1 2 3 4 5 6 7 8 9
bspc monitor DP-1 -s eDP-1
xrandr --output eDP-1 --off
exit 0
fi
if [ "$(exists "HDMI-1")" -eq 1 ] && [ "$(exists "LVDS-1")" -eq 1 ]; then
printf "two"
xrandr --output HDMI-1 --right-of LVDS-1 --auto
xrandr --output VGA-1 --off --auto
bspc monitor LVDS-1 -d 1 2 3 4 5 6 7 8 9
bspc monitor HDMI-1 -d 1 2 3 4 5 6 7 8 9
exit 0
fi
# default configuration's fine

View File

@ -1,2 +1,2 @@
cd ~/dot_testing
sudo nixos-rebuild -I nixos-config=./boxes/$(hostname).nix switch
sudo nixos-rebuild -I nixos-config=./boxes/$(hostname).nix switch $@

View File

@ -1,18 +0,0 @@
#!/bin/sh
tmenu_path () {
IFS=" :"
for i in $PATH; do
for j in "$i"/*; do
[ -f "$j" ] && [ -x "$j" ] && printf "%s\n" "$j" | xargs basename
done
done
}
if [ "$1" = "-g" ] || [ "$(basename $0)" = "regenerate" ]; then
mkdir -p $HOME/.local/share
tmenu_path > $HOME/.local/share/tmenu_cache
xmessage "regeneration complete"
else
cat $HOME/.local/share/tmenu_cache | tmenu | ${SHELL:-"/bin/sh"} &
fi

View File

@ -1,28 +0,0 @@
#!/bin/sh
pid=$(pgrep sxhkd)
for i in $pid; do
inv_id=$(cat /proc/$i/cmdline | awk -F'\0' '{print $3}')
echo $inv_id
[ -z "$inv_id" ] && contingency_mode="off"
[ "$inv_id" = *"contingency" ] && contingency_mode="on"
done
killall sxhkd
trackpoint=$(xinput | grep "TrackPoint" | awk -F'\t' '{print $2}' | awk -F'=' '{print $2}')
touchpad=$(xinput | grep "TouchPad" | awk -F'\t' '{print $2}' | awk -F'=' '{print $2}')
if [ "$contingency_mode" = "off" ]; then
sxhkd -c $HOME/.config/sxhkd/contingency &
xinput disable "$trackpoint"
xinput disable "$touchpad"
xmessage "contingency mode enabled."
else
sxhkd &
xinput enable "$trackpoint"
xinput enable "$touchpad"
killall xmessage
fi

View File

@ -36,6 +36,7 @@ in {
xclip
xcape
ffmpeg
man-pages
ncmpcpp
pciutils
@ -137,11 +138,15 @@ in {
services.mpd = {
enable = true;
musicDirectory = "/home/usr/music";
user = "usr";
extraConfig = ''
audio_output {
type "pulse"
name "pulseaudio"
server "127.0.0.1"
name "Pulseaudio"
}
audio_output {
type "alsa"
name "mpd alsamixer-output"
}
'';
};
@ -170,10 +175,16 @@ in {
fi
'';
home-manager.users.usr.home = {
stateVersion = "23.05";
home-manager.users.usr = {
home.stateVersion = "23.05";
file = {
programs.neovim = {
enable = true;
extraLuaPackages = luaPkgs: with luaPkgs; [ luaexpat ];
extraPackages = [ pkgs.sqlite ];
};
home.file = {
".config/bash" = {
source = ../config/bash;
recursive = true;
@ -226,6 +237,10 @@ in {
source = ../config/gnupg;
recursive = true;
};
".config/emacs" = {
source = ../config/emacs;
recursive = true;
};
};
};

View File

@ -1,6 +1,10 @@
{ lib, config, pkgs, ... }:
{
let
my_neovim = pkgs.neovim.overrideAttrs (oldAttrs: {
buildInputs = oldAttrs.buildInputs or [] ++ [ pkgs.luajitPackages.luaexpat ];
});
in {
imports =
[
../hardware-configuration.nix # include the results of the hardware scan
@ -17,7 +21,6 @@
};
environment.systemPackages = with pkgs; [
neovim
curl
htop
git

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

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

View File

@ -30,12 +30,13 @@ 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('~/.config/nvim/init.lua')
cmd.edit('~/dot_testing/config/nvim/init.lua')
end)
-- openup netrw
nnoremap('<leader>fs', function()
@ -79,22 +80,6 @@ globals.vimtex_view_method = 'zathura'
-- }}}
-- autocommands {{{
-- swapfile handler
vim.api.nvim_create_autocmd({"SwapExists"}, {
pattern = {"*"},
callback = function()
vim.fn.system("vim-swap-handler " .. vim.api.nvim_buf_get_name(0))
print(vim.v.shell_error)
if (vim.v.shell_error == 0) then
vim.v.swapchoice = 'o'
print("opened in other place. you should have teleported there")
elseif (vim.v.shell_error == 1) then
vim.v.swapchoice = 'o'
print("file opened readonly. orphaned swap file?")
end
end
})
-- autocmds for sxhkd and bspwm config files
vim.api.nvim_create_autocmd({"BufWrite"}, {
pattern = {"bspwmrc"},
@ -162,6 +147,7 @@ local packer = require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
use 'nvim-lua/plenary.nvim'
use 'nvim-telescope/telescope.nvim'
use 'octarect/telescope-menu.nvim'
use 'VonHeikemen/lsp-zero.nvim'
use 'neovim/nvim-lspconfig'
use 'hrsh7th/nvim-cmp'
@ -171,6 +157,11 @@ 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()
@ -208,6 +199,12 @@ lspconfig.jedi_language_server.setup({})
lsp.setup()
-- }}}
require("nvim-rss").setup({
feeds_dir = "/home/usr",
date_format = "%x %r",
verbose = false,
})
nnoremap('<leader>ff', function()
require('telescope.builtin').find_files()
end)

View File

@ -1,2 +0,0 @@
super + shift + XF86AudioRaiseVolume
toggle-contingency-mode

View File

@ -15,9 +15,6 @@ super + r
pkill -USR1 -x sxhkd; \
bspc wm -r
super + ctrl + shift + b
brightness
super + w
disp && wallpaper && statusbar
@ -30,15 +27,6 @@ super + ctrl + n
super + ctrl + t
st -e htop
super + m
lobster
{XF86ScreenSaver,super + shift + z}
slock
XF86AudioMute
amixer sset Master 0%
{XF86AudioRaiseVolume,XF86AudioLowerVolume}
vol {inc,dec}
@ -54,29 +42,6 @@ super + ctrl + b
super + {_,shift + }v
vol {inc,dec}
# mouse movement
super + {u, i, o, p}
xdotool mousemove_relative -- {-10 0, 0 10, 0 -10, 10 0}
super + alt + {u, i, o, p}
xdotool mousemove_relative -- {-20 0, 0 20, 0 -20, 20 0}
super + shift + u
xdotool click 1
super + ctrl + shift + u
xdotool mousedown 1
@super + @ctrl + @shift + @u
xdotool mouseup 1
super + shift + p
xdotool click 2
# misc
super + x
toggle-contingency-mode
# bspwm
super + q
bspc node -c
@ -85,14 +50,13 @@ super + e
bspc quit 0
super + shift + e
systemctl suspend
systemctl suspend
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}'; \
{killall -10 status,_}
bspc {desktop -f,node -d} '^{1-9,10}'
super + {t,f,s}
bspc node -t {tiled,floating,fullscreen}