diff --git a/modules/kanata/conf.kbd b/modules/kanata/conf.kbd deleted file mode 100644 index c4638a1..0000000 --- a/modules/kanata/conf.kbd +++ /dev/null @@ -1,146 +0,0 @@ -(defcfg - process-unmapped-keys yes - block-unmapped-keys yes - concurrent-tap-hold yes - movemouse-smooth-diagonals yes -) - -(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 -) - -(defvar - tap-time 200 - hold-time 250 - chord-time 50 -) - -(defalias - normie (layer-switch norm) - - chw (chord ch w) - che (chord ch e) - chi (chord ch i) - cho (chord ch o) - chs (chord ch s) - chd (chord ch d) - chf (chord ch f) - chj (chord ch j) - chk (chord ch k) - chl (chord ch l) - ch_lalt (chord ch lalt) - ch_ralt (chord ch ralt) - - hyper (multi lmet lsft lctl lalt) - meh (multi lsft lctl lalt) - - navlayer (layer-while-held nav) - caps (tap-hold $tap-time $hold-time (tap-dance 200 ((multi @hyper d) @hyper caps)) @navlayer) - - 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-while-held num) - g (tap-hold $tap-time $hold-time g @numpad) - - fnkeys (layer-while-held fn) - h (tap-hold $tap-time $hold-time h @fnkeys) - - v (tap-hold $tap-time $hold-time v @meh) - m (tap-hold $tap-time $hold-time m (multi lsft lctl lalt)) - - symbols (layer-while-held symbol) - spc (tap-hold $tap-time $hold-time spc @symbols) - - medialy (layer-while-held md) - z (tap-hold $tap-time $hold-time z @medialy) - / (tap-hold $tap-time $hold-time / @medialy) -) - -(defchords ch $chord-time - (w ) w - ( e) e - (w e) XX - (i ) i - ( o) o - (i o) XX - (s ) @s - ( d) @d - (s d) ret - (f ) @f - (f d) tab - (j ) @j - (j k) esc - (k ) @k - ( l) @l - (k l) bspc - (lalt ) (tap-dance $tap-time ((multi lsft lctl lalt lmet) lalt)) - ( ralt) (tap-dance $tap-time ((multi lsft lctl lalt lmet) lalt)) - (lalt ralt) (tap-hold $tap-time $hold-time @normie (layer-switch base)) -) - -(deflayer base - @caps - q @chw @che r t y u @chi @cho p - @a @chs @chd @chf @g @h @chj @chk @chl @scln - @z x c @v b n @m , . @/ - @ch_lalt @spc @ch_ralt -) - -(deflayer nav - _ - mbck (movemouse-up 3 2) mfwd _ _ _ mlft mrgt (mwheel-up 50 120) (mwheel-down 50 120) - (movemouse-left 3 2) (movemouse-down 3 2) (movemouse-right 3 2) _ home left down up right end - _ _ _ _ _ _ _ _ _ _ - _ _ _ -) - -(deflayer num - _ - _ _ _ _ _ _ 7 8 9 _ - _ _ _ _ _ _ 4 5 6 0 _ - _ _ _ _ _ 1 2 3 _ - _ _ _ -) - -(deflayer fn - _ - f1 f2 f3 f4 _ _ _ _ _ _ - f5 f6 f7 f8 _ _ _ _ _ _ _ - f9 f10 f11 f12 _ _ _ _ _ - _ _ _ -) - -(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-] S-, S-. [ ] _ _ - _ _ _ -) - -(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 -) - -(deflayer md - _ - _ _ _ _ _ _ _ _ _ _ - prev pp next mute _ _ vold volu brdn brup - _ _ _ _ _ _ _ _ _ _ - _ _ _ -) diff --git a/flake.lock b/nix/flake.lock similarity index 100% rename from flake.lock rename to nix/flake.lock diff --git a/flake.nix b/nix/flake.nix similarity index 100% rename from flake.nix rename to nix/flake.nix diff --git a/nix/hosts/cantor/configuration.nix b/nix/hosts/cantor/configuration.nix new file mode 100644 index 0000000..6a167b1 --- /dev/null +++ b/nix/hosts/cantor/configuration.nix @@ -0,0 +1,18 @@ +{ config, pkgs, lib, inputs, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ../../modules/kanata/kanata.nix + ../../modules/laptop.nix + ../../modules/efi.nix + ../../modules/hypr.nix + ../../modules/syncthing.nix + ]; + + networking.hostName = "cantor"; + # Overriding this, as the touchpad doesn't work properly anymore. + services.libinput.enable = lib.mkForce false; + system.stateVersion = "25.05"; +} diff --git a/nix/hosts/cantor/hardware-configuration.nix b/nix/hosts/cantor/hardware-configuration.nix new file mode 100644 index 0000000..9da5aeb --- /dev/null +++ b/nix/hosts/cantor/hardware-configuration.nix @@ -0,0 +1,46 @@ +# 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" "ahci" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/b6a3dc2d-983b-4be5-a1ae-e834b786377f"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/12CE-A600"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + fileSystems."/data/hdd" = + { device = "/dev/disk/by-uuid/8db7c071-8946-4619-96fd-83259ae8d228"; + fsType = "xfs"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/222e2b22-388c-490a-845f-35f774c395a8"; } + ]; + + # 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.enp4s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/common.nix b/nix/hosts/common.nix similarity index 98% rename from hosts/common.nix rename to nix/hosts/common.nix index 8e58d4f..655fff2 100644 --- a/hosts/common.nix +++ b/nix/hosts/common.nix @@ -56,8 +56,6 @@ programs.zsh.enable = true; # Browser programs.firefox.enable = true; - # Direnv - programs.direnv.enable = true; # Flatpak # services.flatpak.enable = true; # Tailscale diff --git a/hosts/dotfiles/emacs.d/init.el b/nix/hosts/dotfiles/.emacs.d/init.el similarity index 100% rename from hosts/dotfiles/emacs.d/init.el rename to nix/hosts/dotfiles/.emacs.d/init.el diff --git a/hosts/dotfiles/ghostty/config b/nix/hosts/dotfiles/ghostty/config similarity index 100% rename from hosts/dotfiles/ghostty/config rename to nix/hosts/dotfiles/ghostty/config diff --git a/hosts/dotfiles/hypr/bg.jpg b/nix/hosts/dotfiles/hypr/bg.jpg similarity index 100% rename from hosts/dotfiles/hypr/bg.jpg rename to nix/hosts/dotfiles/hypr/bg.jpg diff --git a/hosts/dotfiles/hypr/hyprland.conf b/nix/hosts/dotfiles/hypr/hyprland.conf similarity index 100% rename from hosts/dotfiles/hypr/hyprland.conf rename to nix/hosts/dotfiles/hypr/hyprland.conf diff --git a/hosts/dotfiles/hypr/start.sh b/nix/hosts/dotfiles/hypr/start.sh similarity index 100% rename from hosts/dotfiles/hypr/start.sh rename to nix/hosts/dotfiles/hypr/start.sh diff --git a/hosts/dotfiles/mpv/mpv.conf b/nix/hosts/dotfiles/mpv/mpv.conf similarity index 100% rename from hosts/dotfiles/mpv/mpv.conf rename to nix/hosts/dotfiles/mpv/mpv.conf diff --git a/hosts/dotfiles/neofetch/config.conf b/nix/hosts/dotfiles/neofetch/config.conf similarity index 100% rename from hosts/dotfiles/neofetch/config.conf rename to nix/hosts/dotfiles/neofetch/config.conf diff --git a/hosts/dotfiles/nvim/init.lua b/nix/hosts/dotfiles/nvim/init.lua similarity index 100% rename from hosts/dotfiles/nvim/init.lua rename to nix/hosts/dotfiles/nvim/init.lua diff --git a/hosts/dotfiles/waybar/config b/nix/hosts/dotfiles/waybar/config similarity index 100% rename from hosts/dotfiles/waybar/config rename to nix/hosts/dotfiles/waybar/config diff --git a/hosts/dotfiles/waybar/style.css b/nix/hosts/dotfiles/waybar/style.css similarity index 100% rename from hosts/dotfiles/waybar/style.css rename to nix/hosts/dotfiles/waybar/style.css diff --git a/hosts/home.nix b/nix/hosts/home.nix similarity index 98% rename from hosts/home.nix rename to nix/hosts/home.nix index b24adb0..e3b7618 100644 --- a/hosts/home.nix +++ b/nix/hosts/home.nix @@ -137,7 +137,7 @@ # Neovim ".config/nvim/init.lua" .source = dotfiles/nvim/init.lua; # Emacs - ".emacs.d/init.el" .source = dotfiles/emacs.d/init.el; + ".emacs.d/init.el" .source = dotfiles/.emacs.d/init.el; # MPV ".config/mpv/mpv.conf" .source = dotfiles/mpv/mpv.conf; # Neofetch diff --git a/hosts/kirigiri/configuration.nix b/nix/hosts/kirigiri/configuration.nix similarity index 100% rename from hosts/kirigiri/configuration.nix rename to nix/hosts/kirigiri/configuration.nix diff --git a/hosts/kirigiri/hardware-configuration.nix b/nix/hosts/kirigiri/hardware-configuration.nix similarity index 100% rename from hosts/kirigiri/hardware-configuration.nix rename to nix/hosts/kirigiri/hardware-configuration.nix diff --git a/modules/efi.nix b/nix/modules/efi.nix similarity index 100% rename from modules/efi.nix rename to nix/modules/efi.nix diff --git a/modules/hypr.nix b/nix/modules/hypr.nix similarity index 100% rename from modules/hypr.nix rename to nix/modules/hypr.nix diff --git a/nix/modules/kanata/conf.kbd b/nix/modules/kanata/conf.kbd new file mode 100644 index 0000000..6b13055 --- /dev/null +++ b/nix/modules/kanata/conf.kbd @@ -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 + _ _ _ _ _ _ _ _ _ _ + _ _ _ +) \ No newline at end of file diff --git a/modules/kanata/kanata.nix b/nix/modules/kanata/kanata.nix similarity index 100% rename from modules/kanata/kanata.nix rename to nix/modules/kanata/kanata.nix diff --git a/modules/laptop.nix b/nix/modules/laptop.nix similarity index 100% rename from modules/laptop.nix rename to nix/modules/laptop.nix diff --git a/modules/syncthing.nix b/nix/modules/syncthing.nix similarity index 100% rename from modules/syncthing.nix rename to nix/modules/syncthing.nix diff --git a/modules/virt.nix b/nix/modules/virt.nix similarity index 100% rename from modules/virt.nix rename to nix/modules/virt.nix