From 6066b1bbe2c1cdaa8b0085a92071c11d64e9abbf Mon Sep 17 00:00:00 2001 From: Akshay Date: Tue, 14 Jun 2022 22:07:53 +0530 Subject: stuff for colemak --- flake.nix | 2 +- home.nix | 2 -- hosts/olive/configuration.nix | 13 ++++---- hosts/olive/qmk.rules | 74 +++++++++++++++++++++++++++++++++++++++++++ programs/bash.nix | 1 + programs/git.nix | 55 ++++++++++++++++---------------- programs/tmux.nix | 23 +++++++------- theme.nix | 39 ----------------------- theme/day.nix | 18 +++++++++++ theme/default.nix | 6 ++++ theme/gruvbox.nix | 18 +++++++++++ theme/night.nix | 18 +++++++++++ 12 files changed, 183 insertions(+), 86 deletions(-) create mode 100644 hosts/olive/qmk.rules delete mode 100644 theme.nix create mode 100644 theme/day.nix create mode 100644 theme/default.nix create mode 100644 theme/gruvbox.nix create mode 100644 theme/night.nix diff --git a/flake.nix b/flake.nix index dec2ba2..350fcf2 100644 --- a/flake.nix +++ b/flake.nix @@ -58,7 +58,7 @@ imports = [ ./home.nix ]; _module.args.self = self; _module.args.inputs = inputs; - _module.args.theme = import ./theme.nix; + _module.args.theme = import ./theme; }; } ]; diff --git a/home.nix b/home.nix index 77484ec..c113997 100644 --- a/home.nix +++ b/home.nix @@ -44,7 +44,6 @@ neomutt mpv nodePackages.bash-language-server - gitAndTools.delta w3m noto-fonts-emoji ripgrep-all @@ -85,7 +84,6 @@ initExtra = '' ${pkgs.hsetroot}/bin/hsetroot -solid "${theme.base00}" xrdb -load $HOME/.Xresources - setxkbmap -option 'caps:swapescape' ''; }; diff --git a/hosts/olive/configuration.nix b/hosts/olive/configuration.nix index 66b5bdc..5ecce25 100644 --- a/hosts/olive/configuration.nix +++ b/hosts/olive/configuration.nix @@ -18,12 +18,12 @@ interfaces = [ "wlp2s0" ]; - environmentFile = "/run/secrets/wireless.env"; + environmentFile = "/home/np/.wireless.env"; networks = { - Sanic.pskRaw = "@PSK_SANI@"; - Gopalan.pskRaw = "@PSK_GOPA@"; - Srividhya.pskRaw = "@PSK_SRIV@"; - sage.pskRaw = "@PSK_SAGE@"; + Sanic.psk = "@PSK_SANI@"; + Gopalan.psk = "@PSK_GOPA@"; + Srividhya.psk = "@PSK_SRIV@"; + sage.psk = "@PSK_SAGE@"; }; extraConfig = '' ctrl_interface=/run/wpa_supplicant @@ -103,7 +103,6 @@ services.xserver = { enable = true; layout = "us"; - xkbOptions = "caps:swapescape"; displayManager.startx.enable = true; libinput.enable = true; }; @@ -114,6 +113,8 @@ suspendCapacity = 10; }; + services.udev.extraRules = builtins.readFile ./qmk.rules; + users.users.np = { isNormalUser = true; home = "/home/np"; diff --git a/hosts/olive/qmk.rules b/hosts/olive/qmk.rules new file mode 100644 index 0000000..57806f9 --- /dev/null +++ b/hosts/olive/qmk.rules @@ -0,0 +1,74 @@ +# Atmel DFU +### ATmega16U2 +SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2fef", TAG+="uaccess" +### ATmega32U2 +SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff0", TAG+="uaccess" +### ATmega16U4 +SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff3", TAG+="uaccess" +### ATmega32U4 +SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff4", TAG+="uaccess" +### AT90USB64 +SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff9", TAG+="uaccess" +### AT90USB162 +SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ffa", TAG+="uaccess" +### AT90USB128 +SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ffb", TAG+="uaccess" + +# Input Club +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1c11", ATTRS{idProduct}=="b007", TAG+="uaccess" + +# STM32duino +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1eaf", ATTRS{idProduct}=="0003", TAG+="uaccess" +# STM32 DFU +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", TAG+="uaccess" + +# BootloadHID +SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05df", TAG+="uaccess" + +# USBAspLoader +SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", TAG+="uaccess" + +# ModemManager should ignore the following devices +# Atmel SAM-BA (Massdrop) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" + +# Caterina (Pro Micro) +## pid.codes shared PID +### Keyboardio Atreus 2 Bootloader +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="2302", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" +## Spark Fun Electronics +### Pro Micro 3V3/8MHz +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9203", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" +### Pro Micro 5V/16MHz +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9205", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" +### LilyPad 3V3/8MHz (and some Pro Micro clones) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9207", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" +## Pololu Electronics +### A-Star 32U4 +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1ffb", ATTRS{idProduct}=="0101", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" +## Arduino SA +### Leonardo +SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0036", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" +### Micro +SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0037", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" +## Adafruit Industries LLC +### Feather 32U4 +SUBSYSTEMS=="usb", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="000c", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" +### ItsyBitsy 32U4 3V3/8MHz +SUBSYSTEMS=="usb", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="000d", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" +### ItsyBitsy 32U4 5V/16MHz +SUBSYSTEMS=="usb", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="000e", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" +## dog hunter AG +### Leonardo +SUBSYSTEMS=="usb", ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="0036", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" +### Micro +SUBSYSTEMS=="usb", ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="0037", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" + +# hid_listen +KERNEL=="hidraw*", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl" + +# hid bootloaders +## QMK HID +SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2067", TAG+="uaccess" +## PJRC's HalfKay +SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="0478", TAG+="uaccess" diff --git a/programs/bash.nix b/programs/bash.nix index 66546c2..9ad3217 100644 --- a/programs/bash.nix +++ b/programs/bash.nix @@ -25,6 +25,7 @@ tree = "tree -C"; vim = "nvim"; tb = "nc termbin.com 9999"; + n = "j"; # git aliases gb = "git branch -v"; diff --git a/programs/git.nix b/programs/git.nix index 1a2bc72..dc842ce 100644 --- a/programs/git.nix +++ b/programs/git.nix @@ -9,35 +9,9 @@ with theme; programs.git = { enable = true; ignores = [ ".envrc" ]; + delta.enable = true; userEmail = "nerdy@peppe.rs"; userName = "Akshay"; - delta = { - enable = true; - options = { - features = "decorations labels"; - syntax-theme = "none"; - zero-style = "8"; - navigate = "true"; - keep-plus-minus-markers = "true"; - decorations = { - file-decoration-style = "none"; - whitespace-error-style = "22 reverse"; - minus-style = "${base08}"; - minus-emph-style = "${base08} bold"; - plus-style = "${base0B}"; - plus-emph-style = "${base0B} bold"; - file-style = "7 italic"; - hunk-header-style = "7"; - hunk-header-decoration-style = "8 ul"; - }; - labels = { - file-modified-label = " MODIFIED "; - file-removed-label = " REMOVED "; - file-added-label = " ADDED "; - file-renamed-label = " RENAMED "; - }; - }; - }; extraConfig = { commit.verbose = true; core = { @@ -46,3 +20,30 @@ with theme; }; }; } +# delta = { +# enable = true; +# options = { +# features = "decorations labels"; +# syntax-theme = "none"; +# zero-style = "8"; +# navigate = "true"; +# keep-plus-minus-markers = "true"; +# decorations = { +# file-decoration-style = "none"; +# whitespace-error-style = "22 reverse"; +# minus-style = "${base08}"; +# minus-emph-style = "${base08} bold"; +# plus-style = "${base0B}"; +# plus-emph-style = "${base0B} bold"; +# file-style = "7 italic"; +# hunk-header-style = "7"; +# hunk-header-decoration-style = "8 ul"; +# }; +# labels = { +# file-modified-label = " MODIFIED "; +# file-removed-label = " REMOVED "; +# file-added-label = " ADDED "; +# file-renamed-label = " RENAMED "; +# }; +# }; +# }; diff --git a/programs/tmux.nix b/programs/tmux.nix index 5f58108..8679222 100644 --- a/programs/tmux.nix +++ b/programs/tmux.nix @@ -10,10 +10,10 @@ tmuxPlugins.fingers ]; extraConfig = '' - set -g prefix C-a + set -g prefix C-t setw -g mode-keys vi unbind-key C-b - bind-key C-a send-prefix + bind-key C-t send-prefix bind r source-file ~/.config/tmux/tmux.conf @@ -27,19 +27,19 @@ # pane binds bind-key h select-pane -L - bind-key j select-pane -D - bind-key k select-pane -U - bind-key l select-pane -R + bind-key n select-pane -D + bind-key e select-pane -U + bind-key i select-pane -R bind-key -r H resize-pane -L 5 - bind-key -r J resize-pane -D 5 - bind-key -r K resize-pane -U 5 - bind-key -r L resize-pane -R 5 + bind-key -r N resize-pane -D 5 + bind-key -r E resize-pane -U 5 + bind-key -r I resize-pane -R 5 # window binds bind -n M-h previous-window - bind -n M-l next-window - bind-key "|" split-window -h -c "#{pane_current_path}" - bind-key "-" split-window -v -c "#{pane_current_path}" + bind -n M-i next-window + bind-key "{" split-window -h -c "#{pane_current_path}" + bind-key "}" split-window -v -c "#{pane_current_path}" bind-key s choose-session bind-key c new-window -c "#{pane_current_path}" bind-key ) swap-window -t +1 @@ -84,6 +84,7 @@ # status left set -g status-left "#[fg=colour7]#(${pkgs.prompt}/bin/prompt cwd '#{pane_current_path}') " set -ag status-left "#[fg=colour7]#(${pkgs.prompt}/bin/prompt vcs '#{pane_current_path}')" + set status-left-length 50 ''; }; } diff --git a/theme.nix b/theme.nix deleted file mode 100644 index 24a8dac..0000000 --- a/theme.nix +++ /dev/null @@ -1,39 +0,0 @@ -let - day = { - base00 = "#fafafa"; - base01 = "#f0f0f1"; - base02 = "#e5e5e6"; - base03 = "#a0a1a7"; - base04 = "#696c77"; - base05 = "#383a42"; - base06 = "#202227"; - base07 = "#090a0b"; - base08 = "#ca1243"; - base09 = "#d75f00"; - base0A = "#c18401"; - base0B = "#50a14f"; - base0C = "#29BC9B"; - base0D = "#4078f2"; - base0E = "#EB367F"; - base0F = "#986801"; - }; - night = { - base00 = "#000000"; - base01 = "#303030"; - base02 = "#353535"; - base03 = "#4A4A4A"; - base04 = "#787878"; - base05 = "#EEFFFF"; - base06 = "#EEFFFF"; - base07 = "#FFFFFF"; - base08 = "#F07178"; - base09 = "#F78C6C"; - base0A = "#FDF200"; - base0B = "#13CA91"; - base0C = "#79ffe1"; - base0D = "#7898FB"; - base0E = "#ff3299"; - base0F = "#FF5370"; - }; -in -night diff --git a/theme/day.nix b/theme/day.nix new file mode 100644 index 0000000..f394287 --- /dev/null +++ b/theme/day.nix @@ -0,0 +1,18 @@ +{ + base00 = "#fafafa"; + base01 = "#f0f0f1"; + base02 = "#e5e5e6"; + base03 = "#a0a1a7"; + base04 = "#696c77"; + base05 = "#383a42"; + base06 = "#202227"; + base07 = "#090a0b"; + base08 = "#ca1243"; + base09 = "#d75f00"; + base0A = "#c18401"; + base0B = "#50a14f"; + base0C = "#29BC9B"; + base0D = "#4078f2"; + base0E = "#EB367F"; + base0F = "#986801"; +} diff --git a/theme/default.nix b/theme/default.nix new file mode 100644 index 0000000..b3af086 --- /dev/null +++ b/theme/default.nix @@ -0,0 +1,6 @@ +let + day = import ./day.nix; + night = import ./night.nix; + gruvbox = import ./gruvbox.nix; +in +night diff --git a/theme/gruvbox.nix b/theme/gruvbox.nix new file mode 100644 index 0000000..cda6834 --- /dev/null +++ b/theme/gruvbox.nix @@ -0,0 +1,18 @@ +{ + base00 = "#282828"; + base01 = "#3c3836"; + base02 = "#504945"; + base03 = "#665c54"; + base04 = "#bdae93"; + base05 = "#d5c4a1"; + base06 = "#ebdbb2"; + base07 = "#fbf1c7"; + base08 = "#fb4934"; + base09 = "#fe8019"; + base0A = "#fabd2f"; + base0B = "#b8bb26"; + base0C = "#8ec07c"; + base0D = "#83a598"; + base0E = "#d3869b"; + base0F = "#d65d0e"; +} diff --git a/theme/night.nix b/theme/night.nix new file mode 100644 index 0000000..b838b3a --- /dev/null +++ b/theme/night.nix @@ -0,0 +1,18 @@ +{ + base00 = "#000000"; + base01 = "#303030"; + base02 = "#353535"; + base03 = "#4A4A4A"; + base04 = "#787878"; + base05 = "#EEFFFF"; + base06 = "#EEFFFF"; + base07 = "#FFFFFF"; + base08 = "#F07178"; + base09 = "#F78C6C"; + base0A = "#FDF200"; + base0B = "#13CA91"; + base0C = "#79ffe1"; + base0D = "#7898FB"; + base0E = "#ff3299"; + base0F = "#FF5370"; +} -- cgit v1.2.3