From fc384fc48e05f17f2d28a7a7d2b0b1802eabea53 Mon Sep 17 00:00:00 2001 From: kdam0 Date: Fri, 7 Apr 2023 12:44:12 -0400 Subject: major updates, breaking changes --- bg.sh | 12 -- foot/.config/foot/foot.ini | 2 - mako/.config/mako/config | 24 --- nix/.config/nix/nix.conf | 1 + nixpkgs/.config/nixpkgs/common/bg.sh | 12 ++ nixpkgs/.config/nixpkgs/common/dwl_3/config.h | 135 ++++++++++++++++ nixpkgs/.config/nixpkgs/common/dwl_4/config.h | 176 +++++++++++++++++++++ nixpkgs/.config/nixpkgs/common/foot/foot.ini | 3 + nixpkgs/.config/nixpkgs/common/mako/config | 25 +++ nixpkgs/.config/nixpkgs/common/start.sh | 18 +++ nixpkgs/.config/nixpkgs/common/wofi/style.css | 58 +++++++ nixpkgs/.config/nixpkgs/configuration.nix | 112 ------------- nixpkgs/.config/nixpkgs/dwl/config.h | 176 --------------------- nixpkgs/.config/nixpkgs/flake.nix | 21 ++- nixpkgs/.config/nixpkgs/hardware-configuration.nix | 42 ----- nixpkgs/.config/nixpkgs/home.nix | 142 ----------------- nixpkgs/.config/nixpkgs/hosts.nix | 9 -- .../nixpkgs/per-user/kdam0-home/configuration.nix | 112 +++++++++++++ .../per-user/kdam0-home/hardware-configuration.nix | 42 +++++ .../.config/nixpkgs/per-user/kdam0-home/home.nix | 174 ++++++++++++++++++++ .../.config/nixpkgs/per-user/kdam0-home/hosts.nix | 9 ++ .../.config/nixpkgs/per-user/kdam0-work/flake.lock | 65 ++++++++ .../.config/nixpkgs/per-user/kdam0-work/flake.nix | 31 ++++ .../.config/nixpkgs/per-user/kdam0-work/home.nix | 113 +++++++++++++ start.sh | 24 --- wofi/.config/wofi/style.css | 57 ------- 26 files changed, 993 insertions(+), 602 deletions(-) delete mode 100755 bg.sh delete mode 100644 foot/.config/foot/foot.ini delete mode 100644 mako/.config/mako/config create mode 100644 nix/.config/nix/nix.conf create mode 100755 nixpkgs/.config/nixpkgs/common/bg.sh create mode 100644 nixpkgs/.config/nixpkgs/common/dwl_3/config.h create mode 100644 nixpkgs/.config/nixpkgs/common/dwl_4/config.h create mode 100644 nixpkgs/.config/nixpkgs/common/foot/foot.ini create mode 100644 nixpkgs/.config/nixpkgs/common/mako/config create mode 100755 nixpkgs/.config/nixpkgs/common/start.sh create mode 100644 nixpkgs/.config/nixpkgs/common/wofi/style.css delete mode 100644 nixpkgs/.config/nixpkgs/configuration.nix delete mode 100644 nixpkgs/.config/nixpkgs/dwl/config.h delete mode 100644 nixpkgs/.config/nixpkgs/hardware-configuration.nix delete mode 100644 nixpkgs/.config/nixpkgs/home.nix delete mode 100644 nixpkgs/.config/nixpkgs/hosts.nix create mode 100644 nixpkgs/.config/nixpkgs/per-user/kdam0-home/configuration.nix create mode 100644 nixpkgs/.config/nixpkgs/per-user/kdam0-home/hardware-configuration.nix create mode 100644 nixpkgs/.config/nixpkgs/per-user/kdam0-home/home.nix create mode 100644 nixpkgs/.config/nixpkgs/per-user/kdam0-home/hosts.nix create mode 100644 nixpkgs/.config/nixpkgs/per-user/kdam0-work/flake.lock create mode 100644 nixpkgs/.config/nixpkgs/per-user/kdam0-work/flake.nix create mode 100644 nixpkgs/.config/nixpkgs/per-user/kdam0-work/home.nix delete mode 100755 start.sh delete mode 100644 wofi/.config/wofi/style.css diff --git a/bg.sh b/bg.sh deleted file mode 100755 index 9bcefa6..0000000 --- a/bg.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -WALLPAPERS_HOME=${1:-$HOME/pics/wallpapers} - -# Get a random image file from the dir. -RAND_BG=$(find "$WALLPAPERS_HOME" -type f -name "*.jpeg" -o -name "*.jpg" -o -name "*.png" | shuf | head -n1) - -# Set the image file as the background. -(command -v wbg > /dev/null || (echo "wbg is not installed." && exit 1) && \ - # else - notify-send "Set background." && wbg "${RAND_BG}" -) diff --git a/foot/.config/foot/foot.ini b/foot/.config/foot/foot.ini deleted file mode 100644 index dc9ed5e..0000000 --- a/foot/.config/foot/foot.ini +++ /dev/null @@ -1,2 +0,0 @@ -[colors] -alpha=0.7 diff --git a/mako/.config/mako/config b/mako/.config/mako/config deleted file mode 100644 index 9ddfc3b..0000000 --- a/mako/.config/mako/config +++ /dev/null @@ -1,24 +0,0 @@ -sort=-time -layer=overlay -background-color=#2e3440 -width=300 -height=110 -border-size=2 -border-color=#88c0d0 -border-radius=15 -icons=0 -max-icon-size=64 -default-timeout=5000 -ignore-timeout=1 -font=monospace 14 - -[urgency=low] -border-color=#cccccc - -[urgency=normal] -border-color=#d08770 - -[urgency=high] -border-color=#bf616a -default-timeout=0 - diff --git a/nix/.config/nix/nix.conf b/nix/.config/nix/nix.conf new file mode 100644 index 0000000..c7d7291 --- /dev/null +++ b/nix/.config/nix/nix.conf @@ -0,0 +1 @@ +experimental-features = nix-command flakes diff --git a/nixpkgs/.config/nixpkgs/common/bg.sh b/nixpkgs/.config/nixpkgs/common/bg.sh new file mode 100755 index 0000000..9bcefa6 --- /dev/null +++ b/nixpkgs/.config/nixpkgs/common/bg.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +WALLPAPERS_HOME=${1:-$HOME/pics/wallpapers} + +# Get a random image file from the dir. +RAND_BG=$(find "$WALLPAPERS_HOME" -type f -name "*.jpeg" -o -name "*.jpg" -o -name "*.png" | shuf | head -n1) + +# Set the image file as the background. +(command -v wbg > /dev/null || (echo "wbg is not installed." && exit 1) && \ + # else + notify-send "Set background." && wbg "${RAND_BG}" +) diff --git a/nixpkgs/.config/nixpkgs/common/dwl_3/config.h b/nixpkgs/.config/nixpkgs/common/dwl_3/config.h new file mode 100644 index 0000000..30c8ec2 --- /dev/null +++ b/nixpkgs/.config/nixpkgs/common/dwl_3/config.h @@ -0,0 +1,135 @@ +#include + +/* appearance */ +static const int sloppyfocus = 1; /* focus follows mouse */ +static const unsigned int borderpx = 1; /* border pixel of windows */ +static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ +static const float rootcolor[] = {0.3, 0.3, 0.3, 1.0}; +static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0}; +static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0}; + +/* tagging */ +static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; + +static const Rule rules[] = { + /* app_id title tags mask isfloating monitor */ + /* examples: + { "Gimp", NULL, 0, 1, -1 }, + */ + { "firefox", NULL, 1 << 8, 0, -1 }, +}; + +/* layout(s) */ +static const Layout layouts[] = { + /* symbol arrange function */ + { "[]=", tile }, + { "><>", NULL }, /* no layout function means floating behavior */ + { "[M]", monocle }, +}; + +/* monitors */ +static const MonitorRule monrules[] = { + /* name mfact nmaster scale layout rotate/reflect */ + /* example of a HiDPI laptop monitor: + { "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL }, + */ + /* defaults */ + { NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL }, +}; + +/* keyboard */ +static const struct xkb_rule_names xkb_rules = { + /* can specify fields: rules, model, layout, variant, options */ + /* example: + .options = "ctrl:nocaps", + */ + .options = "caps:escape", +}; + +static const int repeat_rate = 25; +static const int repeat_delay = 600; + +/* Trackpad */ +static const int tap_to_click = 1; +static const int natural_scrolling = 0; + +/* If you want to use the windows key change this to WLR_MODIFIER_LOGO */ +#define MODKEY WLR_MODIFIER_ALT +#define TAGKEYS(KEY,SKEY,TAG) \ + { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ + { MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \ + { MODKEY|WLR_MODIFIER_SHIFT, SKEY, tag, {.ui = 1 << TAG} }, \ + { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} } + +/* helper for spawning shell commands in the pre dwm-5.0 fashion */ +#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } + + +/* commands */ +static const char *termcmd[] = { "foot", NULL }; +static const char *menucmd[] = { "wofi", "--show", "run", NULL }; +static const char *volmute[] = { "amixer", "set", "Master", "toggle", NULL }; +static const char *voldown[] = { "amixer", "set", "Master", "10%-", NULL }; +static const char *volup[] = { "amixer", "set", "Master", "10%+", NULL }; +static const char *brightdown[] = { "light", "-U", "10", NULL }; +static const char *brightup[] = { "light", "-A", "10", NULL }; +static const char *hibernatecmd[] = { "systemctl", "hibernate", NULL }; + +static const Key keys[] = { + /* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */ + /* modifier key function argument */ + { MODKEY, XKB_KEY_p, spawn, {.v = menucmd} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} }, + { MODKEY, XKB_KEY_j, focusstack, {.i = +1} }, + { MODKEY, XKB_KEY_k, focusstack, {.i = -1} }, + { MODKEY, XKB_KEY_i, incnmaster, {.i = +1} }, + { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} }, + { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05} }, + { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05} }, + { MODKEY, XKB_KEY_Return, zoom, {0} }, + { MODKEY, XKB_KEY_Tab, view, {0} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} }, + { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} }, + { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} }, + { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} }, + { MODKEY, XKB_KEY_space, setlayout, {0} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} }, + { MODKEY, XKB_KEY_e, togglefullscreen, {0} }, + { MODKEY, XKB_KEY_0, view, {.ui = ~0} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} }, + { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} }, + { MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = WLR_DIRECTION_LEFT} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} }, + // custom binds + { 0, XKB_KEY_XF86AudioMute, spawn, {.v = volmute} }, + { 0, XKB_KEY_XF86AudioLowerVolume, spawn, {.v = voldown} }, + { 0, XKB_KEY_XF86AudioRaiseVolume, spawn, {.v = volup} }, + { 0, XKB_KEY_XF86MonBrightnessDown, spawn, {.v = brightdown} }, + { 0, XKB_KEY_XF86MonBrightnessUp, spawn, {.v = brightup} }, + { 0, XKB_KEY_Print, spawn, SHCMD("slurp | grim -g - - | wl-copy && notify-send 'Copied selection to clipboard!' && wl-paste > $HOME/pics/$(date +'%Y-%m-%d-%H%M%S_grim.png')") }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Delete, spawn, {.v = hibernatecmd} }, + TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0), + TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1), + TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2), + TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3), + TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4), + TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5), + TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6), + TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7), + TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8), + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} }, + + /* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */ + { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} }, +#define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} } + CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6), + CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12), +}; + +static const Button buttons[] = { + { MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} }, + { MODKEY, BTN_MIDDLE, togglefloating, {0} }, + { MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} }, +}; + diff --git a/nixpkgs/.config/nixpkgs/common/dwl_4/config.h b/nixpkgs/.config/nixpkgs/common/dwl_4/config.h new file mode 100644 index 0000000..346111e --- /dev/null +++ b/nixpkgs/.config/nixpkgs/common/dwl_4/config.h @@ -0,0 +1,176 @@ +#include + +/* appearance */ +static const int sloppyfocus = 1; /* focus follows mouse */ +static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */ +static const unsigned int borderpx = 1; /* border pixel of windows */ +static const float rootcolor[] = {0.3, 0.3, 0.3, 1.0}; +static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0}; +static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0}; +/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */ +static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; + +/* tagging */ +static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; + +static const Rule rules[] = { + /* app_id title tags mask isfloating monitor */ + /* examples: + { "Gimp", NULL, 0, 1, -1 }, + */ + { "firefox", NULL, 1 << 8, 0, -1 }, +}; + +/* layout(s) */ +static const Layout layouts[] = { + /* symbol arrange function */ + { "[]=", tile }, + { "><>", NULL }, /* no layout function means floating behavior */ + { "[M]", monocle }, +}; + +/* monitors */ +static const MonitorRule monrules[] = { + /* name mfact nmaster scale layout rotate/reflect */ + /* example of a HiDPI laptop monitor: + { "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL }, + */ + /* defaults */ + { NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL }, +}; + +/* keyboard */ +static const struct xkb_rule_names xkb_rules = { + /* can specify fields: rules, model, layout, variant, options */ + /* example: + .options = "ctrl:nocaps", + */ + .options = "caps:escape", +}; + +static const int repeat_rate = 25; +static const int repeat_delay = 600; + +/* Trackpad */ +static const int tap_to_click = 1; +static const int tap_and_drag = 1; +static const int drag_lock = 1; +static const int natural_scrolling = 0; +static const int disable_while_typing = 1; +static const int left_handed = 0; +static const int middle_button_emulation = 0; +/* You can choose between: +LIBINPUT_CONFIG_SCROLL_NO_SCROLL +LIBINPUT_CONFIG_SCROLL_2FG +LIBINPUT_CONFIG_SCROLL_EDGE +LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN +*/ +static const enum libinput_config_scroll_method scroll_method = LIBINPUT_CONFIG_SCROLL_2FG; + +/* You can choose between: +LIBINPUT_CONFIG_CLICK_METHOD_NONE +LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS +LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER +*/ +static const enum libinput_config_click_method click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS; + +/* You can choose between: +LIBINPUT_CONFIG_SEND_EVENTS_ENABLED +LIBINPUT_CONFIG_SEND_EVENTS_DISABLED +LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE +*/ +static const uint32_t send_events_mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED; + +/* You can choose between: +LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT +LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE +*/ +static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE; +static const double accel_speed = 0.0; +/* You can choose between: +LIBINPUT_CONFIG_TAP_MAP_LRM -- 1/2/3 finger tap maps to left/right/middle +LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right +*/ +static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TAP_MAP_LRM; + +/* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */ +#define MODKEY WLR_MODIFIER_ALT + +#define TAGKEYS(KEY,SKEY,TAG) \ + { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ + { MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \ + { MODKEY|WLR_MODIFIER_SHIFT, SKEY, tag, {.ui = 1 << TAG} }, \ + { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} } + +/* helper for spawning shell commands in the pre dwm-5.0 fashion */ +#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } + + +/* commands */ +static const char *termcmd[] = { "foot", NULL }; +static const char *menucmd[] = { "wofi", "--show", "run", NULL }; +static const char *volmute[] = { "amixer", "set", "Master", "toggle", NULL }; +static const char *voldown[] = { "amixer", "set", "Master", "10%-", NULL }; +static const char *volup[] = { "amixer", "set", "Master", "10%+", NULL }; +static const char *brightdown[] = { "light", "-U", "10", NULL }; +static const char *brightup[] = { "light", "-A", "10", NULL }; +static const char *hibernatecmd[] = { "systemctl", "hibernate", NULL }; + +static const Key keys[] = { + /* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */ + /* modifier key function argument */ + { MODKEY, XKB_KEY_p, spawn, {.v = menucmd} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} }, + { MODKEY, XKB_KEY_j, focusstack, {.i = +1} }, + { MODKEY, XKB_KEY_k, focusstack, {.i = -1} }, + { MODKEY, XKB_KEY_i, incnmaster, {.i = +1} }, + { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} }, + { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05} }, + { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05} }, + { MODKEY, XKB_KEY_Return, zoom, {0} }, + { MODKEY, XKB_KEY_Tab, view, {0} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} }, + { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} }, + { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} }, + { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} }, + { MODKEY, XKB_KEY_space, setlayout, {0} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} }, + { MODKEY, XKB_KEY_e, togglefullscreen, {0} }, + { MODKEY, XKB_KEY_0, view, {.ui = ~0} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} }, + { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} }, + { MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = WLR_DIRECTION_LEFT} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} }, + // custom binds + { 0, XKB_KEY_XF86AudioMute, spawn, {.v = volmute} }, + { 0, XKB_KEY_XF86AudioLowerVolume, spawn, {.v = voldown} }, + { 0, XKB_KEY_XF86AudioRaiseVolume, spawn, {.v = volup} }, + { 0, XKB_KEY_XF86MonBrightnessDown, spawn, {.v = brightdown} }, + { 0, XKB_KEY_XF86MonBrightnessUp, spawn, {.v = brightup} }, + { 0, XKB_KEY_Print, spawn, SHCMD("slurp | grim -g - - | wl-copy && notify-send 'Copied selection to clipboard!' && wl-paste > $HOME/pics/$(date +'%Y-%m-%d-%H%M%S_grim.png')") }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Delete, spawn, {.v = hibernatecmd} }, + TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0), + TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1), + TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2), + TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3), + TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4), + TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5), + TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6), + TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7), + TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8), + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} }, + + /* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */ + { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} }, +#define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} } + CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6), + CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12), +}; + +static const Button buttons[] = { + { MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} }, + { MODKEY, BTN_MIDDLE, togglefloating, {0} }, + { MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} }, +}; + diff --git a/nixpkgs/.config/nixpkgs/common/foot/foot.ini b/nixpkgs/.config/nixpkgs/common/foot/foot.ini new file mode 100644 index 0000000..e0ed811 --- /dev/null +++ b/nixpkgs/.config/nixpkgs/common/foot/foot.ini @@ -0,0 +1,3 @@ +[colors] +alpha=0.7 + diff --git a/nixpkgs/.config/nixpkgs/common/mako/config b/nixpkgs/.config/nixpkgs/common/mako/config new file mode 100644 index 0000000..52a21f1 --- /dev/null +++ b/nixpkgs/.config/nixpkgs/common/mako/config @@ -0,0 +1,25 @@ +sort=-time +layer=overlay +background-color=#2e3440 +width=300 +height=110 +border-size=2 +border-color=#88c0d0 +border-radius=15 +icons=0 +max-icon-size=64 +default-timeout=5000 +ignore-timeout=1 +font=monospace 14 + +[urgency=low] +border-color=#cccccc + +[urgency=normal] +border-color=#d08770 + +[urgency=high] +border-color=#bf616a +default-timeout=0 + + diff --git a/nixpkgs/.config/nixpkgs/common/start.sh b/nixpkgs/.config/nixpkgs/common/start.sh new file mode 100755 index 0000000..3dd6cf0 --- /dev/null +++ b/nixpkgs/.config/nixpkgs/common/start.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# This a sort-of auto-start script. +# Run this from a tty to start my graphical env. + +export EDITOR=nvim + +exec dwl -s 'somebar' & + +# set blocks on bar +exec /usr/local/bin/someblocks & + +# give wayland session some time to init +sleep 1 + +exec mako & + +# set bg +exec ./bg.sh & diff --git a/nixpkgs/.config/nixpkgs/common/wofi/style.css b/nixpkgs/.config/nixpkgs/common/wofi/style.css new file mode 100644 index 0000000..ba73e91 --- /dev/null +++ b/nixpkgs/.config/nixpkgs/common/wofi/style.css @@ -0,0 +1,58 @@ +#entry { + border-radius: 3px; + padding: 2px 3px 2px 3px; +} + +#entry:selected { + background-color: #5e81ac; +} + +#text:selected { + color: #d8dee9; +} + +#window { + padding: 2px; + background-color: rgba(53, 59, 73, 0.97); + border: 3px solid #3b4252; + border-radius: 2px; + font-family: 'Inter Nerd Font','FuraCode Nerd Font Mono'; + font-size: 48px; +} + +#input { + border: 2px solid #5e81ac; + background-color: #4c566a; + color: #d8dee9; + padding: 3px 5px 3px 5px; + border-radius: 5px; +} + +#inner-box { + color: #d8dee9; + padding: 2px; + background-color: transparent; +} + +#outer-box { + margin: 15px; + background-color: transparent; +} + +#scroll { + margin-top: 10px; + background-color: transparent; + border: none; +} + +#text { + padding: 3px; + background-color: transparent; +} + +#img { + background-color: transparent; + padding: 5px; +} + + diff --git a/nixpkgs/.config/nixpkgs/configuration.nix b/nixpkgs/.config/nixpkgs/configuration.nix deleted file mode 100644 index 903bab8..0000000 --- a/nixpkgs/.config/nixpkgs/configuration.nix +++ /dev/null @@ -1,112 +0,0 @@ -{ config, pkgs, ... }: - -{ - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - # Include extra host entries - ./hosts.nix - ]; - - # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - networking.hostName = "art-sr"; # Define your hostname. - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - - # Set your time zone. - time.timeZone = "America/Toronto"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - console = { - font = "Lat2-Terminus16"; - keyMap = "us"; - #useXkbConfig = true; # use xkbOptions in tty. - }; - - nixpkgs.config.allowUnfree = true; - - # Enable CUPS to print documents. - services.printing.enable = true; - - # Enable sound. - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - wireplumber.enable = true; - media-session.enable = false; - jack.enable = true; - systemWide = false; - }; - - - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.kdam0 = { - isNormalUser = true; - extraGroups = [ - "wheel" - "video" - "audio" - "docker" - ]; - shell = pkgs.zsh; - }; - - # List packages installed in system profile. To search, run: - environment.systemPackages = with pkgs; [ - wget - git - rsync - neovim - htop - bmon - alsa-utils - libcamera - docker-buildx - docker-compose - wireguard-tools - ]; - - virtualisation.docker = { - enable = true; - enableOnBoot = true; - rootless = { - enable = true; - setSocketVariable = true; - }; - }; - - # Copy the NixOS configuration file and link it from the resulting system - # (/run/current-system/configuration.nix). This is useful in case you - # accidentally delete configuration.nix. - # system.copySystemConfiguration = true; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "22.11"; # Did you read the comment? - - nix.settings.experimental-features = ["nix-command" "flakes"]; - - security.polkit.enable = true; - hardware.opengl = { - enable = true; - driSupport = true; - }; - #xdg.portal = { - # enable = true; - # wlr.enable = true; - #}; - #hardware.enableAllFirmware = true; - - services.fwupd.enable = true; -} - diff --git a/nixpkgs/.config/nixpkgs/dwl/config.h b/nixpkgs/.config/nixpkgs/dwl/config.h deleted file mode 100644 index 346111e..0000000 --- a/nixpkgs/.config/nixpkgs/dwl/config.h +++ /dev/null @@ -1,176 +0,0 @@ -#include - -/* appearance */ -static const int sloppyfocus = 1; /* focus follows mouse */ -static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */ -static const unsigned int borderpx = 1; /* border pixel of windows */ -static const float rootcolor[] = {0.3, 0.3, 0.3, 1.0}; -static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0}; -static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0}; -/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */ -static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; - -/* tagging */ -static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; - -static const Rule rules[] = { - /* app_id title tags mask isfloating monitor */ - /* examples: - { "Gimp", NULL, 0, 1, -1 }, - */ - { "firefox", NULL, 1 << 8, 0, -1 }, -}; - -/* layout(s) */ -static const Layout layouts[] = { - /* symbol arrange function */ - { "[]=", tile }, - { "><>", NULL }, /* no layout function means floating behavior */ - { "[M]", monocle }, -}; - -/* monitors */ -static const MonitorRule monrules[] = { - /* name mfact nmaster scale layout rotate/reflect */ - /* example of a HiDPI laptop monitor: - { "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL }, - */ - /* defaults */ - { NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL }, -}; - -/* keyboard */ -static const struct xkb_rule_names xkb_rules = { - /* can specify fields: rules, model, layout, variant, options */ - /* example: - .options = "ctrl:nocaps", - */ - .options = "caps:escape", -}; - -static const int repeat_rate = 25; -static const int repeat_delay = 600; - -/* Trackpad */ -static const int tap_to_click = 1; -static const int tap_and_drag = 1; -static const int drag_lock = 1; -static const int natural_scrolling = 0; -static const int disable_while_typing = 1; -static const int left_handed = 0; -static const int middle_button_emulation = 0; -/* You can choose between: -LIBINPUT_CONFIG_SCROLL_NO_SCROLL -LIBINPUT_CONFIG_SCROLL_2FG -LIBINPUT_CONFIG_SCROLL_EDGE -LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN -*/ -static const enum libinput_config_scroll_method scroll_method = LIBINPUT_CONFIG_SCROLL_2FG; - -/* You can choose between: -LIBINPUT_CONFIG_CLICK_METHOD_NONE -LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS -LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER -*/ -static const enum libinput_config_click_method click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS; - -/* You can choose between: -LIBINPUT_CONFIG_SEND_EVENTS_ENABLED -LIBINPUT_CONFIG_SEND_EVENTS_DISABLED -LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE -*/ -static const uint32_t send_events_mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED; - -/* You can choose between: -LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT -LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE -*/ -static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE; -static const double accel_speed = 0.0; -/* You can choose between: -LIBINPUT_CONFIG_TAP_MAP_LRM -- 1/2/3 finger tap maps to left/right/middle -LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right -*/ -static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TAP_MAP_LRM; - -/* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */ -#define MODKEY WLR_MODIFIER_ALT - -#define TAGKEYS(KEY,SKEY,TAG) \ - { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ - { MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|WLR_MODIFIER_SHIFT, SKEY, tag, {.ui = 1 << TAG} }, \ - { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} } - -/* helper for spawning shell commands in the pre dwm-5.0 fashion */ -#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } - - -/* commands */ -static const char *termcmd[] = { "foot", NULL }; -static const char *menucmd[] = { "wofi", "--show", "run", NULL }; -static const char *volmute[] = { "amixer", "set", "Master", "toggle", NULL }; -static const char *voldown[] = { "amixer", "set", "Master", "10%-", NULL }; -static const char *volup[] = { "amixer", "set", "Master", "10%+", NULL }; -static const char *brightdown[] = { "light", "-U", "10", NULL }; -static const char *brightup[] = { "light", "-A", "10", NULL }; -static const char *hibernatecmd[] = { "systemctl", "hibernate", NULL }; - -static const Key keys[] = { - /* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */ - /* modifier key function argument */ - { MODKEY, XKB_KEY_p, spawn, {.v = menucmd} }, - { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} }, - { MODKEY, XKB_KEY_j, focusstack, {.i = +1} }, - { MODKEY, XKB_KEY_k, focusstack, {.i = -1} }, - { MODKEY, XKB_KEY_i, incnmaster, {.i = +1} }, - { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} }, - { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05} }, - { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05} }, - { MODKEY, XKB_KEY_Return, zoom, {0} }, - { MODKEY, XKB_KEY_Tab, view, {0} }, - { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} }, - { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} }, - { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} }, - { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} }, - { MODKEY, XKB_KEY_space, setlayout, {0} }, - { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} }, - { MODKEY, XKB_KEY_e, togglefullscreen, {0} }, - { MODKEY, XKB_KEY_0, view, {.ui = ~0} }, - { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} }, - { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} }, - { MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} }, - { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = WLR_DIRECTION_LEFT} }, - { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} }, - // custom binds - { 0, XKB_KEY_XF86AudioMute, spawn, {.v = volmute} }, - { 0, XKB_KEY_XF86AudioLowerVolume, spawn, {.v = voldown} }, - { 0, XKB_KEY_XF86AudioRaiseVolume, spawn, {.v = volup} }, - { 0, XKB_KEY_XF86MonBrightnessDown, spawn, {.v = brightdown} }, - { 0, XKB_KEY_XF86MonBrightnessUp, spawn, {.v = brightup} }, - { 0, XKB_KEY_Print, spawn, SHCMD("slurp | grim -g - - | wl-copy && notify-send 'Copied selection to clipboard!' && wl-paste > $HOME/pics/$(date +'%Y-%m-%d-%H%M%S_grim.png')") }, - { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Delete, spawn, {.v = hibernatecmd} }, - TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0), - TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1), - TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2), - TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3), - TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4), - TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5), - TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6), - TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7), - TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8), - { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} }, - - /* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */ - { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} }, -#define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} } - CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6), - CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12), -}; - -static const Button buttons[] = { - { MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} }, - { MODKEY, BTN_MIDDLE, togglefloating, {0} }, - { MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} }, -}; - diff --git a/nixpkgs/.config/nixpkgs/flake.nix b/nixpkgs/.config/nixpkgs/flake.nix index 8be77de..d831b32 100644 --- a/nixpkgs/.config/nixpkgs/flake.nix +++ b/nixpkgs/.config/nixpkgs/flake.nix @@ -9,17 +9,20 @@ }; outputs = inputs@{ nixpkgs, home-manager, nixos-hardware, ... }: { + # NixOS + Home Manager nixosConfigurations = { "art-sr" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - ./configuration.nix + #./configuration.nix + ./per-user/kdam0-home/configuration.nix nixos-hardware.nixosModules.framework home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - home-manager.users.kdam0 = import ./home.nix; + #home-manager.users.kdam0 = import ./home.nix; + home-manager.users.kdam0 = import ./per-user/kdam0-home/home.nix; # Optionally, use home-manager.extraSpecialArgs to pass # arguments to home.nix @@ -27,5 +30,19 @@ ]; }; }; + + # Home Manager Only + homeConfigurations = { + "kdam0" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages."x86_64-linux"; + modules = [ + ./per-user/kdam0-work/home.nix + ]; + + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + }; + }; + }; } diff --git a/nixpkgs/.config/nixpkgs/hardware-configuration.nix b/nixpkgs/.config/nixpkgs/hardware-configuration.nix deleted file mode 100644 index 7911403..0000000 --- a/nixpkgs/.config/nixpkgs/hardware-configuration.nix +++ /dev/null @@ -1,42 +0,0 @@ -# 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" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/a6261869-4550-462b-8e55-df2473630da4"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/5358-A98A"; - fsType = "vfat"; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/3990180a-8508-4d55-9752-c674b21a48d6"; } - ]; - - # 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..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp0s20f0u4.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - # high-resolution display - hardware.video.hidpi.enable = lib.mkDefault true; -} diff --git a/nixpkgs/.config/nixpkgs/home.nix b/nixpkgs/.config/nixpkgs/home.nix deleted file mode 100644 index 33f3d00..0000000 --- a/nixpkgs/.config/nixpkgs/home.nix +++ /dev/null @@ -1,142 +0,0 @@ -{ config, pkgs, libs, ...}: -{ - home.username = "kdam0"; - home.homeDirectory = "/home/kdam0"; - - programs.home-manager.enable = true; - programs.zsh = { - enable = true; - defaultKeymap = "viins"; - initExtra = '' - source ${config.home.homeDirectory}/.p10k.zsh - ''; - shellAliases = { - l = "ls -l"; - ll = "ls -al"; - ".." = "cd .."; - up = "sudo nixos-rebuild switch"; - clean = "sudo nix-collect-garbage -d"; - cdwl = "nvim ~/.config/nixpkgs/dwl/config.h"; - chm = "nvim ~/.config/nixpkgs/home.nix"; - cnix = "nvim ~/.config/nixpkgs/configuration.nix"; - gst = "git status"; - v = "nvim $@"; - search = "nix search nixpkgs $@"; - }; - zplug = { - enable = true; - plugins = [ - { name = "zsh-users/zsh-autosuggestions"; } - { name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; } - ]; - }; - }; - programs.tmux = { - enable = true; - clock24 = true; - shell = "${pkgs.zsh}/bin/zsh"; - prefix = "C-a"; - terminal = "screen-256color"; - keyMode = "vi"; - }; - - home.stateVersion = "22.11"; - home.packages = [ - # Window environment - (pkgs.dwl.override { - # trying to supply config.home.homeDirectory here leads to "impure" usage. - # so disabling it for now - # conf = (builtins.readFile "${config.home.homeDirectory}/.config/dwl/config.h"); - conf = ./dwl/config.h; - }) - pkgs.somebar - pkgs.foot - pkgs.wofi - pkgs.wl-clipboard - pkgs.wf-recorder - pkgs.grim - pkgs.slurp - pkgs.polkit - pkgs.light - pkgs.wbg - # Browsers - pkgs.firefox - pkgs.brave - # File Managers - pkgs.ranger - pkgs.pcmanfm - pkgs.gvfs - # Image Editor - pkgs.krita - # Fonts - pkgs.nerdfonts - pkgs.hack-font - pkgs.noto-fonts - pkgs.noto-fonts-cjk - # Notifications - pkgs.mako - pkgs.libnotify - # Image viewer - pkgs.imv - # Video player - pkgs.mpv - # Pdf Viewer - pkgs.zathura - # Power stuff - pkgs.acpi - # Latex stuff - (pkgs.texlive.combine { inherit (pkgs.texlive) scheme-small xifthen ifmtarg framed paralist titling titlesec libertine letltxmacro; }) - pkgs.texmaker - # Other stuff - pkgs.entr - pkgs.gnumake - pkgs.clang - pkgs.neofetch - pkgs.trash-cli - pkgs.nextcloud-client - pkgs.ripgrep - pkgs.fd - ]; - - fonts.fontconfig.enable = true; - - services.gpg-agent = { - enable = true; - defaultCacheTtl = 1800; - enableSshSupport = true; - }; - - systemd.user.services = { - nextcloud-sync = { - Unit = { - Description = "Auto sync Nextcloud"; - After = "network-online.target"; - }; - Service = { - Type = "simple"; - EnvironmentFile = "${config.home.homeDirectory}/.nextcloud.env"; - ExecStart = '' - ${pkgs.nextcloud-client}/bin/nextcloudcmd \ - -h --non-interactive \ - --user "''${NEXTCLOUD_USER}" \ - --password "''${NEXTCLOUD_PASSWORD}" \ - ''${NEXTCLOUD_DIR} \ - ''${NEXTCLOUD_URL} - ''; - TimeoutStopSec = "180"; - KillMode = "process"; - KillSignal = "SIGINT"; - }; - Install.WantedBy = ["multi-user.target"]; - }; - }; - - systemd.user.timers = { - nextcloud-sync = { - Unit.Description = "Automatic sync files with Nextcloud when booted up after 5 minutes then rerun every 10 minutes"; - Timer.OnUnitActiveSec = "10min"; - Install.WantedBy = ["multi-user.target" "timers.target"]; - }; - }; - systemd.user.startServices = true; -} diff --git a/nixpkgs/.config/nixpkgs/hosts.nix b/nixpkgs/.config/nixpkgs/hosts.nix deleted file mode 100644 index 8f21ea8..0000000 --- a/nixpkgs/.config/nixpkgs/hosts.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, pkgs, ... }: - -{ networking.extraHosts = '' -# Your /etc/hosts entries go here -127.0.0.2 other-localhost - -192.168.0.87 art-jr -''; -} diff --git a/nixpkgs/.config/nixpkgs/per-user/kdam0-home/configuration.nix b/nixpkgs/.config/nixpkgs/per-user/kdam0-home/configuration.nix new file mode 100644 index 0000000..903bab8 --- /dev/null +++ b/nixpkgs/.config/nixpkgs/per-user/kdam0-home/configuration.nix @@ -0,0 +1,112 @@ +{ config, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + # Include extra host entries + ./hosts.nix + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "art-sr"; # Define your hostname. + networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + + # Set your time zone. + time.timeZone = "America/Toronto"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "us"; + #useXkbConfig = true; # use xkbOptions in tty. + }; + + nixpkgs.config.allowUnfree = true; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound. + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + wireplumber.enable = true; + media-session.enable = false; + jack.enable = true; + systemWide = false; + }; + + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.kdam0 = { + isNormalUser = true; + extraGroups = [ + "wheel" + "video" + "audio" + "docker" + ]; + shell = pkgs.zsh; + }; + + # List packages installed in system profile. To search, run: + environment.systemPackages = with pkgs; [ + wget + git + rsync + neovim + htop + bmon + alsa-utils + libcamera + docker-buildx + docker-compose + wireguard-tools + ]; + + virtualisation.docker = { + enable = true; + enableOnBoot = true; + rootless = { + enable = true; + setSocketVariable = true; + }; + }; + + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "22.11"; # Did you read the comment? + + nix.settings.experimental-features = ["nix-command" "flakes"]; + + security.polkit.enable = true; + hardware.opengl = { + enable = true; + driSupport = true; + }; + #xdg.portal = { + # enable = true; + # wlr.enable = true; + #}; + #hardware.enableAllFirmware = true; + + services.fwupd.enable = true; +} + diff --git a/nixpkgs/.config/nixpkgs/per-user/kdam0-home/hardware-configuration.nix b/nixpkgs/.config/nixpkgs/per-user/kdam0-home/hardware-configuration.nix new file mode 100644 index 0000000..7911403 --- /dev/null +++ b/nixpkgs/.config/nixpkgs/per-user/kdam0-home/hardware-configuration.nix @@ -0,0 +1,42 @@ +# 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" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/a6261869-4550-462b-8e55-df2473630da4"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/5358-A98A"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/3990180a-8508-4d55-9752-c674b21a48d6"; } + ]; + + # 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s20f0u4.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + # high-resolution display + hardware.video.hidpi.enable = lib.mkDefault true; +} diff --git a/nixpkgs/.config/nixpkgs/per-user/kdam0-home/home.nix b/nixpkgs/.config/nixpkgs/per-user/kdam0-home/home.nix new file mode 100644 index 0000000..a757ccc --- /dev/null +++ b/nixpkgs/.config/nixpkgs/per-user/kdam0-home/home.nix @@ -0,0 +1,174 @@ +{ config, pkgs, libs, ...}: +{ + home.username = "kdam0"; + home.homeDirectory = "/home/kdam0"; + + programs.home-manager.enable = true; + programs.zsh = { + enable = true; + defaultKeymap = "viins"; + initExtra = '' + source ${config.home.homeDirectory}/.p10k.zsh + ''; + shellAliases = { + l = "ls -l"; + ll = "ls -al"; + ".." = "cd .."; + up = "sudo nixos-rebuild switch"; + clean = "sudo nix-collect-garbage -d"; + cdwl = "nvim ~/.config/nixpkgs/common/dwl_4/config.h"; + chm = "nvim ~/.config/nixpkgs/per-user/kdam0-home/home.nix"; + cnix = "nvim ~/.config/nixpkgs/per-user/kdam0-home/configuration.nix"; + gst = "git status"; + v = "nvim $@"; + search = "nix search nixpkgs $@"; + }; + zplug = { + enable = true; + plugins = [ + { name = "zsh-users/zsh-autosuggestions"; } + { name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; } + ]; + }; + }; + programs.tmux = { + enable = true; + clock24 = true; + shell = "${pkgs.zsh}/bin/zsh"; + prefix = "C-a"; + terminal = "screen-256color"; + keyMode = "vi"; + }; + programs.git = { + enable = true; + userName = "Kumar Damani"; + userEmail = "me@kumardamani.net"; + aliases = { + lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; + }; + }; + + + home.stateVersion = "22.11"; + home.packages = [ + # Window environment + (pkgs.dwl.override { + # trying to supply config.home.homeDirectory here leads to "impure" usage. + # so disabling it for now + # conf = (builtins.readFile "${config.home.homeDirectory}/.config/dwl/config.h"); + conf = ../../common/dwl_4/config.h; + }) + pkgs.somebar + pkgs.foot + pkgs.wofi + pkgs.wl-clipboard + pkgs.wf-recorder + pkgs.grim + pkgs.slurp + pkgs.polkit + pkgs.light + pkgs.wbg + # Browsers + pkgs.firefox + pkgs.brave + #pkgs.vivaldi + #pkgs.vivaldi-ffmprg-codecs + # File Managers + pkgs.ranger + pkgs.pcmanfm + pkgs.gvfs + # Image Editor + pkgs.krita + # Fonts + pkgs.nerdfonts + pkgs.hack-font + pkgs.noto-fonts + pkgs.noto-fonts-cjk + # Notifications + pkgs.mako + pkgs.libnotify + # Image viewer + pkgs.imv + # Video player + pkgs.mpv + # Pdf Viewer + pkgs.zathura + # Power stuff + pkgs.acpi + # Latex stuff + (pkgs.texlive.combine { inherit (pkgs.texlive) scheme-small xifthen ifmtarg framed paralist titling titlesec libertine letltxmacro; }) + pkgs.texmaker + # Other stuff + pkgs.entr + pkgs.gnumake + pkgs.clang + pkgs.neofetch + pkgs.trash-cli + pkgs.nextcloud-client + pkgs.ripgrep + pkgs.fd + pkgs.stow + # Comms + pkgs.signal-desktop + #pkgs.mattermost-desktop + pkgs.mutt-wizard + pkgs.isync + pkgs.msmtp + pkgs.pass + pkgs.neomutt + ]; + + fonts.fontconfig.enable = true; + + services.gpg-agent = { + enable = true; + defaultCacheTtl = 1800; + enableSshSupport = true; + }; + + systemd.user.services = { + nextcloud-sync = { + Unit = { + Description = "Auto sync Nextcloud"; + After = "network-online.target"; + }; + Service = { + Type = "simple"; + EnvironmentFile = "${config.home.homeDirectory}/.nextcloud.env"; + ExecStart = '' + ${pkgs.nextcloud-client}/bin/nextcloudcmd \ + -h --non-interactive \ + --user "''${NEXTCLOUD_USER}" \ + --password "''${NEXTCLOUD_PASSWORD}" \ + ''${NEXTCLOUD_DIR} \ + ''${NEXTCLOUD_URL} + ''; + TimeoutStopSec = "180"; + KillMode = "process"; + KillSignal = "SIGINT"; + }; + Install.WantedBy = ["multi-user.target"]; + }; + }; + + systemd.user.timers = { + nextcloud-sync = { + Unit.Description = "Automatic sync files with Nextcloud when booted up after 5 minutes then rerun every 10 minutes"; + Timer.OnUnitActiveSec = "10min"; + Install.WantedBy = ["multi-user.target" "timers.target"]; + }; + }; + systemd.user.startServices = true; + + # Source app specific configs + home.file."bg.sh".source = ../../common/bg.sh; + home.file."start.sh".source = ../../common/start.sh; + home.file.".config/foot/foot.ini".source = ../../common/foot/foot.ini; + home.file.".config/wofi/style.css".source = ../../common/wofi/style.css; + home.file.".config/mako/config".source = ../../common/mako/config; + + #home.file.".config/foot/foot.ini".text = '' + #[colors] + #alpha=0. + #''; +} diff --git a/nixpkgs/.config/nixpkgs/per-user/kdam0-home/hosts.nix b/nixpkgs/.config/nixpkgs/per-user/kdam0-home/hosts.nix new file mode 100644 index 0000000..8f21ea8 --- /dev/null +++ b/nixpkgs/.config/nixpkgs/per-user/kdam0-home/hosts.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ networking.extraHosts = '' +# Your /etc/hosts entries go here +127.0.0.2 other-localhost + +192.168.0.87 art-jr +''; +} diff --git a/nixpkgs/.config/nixpkgs/per-user/kdam0-work/flake.lock b/nixpkgs/.config/nixpkgs/per-user/kdam0-work/flake.lock new file mode 100644 index 0000000..bd81372 --- /dev/null +++ b/nixpkgs/.config/nixpkgs/per-user/kdam0-work/flake.lock @@ -0,0 +1,65 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1680555990, + "narHash": "sha256-Tu/i5sd0hk4c4VtWO8XpY3c9KmHDcOWF5Y2GSCh3LXA=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "d6f3ba090ed090ae664ab5bac329654093aae725", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-22.11", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1680334310, + "narHash": "sha256-ISWz16oGxBhF7wqAxefMPwFag6SlsA9up8muV79V9ck=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "884e3b68be02ff9d61a042bc9bd9dd2a358f95da", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + }, + "utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/nixpkgs/.config/nixpkgs/per-user/kdam0-work/flake.nix b/nixpkgs/.config/nixpkgs/per-user/kdam0-work/flake.nix new file mode 100644 index 0000000..4be5cdb --- /dev/null +++ b/nixpkgs/.config/nixpkgs/per-user/kdam0-work/flake.nix @@ -0,0 +1,31 @@ +{ + description = "Home Manager configuration of kumar"; + + inputs = { + # Specify the source of Home Manager and Nixpkgs. + nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11"; + home-manager = { + url = "github:nix-community/home-manager/release-22.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { nixpkgs, home-manager, ... }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { + homeConfigurations.kdam0 = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + # Specify your home configuration modules here, for example, + # the path to your home.nix. + modules = [ + ./home.nix + ]; + + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + }; + }; +} diff --git a/nixpkgs/.config/nixpkgs/per-user/kdam0-work/home.nix b/nixpkgs/.config/nixpkgs/per-user/kdam0-work/home.nix new file mode 100644 index 0000000..b8a6a72 --- /dev/null +++ b/nixpkgs/.config/nixpkgs/per-user/kdam0-work/home.nix @@ -0,0 +1,113 @@ +{ config, pkgs, libs, ...}: +{ + home.username = "kdam0"; + home.homeDirectory = "/home/kdam0"; + + programs.home-manager.enable = true; + programs.zsh = { + enable = true; + defaultKeymap = "viins"; + initExtra = '' + source ${config.home.homeDirectory}/.p10k.zsh + ''; + shellAliases = { + l = "ls -l"; + ll = "ls -al"; + ".." = "cd .."; + cdwl = "nvim ~/.config/nixpkgs/common/dwl_3/config.h"; + chm = "nvim ~/.config/nixpkgs/per-user/kdam0-work/home.nix"; + gst = "git status"; + v = "nvim $@"; + search = "nix search nixpkgs $@"; + conf = "ranger ~/.config/nixpkgs/common/"; + }; + zplug = { + enable = true; + plugins = [ + { name = "zsh-users/zsh-autosuggestions"; } + { name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; } + ]; + }; + }; + programs.tmux = { + enable = true; + clock24 = true; + shell = "${pkgs.zsh}/bin/zsh"; + prefix = "C-a"; + terminal = "screen-256color"; + keyMode = "vi"; + }; + + home.stateVersion = "22.11"; + home.packages = [ + # Window environment + (pkgs.dwl.override { + # trying to supply config.home.homeDirectory here leads to "impure" usage. + # so disabling it for now + # conf = (builtins.readFile "${config.home.homeDirectory}/.config/dwl/config.h"); + conf = ../../common/dwl_3/config.h; + }) + pkgs.somebar + pkgs.foot + pkgs.wofi + pkgs.wl-clipboard + pkgs.wf-recorder + pkgs.grim + pkgs.slurp + pkgs.polkit + pkgs.light + pkgs.wbg + # Text Editors + pkgs.neovim + # Browsers + pkgs.firefox + pkgs.brave + # File Managers + pkgs.ranger + pkgs.pcmanfm + pkgs.gvfs + # Fonts + pkgs.nerdfonts + pkgs.hack-font + # Notifications + pkgs.mako + pkgs.libnotify + # Image viewer + pkgs.imv + # Video player + pkgs.mpv + # Pdf Viewer + pkgs.zathura + # Power stuff + pkgs.acpi + # Other stuff + pkgs.gnumake + pkgs.clang + pkgs.neofetch + pkgs.trash-cli + pkgs.nextcloud-client + pkgs.ripgrep + pkgs.fd + ]; + + fonts.fontconfig.enable = true; + + services.gpg-agent = { + enable = true; + defaultCacheTtl = 1800; + enableSshSupport = true; + }; + + # Source app specific configs + home.file."bg.sh".source = ../../common/bg.sh; + home.file."start.sh".source = ../../common/start.sh; + home.file.".config/foot/foot.ini".source = ../../common/foot/foot.ini; + home.file.".config/wofi/style.css".source = ../../common/wofi/style.css; + home.file.".config/mako/config".source = ../../common/mako/config; + + #home.file.".config/foot/foot.ini".text = '' + #[colors] + #alpha=0.7 + #''; +} + diff --git a/start.sh b/start.sh deleted file mode 100755 index db88d91..0000000 --- a/start.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# This a sort-of auto-start script. -# Run this from a tty to start my graphical env. - -# don't need it anymore? -#echo $(id -u) -#export XDG_RUNTIME_DIR=/tmp/xdg-runtime-$(id -u) -#mkdir -p $XDG_RUNTIME_DIR -#echo $XDG_RUNTIME_DIR - -export EDITOR=nvim - -exec dwl -s 'somebar' & -#exec sway & - -# set blocks on bar -exec /usr/local/bin/someblocks & - -# give wayland session some time to init -sleep 1 - -# set bg -exec ./bg.sh & - diff --git a/wofi/.config/wofi/style.css b/wofi/.config/wofi/style.css deleted file mode 100644 index e91d682..0000000 --- a/wofi/.config/wofi/style.css +++ /dev/null @@ -1,57 +0,0 @@ -#entry { - border-radius: 3px; - padding: 2px 3px 2px 3px; -} - -#entry:selected { - background-color: #5e81ac; -} - -#text:selected { - color: #d8dee9; -} - -#window { - padding: 2px; - background-color: rgba(53, 59, 73, 0.97); - border: 3px solid #3b4252; - border-radius: 2px; - font-family: 'Inter Nerd Font','FuraCode Nerd Font Mono'; - font-size: 48px; -} - -#input { - border: 2px solid #5e81ac; - background-color: #4c566a; - color: #d8dee9; - padding: 3px 5px 3px 5px; - border-radius: 5px; -} - -#inner-box { - color: #d8dee9; - padding: 2px; - background-color: transparent; -} - -#outer-box { - margin: 15px; - background-color: transparent; -} - -#scroll { - margin-top: 10px; - background-color: transparent; - border: none; -} - -#text { - padding: 3px; - background-color: transparent; -} - -#img { - background-color: transparent; - padding: 5px; -} - -- cgit v1.2.3