diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 5cccfa8..b224a1a 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -12,6 +12,9 @@ sha256 = "sha256:1d03a0wb710by1m2c3rx758vy67f8r71gnv2h3qn4jj1bx10sdg4"; }}/module.nix" ./disko.nix + + ./firewall.nix + ./kanata.nix ]; boot.loader.systemd-boot.enable = true; diff --git a/nixos/firewall.nix b/nixos/firewall.nix new file mode 100644 index 0000000..c985ae3 --- /dev/null +++ b/nixos/firewall.nix @@ -0,0 +1,40 @@ +{ + config, + lib, + pkgs, + ... +}: { + networking.firewall = { + enable = true; + # https://docs.syncthing.net/users/firewall.html + allowedTCPPorts = [ + # Syncthing + 8384 + 22000 + ]; + allowedUDPPorts = [ + # Syncthing + 22000 + 21027 + ]; + allowedTCPPortRanges = [ + # KDE Connect + { + from = 1714; + to = 1764; + } + ]; + allowedUDPPortRanges = [ + # KDE Connect + { + from = 1714; + to = 1764; + } + # Mosh + { + from = 60000; + to = 61000; + } + ]; + }; +} diff --git a/nixos/kanata.nix b/nixos/kanata.nix new file mode 100644 index 0000000..91f1aca --- /dev/null +++ b/nixos/kanata.nix @@ -0,0 +1,80 @@ +{ + config, + lib, + pkgs, + ... +}: { + services.kanata.enable = true; + services.kanata.keyboards.mykbd.config = '' + + (defsrc + ;; grv 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w f p b j l u y ' [ ] + caps a r s t g m n e i o + lsft z x c d v k h , . / + lctl lmet lalt spc ret ; + ) + + (deflayer default + ;;tab q w f d b j l u y ' [ ] + _ _ _ _ _ _ _ _ _ _ _ _ _ + ;;caps a r s t g m n e i o + _ _ _ @chs @cht _ _ _ _ _ _ + ;;lsft z x c d v k h , . / + _ _ _ _ _ _ _ _ _ _ _ + ;;lctl lmet lalt spc ret ; + _ _ _ @chspc @chret _ + ) + + (deflayer arrows + ;;tab q w f p b j l u y ' [ ] + XX XX XX XX XX XX XX XX XX XX XX XX XX + ;;caps a r s t g m n e i o + XX XX XX XX XX XX left down up rght XX + ;;lsft z x c d v k h , . / + XX XX XX XX XX XX XX XX XX XX XX + ;;lctl lmet lalt spc ret ; + XX XX XX XX XX XX + ) + + (deflayer num + ;;tab q w f p b j l u y ' [ ] + XX XX XX XX XX XX XX 7 8 9 XX XX XX + ;;caps a r s t g m n e i o + XX XX XX XX XX XX XX 4 5 6 XX + ;;lsft z x c d v k h , . / + XX XX XX XX XX XX XX 1 2 3 XX + ;;lctl lmet lalt spc ret ; + XX XX XX XX XX 0 + ) + + (deflayer misc + ;;tab q w f p b j l u y ' [ ] + XX S-1 S-2 S-3 S-4 S-5 S-6 S-7 S-8 S-9 XX XX XX + ;;caps a r s t g m n e i o + XX XX XX XX XX XX XX [ S-[ XX XX + ;;lsft z x c d v k h , . / + XX XX XX XX XX XX XX ] S-] XX XX + ;;lctl lmet lalt spc ret ; + XX XX XX XX XX XX + ) + (defalias + num (layer-while-held num) + arrows (layer-while-held arrows) + misc (layer-while-held misc) + cht (chord example t) + chs (chord example s) + chspc (chord example spc) + chret (chord example ret) + ) + (defchords example 500 + (t) t + (s) s + (spc) spc + (ret) ret + (spc s) @num + (spc t) @arrows + (spc ret) @misc + ) + ''; +}