diff --git a/modules/networking.nix b/modules/networking.nix index c86756b..bf7503d 100644 --- a/modules/networking.nix +++ b/modules/networking.nix @@ -19,7 +19,8 @@ # So to not dox myself this config file is hardcoded rekey.secrets.enp0s20f0u2u4 = { file = ../secrets/koreaIP.age; - path = "/etc/systemd/network/enp0s20f0u2u4.network"; + path = "/etc/systemd/network/10-enp0s20f0u2u4.network"; + mode = "444"; }; services.resolved = { enable = true; diff --git a/secrets/koreaIP.age b/secrets/koreaIP.age index 2215a5e..ad18e9b 100644 --- a/secrets/koreaIP.age +++ b/secrets/koreaIP.age @@ -1,14 +1,13 @@ age-encryption.org/v1 --> X25519 3J4C1gErVk61rhDZ2V8wNRQhOz4gZQ+kUnF0w4bacTM -e6YK/xDjXtTTJL5wSbZ+xzhuGodu2OJeTw3u4hJ2Oik --> piv-p256 XTQkUA A0GdsIHUCWBXggnSZj0XGHDQk3OsTH9WB7nNzhZJnwj/ -j5bCq50HjIqPp1jTsyX6WfEBNooyq8ovMkYEzrn33CQ --> piv-p256 ZFgiIw AkhhWD/yOroM1ttX1PNAi6Fss1Nqm7pJHB4micU5IfsI -kTB28H46jvtCYF7u7PoN02kQof41ycuZbSQh6UWz57Y --> "\s0YT#-grease 3YP75@. -aqpRxhJHTMQsvjgPW1bqZSD7YgOX9fw+VNUW+KURv6cV+gLYZeoecFruJXchA60E -9efPuI8vUfNxmYzPQChsqxqDdzwc5wg0u+ZrwSaz ---- M/B7EHfz8B63cqQ/zQwO64Pqo5ewYx2nqBoLZdtuGbY -$M:-u/6[PеЉXH&̝͢w/^~*Q޾-v`8 X25519 PLUAL+hWRS3OD8ImxBUoRt9kX9dUkZaqW25fTbOtnAI +zhT1ya1g6WlGahW0GUwsILumC1APvk0dTluzwh490Os +-> piv-p256 XTQkUA AuPSCNGUN4fg8FMqDNrDhU7WEmzAZgEgWBl+IFuDJfNO +TXkyWp7UOiIz3fmzJe5DXrG5WJKNnoaKQnCk/RseiMw +-> piv-p256 ZFgiIw A5tAnf15c/eAEMxnunVr3AiZ//ERgcSQVqBwv5DNU3XV +ybrErVyofg6SMKhYkmx+xEVjTEVGqWlwFmWCFCS5Wyw +-> Qkg@hYz-grease c0A[ ԈEP&҄-ZA"RsKpyOk:x +{!ra ۠6ga(p|_J#}'Sr#/bޑ \ No newline at end of file diff --git a/users/common/shells/zsh.nix b/users/common/shells/zsh.nix index 1be3874..0c660af 100644 --- a/users/common/shells/zsh.nix +++ b/users/common/shells/zsh.nix @@ -15,16 +15,17 @@ enable = true; dotDir = ".config/zsh"; initExtra = lib.mkAfter ('' - function atuin-prefix-search() { - if out=$(${pkgs.sqlite}/bin/sqlite3 -readonly ~/.local/share/atuin/history.db \ - 'SELECT command FROM history WHERE command LIKE cast('"x'$(str_to_hex "$_atuin_search_prefix")'"' as text) || "%" ORDER BY timestamp DESC LIMIT 1 OFFSET '"$_atuin_search_offset"); then - [[ -z "$out" ]] && return 1 - BUFFER=$out - else - return 1 - fi + function atuin-prefix-search() { + if out=$(${pkgs.sqlite}/bin/sqlite3 -readonly ~/.local/share/atuin/history.db \ + 'SELECT command FROM history WHERE command LIKE cast('"x'$(str_to_hex "$_atuin_search_prefix")'"' as text) ||\ + "%" ORDER BY timestamp DESC LIMIT 1 OFFSET '"$_atuin_search_offset"); then + [[ -z "$out" ]] && return 1 + BUFFER=$out + else + return 1 + fi - }; zle -N atuin-prefix-search + }; zle -N atuin-prefix-search '' + (builtins.readFile ../../../data/zsh/zshrc)); plugins = [ diff --git a/users/common/touchegg.nix b/users/common/touchegg-module.nix similarity index 51% rename from users/common/touchegg.nix rename to users/common/touchegg-module.nix index 2d39ae5..c2f4193 100644 --- a/users/common/touchegg.nix +++ b/users/common/touchegg-module.nix @@ -1,11 +1,15 @@ { + config, pkgs, lib, ... }: with lib; let - cfg = config.programs.touchegg; - + # + # GESTURES + # + # each on has a member type as a single entry enum + # to be able to definitely distinguish them # common options fingers = mkOption { type = types.ints.between 2 5; @@ -20,6 +24,13 @@ with lib; let # Submodules for the different gestures swipe_gesture = types.submodule { inherit fingers; + type = mkOption { + type = types.enum ["swipe"]; + description = '' + Type of gesture to perform + ''; + default = ""; + }; direction = mkOption { type = types.enum ["UP" "DOWN" "LEFT" "RIGHT"]; @@ -32,6 +43,13 @@ with lib; let pinch_gesture = types.submodule { inherit fingers; + type = mkOption { + type = types.enum ["pinch"]; + description = '' + Type of gesture to perform + ''; + default = ""; + }; direction = mkOption { type = types.enum ["IN" "OUT"]; @@ -44,8 +62,19 @@ with lib; let tap_gesture = types.submodule { inherit fingers; + type = mkOption { + type = types.enum ["tap"]; + description = '' + Type of gesture to perform + ''; + default = ""; + }; }; + # + # ACTIONS + # + # common options animate = mkOption { type = tyes.bool; @@ -56,7 +85,7 @@ with lib; let }; color = mkOption { - type = type.str; + type = types.str; description = '' hex value of the animation color ''; @@ -65,7 +94,7 @@ with lib; let }; borderColor = mkOption { - type = type.str; + type = types.str; description = '' hex value of the color of the animation border @@ -78,8 +107,6 @@ with lib; let inherit animate color borderColor; }; - # Submodules for the actions performed - # by gestures maximize_restore_window = { inherit animation_common_options; }; @@ -121,7 +148,11 @@ with lib; let "auto" ]; description = '' - The desktop/workspace to switch to. It is recommended to use previous/next for better compatibility. However, some desktop environments, like KDE, allow to configure a grid of desktops and up/down/left/right come in handy. With SWIPE gestures, auto will use your natural scroll preferences to figure out the direction. + The desktop/workspace to switch to. + It is recommended to use previous/next for better compatibility. + However, some desktop environments, like KDE, + allow to configure a grid of desktops and up/down/left/right come in handy. + With SWIPE gestures, auto will use your natural scroll preferences to figure out the direction. ''; default = "auto"; example = "next"; @@ -255,6 +286,7 @@ with lib; let }; mouse_click = { + inherit on; button = mkOption { type = types.enum ["left" "right" "middle"]; description = '' @@ -262,15 +294,6 @@ with lib; let ''; example = "left"; }; - - on = mkOption { - type = types.enum ["begin" "end"]; - description = '' - If the command should be executed on the beginning or on the end of the gesture. - ''; - default = "end"; - example = "begin"; - }; }; gestureModule = let @@ -281,32 +304,11 @@ with lib; let ''; in types.submodule { - options = { + gestures = mkOption { # hopefully this works it not # because of submodule weirdness - - swipe_gesture = mkOption { - type = types.listOf swipe_gesture; - description = helpStr; - default = []; - }; - - pinch_gesture = mkOption { - type = types.listOf pinch_gesture; - description = helpStr; - default = []; - }; - - tap_gesture = mkOption { - type = types.listOf tap_gesture; - description = helpStr; - default = []; - }; - - description = '' - the type of gesture - ''; - + type = types.enum [swipe_gesture pinch_gesture tap_gesture]; + description = helpStr; example = ""; # TODO }; @@ -321,6 +323,7 @@ with lib; let }; in { options.programs.touchegg = { + inherit color borderColor; enable = mkEnableOption "Touch gesture daemon"; animation_delay = mkOption { @@ -347,41 +350,181 @@ in { example = ""; }; - color = mkOption { - type = types.str; - description = '' - Color of the animation - ''; - default = "39E9FED"; - example = ""; - }; - - borderColor = mkOption { - type = types.str; - description = '' - Color of the animation - ''; - default = "9E9FED"; - example = ""; - }; - gestures = mkOption { - type = types.attrOf gestureModule; + type = types.attrsOf gestureModule; description = "touchegg gestures"; default = {}; }; }; - config = mkIf cfg.enable { - #assertions = - # TODO - home.packages = [pkgs.touchegg]; + config = let + cfg = config.programs.touchegg; + in + mkIf cfg.enable { + # TODO + home.packages = [pkgs.touchegg]; - xdg.configFile.touchegg = { - target = "touchegg/touchegg.conf"; - text = builtins.toXML {}; + xdg.configFile.touchegg = { + target = "touchegg/touchegg.conf"; + text = '' + + + + + 150 + + + 20 + + + auto + auto + + + + + + + true + + + + + + true + + + + + + left + true + + + + + + right + true + + + + + + true + F84A53 + F84A53 + + + + + + auto + true + auto + + + + + + auto + true + auto + + + + + + false + Super_L + S + begin + + + + + + true + + + + + + false + Super_L + A + begin + + + + + + + begin + + + + + + + begin + + + + + + + + + + true + Control_L + KP_Subtract + KP_Add + + + + + + true + Control_L + KP_Add + KP_Subtract + + + + + + + ''; + }; }; - - #systemd.user.services.touchegg = - }; } diff --git a/users/common/touchegg-settings.nix b/users/common/touchegg-settings.nix new file mode 100644 index 0000000..1733d4d --- /dev/null +++ b/users/common/touchegg-settings.nix @@ -0,0 +1,6 @@ +{config, ...}: { + # + # MY Config + # + programs.touchegg.enable = true; +} diff --git a/users/patrick.nix b/users/patrick.nix index 8415096..4455c9b 100644 --- a/users/patrick.nix +++ b/users/patrick.nix @@ -9,7 +9,8 @@ common/graphical/autorandr.nix common/programs/polybar.nix common/programs/rofi.nix - #common/touchegg.nix + common/touchegg-module.nix + common/touchegg-settings.nix ]; home = {