moved around dotfiles to focus around nix configuration, as most of my systems already utilize Nix/NixOS in some capacity.
This commit is contained in:
parent
eb01c9561f
commit
890c29afca
28 changed files with 47 additions and 255 deletions
8
nix/modules/efi.nix
Executable file
8
nix/modules/efi.nix
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
{ config, pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
# SystemD-boot is good enough
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
systemd.tpm2.enable = false;
|
||||
}
|
||||
25
nix/modules/hypr.nix
Executable file
25
nix/modules/hypr.nix
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
{ config, pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
# Hyprland looks nice so I'm using it
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
withUWSM = true;
|
||||
xwayland.enable = true;
|
||||
};
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
xdg.portal.enable = true;
|
||||
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
waybar # Status bar
|
||||
libnotify # Desktop notifications
|
||||
swww # Wallpaper manager
|
||||
brightnessctl # For laptop backlight brightness control
|
||||
grim # screenshot utility
|
||||
slurp # select utility
|
||||
wl-clipboard # xclip alternative
|
||||
rofi-wayland # Dmenu replacement for Wayland
|
||||
ghostty # Terminal emulator
|
||||
];
|
||||
}
|
||||
164
nix/modules/kanata/conf.kbd
Executable file
164
nix/modules/kanata/conf.kbd
Executable file
|
|
@ -0,0 +1,164 @@
|
|||
#|
|
||||
Kanata Config
|
||||
○ Ergonomic (kinda?) 34-key QWERTY layout
|
||||
○ GACS home-row mods
|
||||
○ Layers for function, number, media, and symbol keys
|
||||
○ Dedicated (and non-intrusive!) standard layout toggle for reliant tasks
|
||||
○ Decently commented for beginners and seasoned veterans alike.
|
||||
|
||||
FEEL FREE TO FORK!!!
|
||||
|#
|
||||
(defcfg
|
||||
concurrent-tap-hold yes
|
||||
movemouse-smooth-diagonals yes
|
||||
)
|
||||
#|
|
||||
Trying to be minimal in order to reduce constant editing
|
||||
of layer keys, not to mention how ugly having a 60% layout
|
||||
is when you have mapped keys in the grid.
|
||||
|#
|
||||
(defsrc
|
||||
caps
|
||||
q w e r t y u i o p
|
||||
a s d f g h j k l scln
|
||||
z x c v b n m , . /
|
||||
lalt spc ralt
|
||||
)
|
||||
;; Variables for clean code
|
||||
(defvar
|
||||
tap-time 200
|
||||
hold-time 250
|
||||
chord-time 50
|
||||
)
|
||||
;; Bindings
|
||||
(defalias
|
||||
;; Normal keyboard layer for gaming/other normie usage
|
||||
normie (layer-switch norm)
|
||||
;; Key chord definitions
|
||||
chw (chord ch w)
|
||||
che (chord ch e)
|
||||
chi (chord ch i)
|
||||
cho (chord ch o)
|
||||
chs (chord ch s)
|
||||
chd (chord ch d)
|
||||
chk (chord ch k)
|
||||
chl (chord ch l)
|
||||
ch_lalt (chord ch lalt)
|
||||
ch_ralt (chord ch ralt)
|
||||
;; Remap Caps to Escape/Nav layer
|
||||
navlayer (layer-while-held nav)
|
||||
caps (tap-hold $tap-time $hold-time (tap-dance 200 (esc caps)) @navlayer)
|
||||
;; Home row mods
|
||||
a (tap-hold $tap-time $hold-time a lmet)
|
||||
s (tap-hold $tap-time $hold-time s lalt)
|
||||
d (tap-hold $tap-time $hold-time d lctl)
|
||||
f (tap-hold $tap-time $hold-time f lsft)
|
||||
j (tap-hold $tap-time $hold-time j rsft)
|
||||
k (tap-hold $tap-time $hold-time k lctl)
|
||||
l (tap-hold $tap-time $hold-time l lalt)
|
||||
scln (tap-hold $tap-time $hold-time scln rmet)
|
||||
;; Numpad layer
|
||||
numpad (layer-while-held num)
|
||||
g (tap-hold $tap-time $hold-time g @numpad)
|
||||
;; Function key layer
|
||||
fnkeys (layer-while-held fn)
|
||||
h (tap-hold $tap-time $hold-time h @fnkeys)
|
||||
#|
|
||||
Hyper key when V or M are held down to allow for either hand to
|
||||
use hyper key for AHK/Raycast shortcuts.
|
||||
|#
|
||||
v (tap-hold $tap-time $hold-time v (multi lsft lctl lalt))
|
||||
m (tap-hold $tap-time $hold-time m (multi lsft lctl lalt))
|
||||
;; Holding Spacebar activates symbol layer
|
||||
symbols (layer-while-held symbol)
|
||||
spc (tap-hold $tap-time $hold-time spc @symbols)
|
||||
;; Media layer when Z or / are held.
|
||||
medialy (layer-while-held md)
|
||||
z (tap-hold $tap-time $hold-time z @medialy)
|
||||
/ (tap-hold $tap-time $hold-time / @medialy)
|
||||
)
|
||||
;; Chord definitions. Kind of weird to read as a layperson
|
||||
;; so I provided sufficient comments for general understanding.
|
||||
(defchords ch $chord-time
|
||||
(w ) w ;; W => W
|
||||
( e) e ;; E => E
|
||||
(w e) ret ;; W + E => Enter
|
||||
(i ) i ;; I => I
|
||||
( o) o ;; O => O
|
||||
(i o) bspc ;; I + O => Backspace
|
||||
(s ) @s ;; S => S
|
||||
( d) @d ;; D => D
|
||||
(s d) tab ;; S + D => Tab
|
||||
(k ) @k ;; K => K (See defalias)
|
||||
( l) @l ;; L => L (See defalias)
|
||||
(k l) esc ;; K + L => Escape
|
||||
(lalt ) (tap-dance $tap-time ((multi lsft lctl lalt lmet) lalt)) ;; LAlt => Hyper Key, LAlt × 2 => LAlt
|
||||
( ralt) (tap-dance $tap-time ((multi lsft lctl lalt lmet) lalt)) ;; RAlt => Hyper Key, RAlt × 2 => RAlt
|
||||
#|
|
||||
Put simply, the below line allows for toggling a no-bind
|
||||
layer for when you may require a standard layout (such as
|
||||
playing Street Fighter, Counter Strike, etc.) by pressing
|
||||
both alt keys at the same time. You can toggle back to the
|
||||
base layer by holding both alts at the same time, as to allow
|
||||
for normal functionality when holding either key down for a shortcut.
|
||||
|#
|
||||
(lalt ralt) (tap-hold $tap-time $hold-time @normie (layer-switch base))
|
||||
)
|
||||
;; Base layer with all binds enabled
|
||||
(deflayer base
|
||||
@caps
|
||||
q @chw @che r t y u @chi @cho p
|
||||
@a @chs @chd @f @g @h @j @chk @chl @scln
|
||||
@z x c @v b n @m , . @/
|
||||
@ch_lalt @spc @ch_ralt
|
||||
)
|
||||
;; Navigation layer
|
||||
(deflayer nav
|
||||
_
|
||||
mbck (movemouse-up 3 3) mfwd _ _ _ mlft mrgt pgup pgdn
|
||||
(movemouse-left 3 3) (movemouse-down 3 3) (movemouse-right 3 3) _ home left down up right end
|
||||
_ _ _ _ _ _ _ _ _ _
|
||||
_ _ _
|
||||
)
|
||||
;; Numpad Layer
|
||||
(deflayer num
|
||||
_
|
||||
_ _ _ _ _ _ 7 8 9 _
|
||||
_ _ _ _ _ _ 4 5 6 0 _
|
||||
_ _ _ _ _ 1 2 3 _
|
||||
_ _ _
|
||||
)
|
||||
;; Function key layer
|
||||
(deflayer fn
|
||||
_
|
||||
f1 f2 f3 f4 _ _ _ _ _ _
|
||||
f5 f6 f7 f8 _ _ _ _ _ _ _
|
||||
f9 f10 f11 f12 _ _ _ _ _
|
||||
_ _ _
|
||||
)
|
||||
;; Symbol layer
|
||||
(deflayer symbol
|
||||
_
|
||||
S-1 S-2 S-3 S-4 S-5 S-6 S-7 S-8 S-9 S-0
|
||||
- S-= S-[ S-] [ ] S-` S-scln S-\ \
|
||||
= _ _ ` _ S-- _ _ ' S-'
|
||||
_ _ _
|
||||
)
|
||||
;; Aformentioned standard layer with combo binds for toggling back
|
||||
;; to base layer.
|
||||
(deflayer norm
|
||||
esc
|
||||
q w e r t y u i o p
|
||||
a s d f g h j k l scln
|
||||
z x c v b n m , . /
|
||||
@ch_lalt spc @ch_ralt
|
||||
)
|
||||
;; Media layer
|
||||
;; NOTE: On Windows the brdn and brup keys cause Kanata to crash for some reason as of kanata_gui 1.8.1
|
||||
(deflayer md
|
||||
_
|
||||
_ _ _ _ _ _ _ _ _ _
|
||||
prev pp next mute vold volu brdn brup ins del
|
||||
_ _ _ _ _ _ _ _ _ _
|
||||
_ _ _
|
||||
)
|
||||
32
nix/modules/kanata/kanata.nix
Executable file
32
nix/modules/kanata/kanata.nix
Executable file
|
|
@ -0,0 +1,32 @@
|
|||
{ config, libs, pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
# Kanata setup
|
||||
# Mostly copied from https://dev.to/shanu-kumawat/how-to-set-up-kanata-on-nixos-a-step-by-step-guide-1jkc
|
||||
boot.kernelModules = [ "uinput" ]; # Enable uinput kernel module
|
||||
hardware.uinput.enable = true; # Enable uinput
|
||||
# Set up udev rules for uinput
|
||||
services.udev.extraRules = ''
|
||||
KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"
|
||||
'';
|
||||
users.groups.uinput = { }; # ensure uinput group exists
|
||||
# Add Kanata service user to necessary groups
|
||||
systemd.services.kanata-internalKeyboard.serviceConfig = {
|
||||
SupplementaryGroups = [
|
||||
"input"
|
||||
"uinput"
|
||||
];
|
||||
};
|
||||
# Kanata configuration
|
||||
services.kanata = {
|
||||
enable = true;
|
||||
keyboards = {
|
||||
internalKeyboard = {
|
||||
devices = [
|
||||
"/dev/input/by-path/platform-i8042-serio-0-event-kbd"
|
||||
];
|
||||
configFile = ./conf.kbd;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
36
nix/modules/laptop.nix
Executable file
36
nix/modules/laptop.nix
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
{ config, lib, pkgs, inputs, ...}:
|
||||
|
||||
{
|
||||
services.libinput.enable = true; # for laptop touchpad
|
||||
# Laptop battery optimizations
|
||||
services.tlp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
||||
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
||||
|
||||
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
||||
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||||
|
||||
CPU_MIN_PERF_ON_AC = 0;
|
||||
CPU_MAX_PERF_ON_AC = 100;
|
||||
CPU_MIN_PERF_ON_BAT = 0;
|
||||
CPU_MAX_PERF_ON_BAT = 20;
|
||||
|
||||
START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge
|
||||
STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging
|
||||
};
|
||||
};
|
||||
services.auto-cpufreq.enable = true;
|
||||
services.auto-cpufreq.settings = {
|
||||
battery = {
|
||||
governor = "powersave";
|
||||
turbo = "never";
|
||||
};
|
||||
charger = {
|
||||
governor = "performance";
|
||||
turbo = "auto";
|
||||
};
|
||||
};
|
||||
powerManagement.powertop.enable = true;
|
||||
}
|
||||
11
nix/modules/syncthing.nix
Executable file
11
nix/modules/syncthing.nix
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
{ config, pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
user = "lunita";
|
||||
group = "syncthing";
|
||||
dataDir = "/home/lunita/Sync";
|
||||
configDir = "/home/lunita/.config/syncthing";
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue