From 30efa48b7d48bef0302a16842d0676af0c3304d4 Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Tue, 29 Jun 2021 09:24:38 +0200 Subject: [PATCH] Better snapper + various fixes --- configs/kak/colors/nord.kak | 97 ++++++++++++++++++++++++++++++++ home.nix | 6 +- intel-update.sh | 3 + modules/bspwm.nix | 27 +++++++++ modules/kakoune.nix | 2 +- modules/polybar.nix | 2 +- modules/ssh.nix | 70 +++++++++++------------ nixos/base.nix | 50 ++++++++++++++-- nixos/intel.nix | 12 +++- nixos/nvidia.nix | 13 ++++- nvidia-update.sh | 3 + update-intel.sh | 3 - update-nvidia.sh | 3 - update-user.sh => user-update.sh | 0 14 files changed, 237 insertions(+), 54 deletions(-) create mode 100644 configs/kak/colors/nord.kak create mode 100755 intel-update.sh create mode 100755 nvidia-update.sh delete mode 100755 update-intel.sh delete mode 100755 update-nvidia.sh rename update-user.sh => user-update.sh (100%) diff --git a/configs/kak/colors/nord.kak b/configs/kak/colors/nord.kak new file mode 100644 index 0000000..bc009d0 --- /dev/null +++ b/configs/kak/colors/nord.kak @@ -0,0 +1,97 @@ +# text +# set-face global title rgb:bac5d8,default+b +# set-face global header rgb:e6e6e6,default +# set-face global bold rgb:e6e6e6,default+b +# set-face global italic rgb:d6d6d6,default+i +# set-face global mono rgb:b8b8b8,rgb:1f1f1f +# set-face global block rgb:b8b8b8,rgb:1f1f1f +# set-face global link rgb:e6e6e6,default +# set-face global bullet rgb:e6e6e6,default +# set-face global list rgb:c7c7c7,default + +set-face global value rgb:b48ead,default +set-face global type rgb:8fbcbb,default +set-face global identifier rgb:88c0d0,default +set-face global string rgb:a3be8c,default +set-face global error rgb:BF616A,default +set-face global keyword rgb:81a1c1,default +set-face global operator rgb:c7c7c7,default +set-face global attribute rgb:5e81ac,default +set-face global comment rgb:4c566a,default +set-face global meta rgb:ebcb8b,default + +set-face global Default rgb:eceff4,rgb:2e3440 + # default colors + +set-face global PrimarySelection rgb:2e3440,rgb:e5e9f0 + # main selection face for every selected character except the cursor + +set-face global SecondarySelection rgb:eceff4,rgb:434c5e + # secondary selection face for every selected character except the cursor + +set-face global PrimaryCursor rgb:2e3440,rgb:ebcb8b + # cursor of the primary selection + +set-face global SecondaryCursor rgb:2e3440,rgb:d8dee9 + # cursor of the secondary selection + +# set-face global PrimaryCursorEol + # cursor of the primary selection when it lies on and end of line character + +# set-face global SecondaryCursorEol + # cursor of the secondary selection when it lies on and end of line character + +set-face global MenuForeground rgb:d8dee9,rgb:4c566a + # face for the selected element in menus + +set-face global MenuBackground default,rgb:3b4252 + # face for the not selected elements in menus + +set-face global MenuInfo default,rgb:3b4252 + # face for additional information for elements in menus + +set-face global Information rgb:2e3440,rgb:88c0d0 + # face for the informations windows and information messages + +# set-face global Error + # face of error messages + +set-face global StatusLine rgb:e5e9f0,rgb:3b4252 + # face used for the status line + +set-face global StatusLineMode rgb:5e81ac,rgb:3b4252 + # face used for the current mode except the normal mode + +set-face global StatusLineInfo rgb:5e81ac,rgb:3b4252 + # face used for special information + +set-face global StatusLineValue rgb:5e81ac,rgb:3b4252 + # face used for special values (numeric prefixes, registers, etc.) + +set-face global StatusCursor rgb:2e3440,rgb:ebcb8b + # face used for the status line cursor + +set-face global Prompt rgb:88c0d0,rgb:3b4252 + # face used prompt displayed on the status line + +set-face global BufferPadding default,default + # face applied on the ~ characters that follow the last line of a buffer + +# set-face global Builtin highlighters faces + +# The following faces are used by builtin highlighters if enabled. + +# set-face global LineNumbers + # face used by the number-lines highlighter + +# set-face global LineNumberCursor + # face used to highlight the line number of the main selection + +# set-face global LineNumbersWrapped + # face used to highlight the line number of wrapped lines + +# set-face global MatchingChar + # face used by the show-matching highlighter + +# set-face global Whitespace + # face used by the show-whitespaces highlighter diff --git a/home.nix b/home.nix index cac181e..5817744 100644 --- a/home.nix +++ b/home.nix @@ -59,12 +59,12 @@ in packages = with pkgs; [ audacity authy - blender + # blender discord evolution firefox gallery-dl - gallery-tagger + # gallery-tagger gnome.dconf-editor gnome.easytag gnome.eog @@ -156,7 +156,7 @@ in ./modules/man.nix # ./modules/nix-index.nix ./modules/noti.nix - ./modules/obs-studio.nix + # ./modules/obs-studio.nix # ./modules/pazi.nix ./modules/picom.nix ./modules/polybar.nix diff --git a/intel-update.sh b/intel-update.sh new file mode 100755 index 0000000..2d310ad --- /dev/null +++ b/intel-update.sh @@ -0,0 +1,3 @@ +#!/bin/sh +sudo nix-channel --update && +sudo nixos-rebuild boot -p Intel -I nixos-config=./nixos/intel.nix diff --git a/modules/bspwm.nix b/modules/bspwm.nix index a778314..740c2a2 100644 --- a/modules/bspwm.nix +++ b/modules/bspwm.nix @@ -30,4 +30,31 @@ in ''; startupPrograms = []; }; + + # xdg.configFile."bspwm/bspwmrc" = { + # executable = true; + # text = '' + # #!/bin/sh + + # bspc monitor DP1 -d I II III IV V VI VII VIII IX X + # bspc monitor HDMI-0 -d I II III IV V VI VII VIII IX X + # bspc monitor eDP-1-1 -d I II III IV V VI VII VIII IX X + # bspc monitor eDP1 -d I II III IV V VI VII VIII IX X + # bspc config border_radius 8 + # bspc config border_width 2 + # bspc config borderless_monocle true + # bspc config focused_border_color '#678EBD' + # bspc config gapless_monocle false + # bspc config normal_border_color '#5E81AC' + # bspc config split_ratio 0.500000 + # bspc config top_padding 0 + # bspc config window_gap 4 + # # java gui fixes + # export _JAVA_AWT_WM_NONREPARENTING=1 + # bspc rule -a sun-awt-X11-XDialogPeer state=floating + + # sleep 2 + # polybar-msg cmd restart + # ''; + # }; } diff --git a/modules/kakoune.nix b/modules/kakoune.nix index e9dd4d9..6df4741 100644 --- a/modules/kakoune.nix +++ b/modules/kakoune.nix @@ -115,6 +115,6 @@ in ] ) ++ rustPlugins ++ cppPlugins ++ pythonPlugins ++ nixPlugins ++ spellingPlugins ++ dataFormats; }; - + xdg.configFile."kak/colors/nord.kak".source = ../configs/kak/colors/nord.kak; xdg.configFile."kak-lsp/kak-lsp.toml".source = ../configs/kak-lsp/kak-lsp.toml; } diff --git a/modules/polybar.nix b/modules/polybar.nix index ad60958..8078a2d 100644 --- a/modules/polybar.nix +++ b/modules/polybar.nix @@ -71,7 +71,7 @@ let ramp = [ "▂" "▃" "▄" "▅" "▆" "▇" ]; in { - home.packages = with pkgs; [ nerdfonts emojione noto-fonts-emoji ]; + home.packages = with pkgs; [ nerdfonts emojione noto-fonts-emoji material-design-icons ]; services.polybar = { enable = true; package = pkgs.polybarFull; diff --git a/modules/ssh.nix b/modules/ssh.nix index b91a264..124c5f9 100644 --- a/modules/ssh.nix +++ b/modules/ssh.nix @@ -3,41 +3,41 @@ enable = true; compression = true; matchBlocks = { - "gitlab.com" = { - hostname = "gitlab.com"; - identityFile = "~/.ssh/gitlab"; - identitiesOnly = true; - }; - "github.com" = { - hostname = "github.com"; - identityFile = "~/.ssh/github"; - identitiesOnly = true; - }; - "bitbucket.com" = { - hostname = "bitbucket.com"; - identityFile = "~/.ssh/bitbucket"; - identitiesOnly = true; - }; - "aur.archlinux.org" = { - hostname = "aur.archlinux.org"; - identityFile = "~/.ssh/aur"; - identitiesOnly = true; - }; - "heroku.com" = { - hostname = "heroku.com"; - identityFile = "~/.ssh/heroku"; - identitiesOnly = true; - }; - "ngrok.io" = { - hostname = "ngrok.io"; - identityFile = "~/.ssh/local"; - identitiesOnly = true; - }; - "172.27.108.?" = { - hostname = "172.27.108.?"; - identityFile = "~/.ssh/local"; - identitiesOnly = true; - }; +# "gitlab.com" = { +# hostname = "gitlab.com"; +# identityFile = "~/.ssh/gitlab"; +# identitiesOnly = true; +# }; +# "github.com" = { +# hostname = "github.com"; +# identityFile = "~/.ssh/github"; +# identitiesOnly = true; +# }; +# "bitbucket.com" = { +# hostname = "bitbucket.com"; +# identityFile = "~/.ssh/bitbucket"; +# identitiesOnly = true; +# }; +# "aur.archlinux.org" = { +# hostname = "aur.archlinux.org"; +# identityFile = "~/.ssh/aur"; +# identitiesOnly = true; +# }; +# "heroku.com" = { +# hostname = "heroku.com"; +# identityFile = "~/.ssh/heroku"; +# identitiesOnly = true; +# }; +# "ngrok.io" = { +# hostname = "ngrok.io"; +# identityFile = "~/.ssh/local"; +# identitiesOnly = true; +# }; +# "172.27.108.?" = { +# hostname = "172.27.108.?"; +# identityFile = "~/.ssh/local"; +# identitiesOnly = true; +# }; "*" = { identityFile = "~/.ssh/id_ed25519"; }; diff --git a/nixos/base.nix b/nixos/base.nix index 88424d6..5f41a02 100644 --- a/nixos/base.nix +++ b/nixos/base.nix @@ -151,12 +151,50 @@ ''; in { - bertof_home = { subvolume = "/home/bertof"; extraConfig = bertofExtraConfig; }; - bertof_images = { subvolume = "/home/bertof/Immagini"; extraConfig = bertofExtraConfig; }; - bertof_music = { subvolume = "/home/bertof/Musica"; extraConfig = bertofExtraConfig; }; - bertof_videos = { subvolume = "/home/bertof/Video"; extraConfig = bertofExtraConfig; }; - bertof_hdd_games = { subvolume = "/home/bertof/Giochi/HDD"; extraConfig = bertofExtraConfig; }; - bertof_ssd_games = { subvolume = "/home/bertof/Giochi/SSD"; extraConfig = bertofExtraConfig; }; + bertof_home = { + subvolume = "/home/bertof"; + extraConfig = bertofExtraConfig; + }; + bertof_music = { + subvolume = "/home/bertof/Musica"; + extraConfig = bertofExtraConfig; + }; + bertof_downloads = { + subvolume = "/home/bertof/Scaricati"; + extraConfig = bertofExtraConfig; + }; + bertof_images = { + subvolume = "/home/bertof/Immagini"; + extraConfig = bertofExtraConfig; + }; + bertof_videos = { + subvolume = "/home/bertof/Video"; + extraConfig = bertofExtraConfig; + }; + bertof_documents = { + subvolume = "/home/bertof/Documenti"; + extraConfig = bertofExtraConfig; + }; + bertof_games_ssd = { + subvolume = "/home/bertof/Giochi/SSD"; + extraConfig = bertofExtraConfig; + }; + bertof_games_hdd = { + subvolume = "/home/bertof/Giochi/HDD"; + extraConfig = bertofExtraConfig; + }; + bertof_git = { + subvolume = "/home/bertof/Documenti/Git"; + extraConfig = bertofExtraConfig; + }; + bertof_virt_ssd = { + subvolume = "/home/bertof/Documenti/VirtManager/SSD"; + extraConfig = bertofExtraConfig; + }; + bertof_virt_hdd = { + subvolume = "/home/bertof/Documenti/VirtManager/HDD"; + extraConfig = bertofExtraConfig; + }; }; }; diff --git a/nixos/intel.nix b/nixos/intel.nix index d9d66d9..5b1352d 100644 --- a/nixos/intel.nix +++ b/nixos/intel.nix @@ -6,10 +6,20 @@ { imports = [ - ./base.nix ]; + boot.initrd.kernelModules = ["i915"]; + + hardware.cpu.intel.updateMicrocode = config.hardware.enableRedistributableFirmware; + + hardware.opengl.extraPackages = with pkgs; [ + vaapiIntel + vaapiVdpau + libvdpau-va-gl + intel-media-driver + ]; + # This runs only Intel and nvidia does not drain power. ##### disable nvidia for a very nice battery life. hardware.nvidiaOptimus.disable = true; diff --git a/nixos/nvidia.nix b/nixos/nvidia.nix index b7339f0..caf22ec 100644 --- a/nixos/nvidia.nix +++ b/nixos/nvidia.nix @@ -7,10 +7,21 @@ { imports = [ - ./base.nix ]; + boot.initrd.kernelModules = ["i915"]; + + hardware.cpu.intel.updateMicrocode = config.hardware.enableRedistributableFirmware; + + hardware.opengl.extraPackages = with pkgs; [ + vaapiIntel + vaapiVdpau + libvdpau-va-gl + intel-media-driver + ]; + + services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia.prime = { offload.enable = false; diff --git a/nvidia-update.sh b/nvidia-update.sh new file mode 100755 index 0000000..8c0e8bb --- /dev/null +++ b/nvidia-update.sh @@ -0,0 +1,3 @@ +#!/bin/sh +sudo nix-channel --update && +sudo nixos-rebuild boot -p Nvidia -I nixos-config=./nixos/nvidia.nix diff --git a/update-intel.sh b/update-intel.sh deleted file mode 100755 index 75515b6..0000000 --- a/update-intel.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -sudo nix-channel --update && -sudo nixos-rebuild switch -p Intel -I nixos-config=./nixos/intel.nix diff --git a/update-nvidia.sh b/update-nvidia.sh deleted file mode 100755 index 58f6956..0000000 --- a/update-nvidia.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -sudo nix-channel --update && -sudo nixos-rebuild switch -p Nvidia -I nixos-config=./nixos/nvidia.nix diff --git a/update-user.sh b/user-update.sh similarity index 100% rename from update-user.sh rename to user-update.sh