From 26ebbf7ae154441847203b8f52d6c10741104f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 1 Sep 2022 11:11:11 +0200 Subject: [PATCH 01/58] :rocket: add python packages option --- modules/programs/python.nix | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/modules/programs/python.nix b/modules/programs/python.nix index 39fd7f2..7480cb5 100644 --- a/modules/programs/python.nix +++ b/modules/programs/python.nix @@ -7,19 +7,35 @@ with lib; let cfg = config.my.programs.python; + + mkPython = packages: version: pkgs.${version}.withPackages (ps: map (flip getAttr ps) packages); + + pythonVersions = [ + "python311" + "python310" + "python39" + "python38" + ]; + + packageLists = map (version: attrNames pkgs."${version}Packages") cfg.versions; + + commonPackages = foldl' intersectLists (head packageLists) (tail packageLists); in { options.my.programs.python = { enable = mkEnableOption "python"; versions = mkOption { default = [ "python310" ]; - type = with types; listOf str; + type = with types; nonEmptyListOf (enum pythonVersions); example = [ "python39" ]; - apply = builtins.map (version: pkgs.${version}.withPackages (packages: with packages; [ black pyflakes isort nose pytest python-lsp-server ])); + }; + packages = mkOption { + default = [ "isort" "pytest" "flake8" "python-lsp-server" ]; + type = with types; listOf (enum commonPackages); }; }; config = mkIf cfg.enable { - home-manager.users.moritz.home.packages = cfg.versions; + users.users.moritz.packages = map (mkPython cfg.packages) cfg.versions; }; } From a2257a48f87c3917a332baf9b7b82c6d486b5a5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 1 Sep 2022 11:11:58 +0200 Subject: [PATCH 02/58] :bug: fix libvirtd network error --- modules/virtualisation/virtualisation.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/virtualisation/virtualisation.nix b/modules/virtualisation/virtualisation.nix index 688ba71..3326a40 100644 --- a/modules/virtualisation/virtualisation.nix +++ b/modules/virtualisation/virtualisation.nix @@ -20,7 +20,7 @@ in config = mkIf cfg.enable { virtualisation.libvirtd = { enable = true; - package = pkgs.stable.libvirt; + package = pkgs.libvirt; }; home-manager.users.moritz.home.packages = with pkgs; [ virt-manager ]; users.users.moritz.extraGroups = [ "libvirtd" ]; From 04fe22a791d21c48371357b204e67f43189e473c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 3 Sep 2022 11:31:21 +0200 Subject: [PATCH 03/58] :rocket: use local flake inputs for registry --- modules/config/nix.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/config/nix.nix b/modules/config/nix.nix index 3d1aa60..5747c41 100644 --- a/modules/config/nix.nix +++ b/modules/config/nix.nix @@ -1,6 +1,7 @@ { config , lib , pkgs +, inputs , ... }: @@ -34,6 +35,17 @@ in dates = [ "weekly" ]; }; + registry = { + master-upstream.to = { + type = "github"; + owner = "nixos"; + repo = "nixpkgs"; + }; + master.flake = inputs.master; + nixpkgs.flake = inputs.nixpkgs; + stable.flake = inputs.stable; + }; + settings = { substituters = [ "https://cache.nixos.org/" From 79faf3470e25a7b414bd49c72c879c0fac3a9d91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 7 Sep 2022 19:19:06 +0200 Subject: [PATCH 04/58] :rocket: add more themes --- modules/config/theming/catppuccin-frappe.nix | 39 ++ modules/config/theming/catppuccin-latte.nix | 39 ++ .../config/theming/catppuccin-macchiato.nix | 39 ++ modules/config/theming/catppuccin-mocha.nix | 39 ++ modules/config/theming/catppuccin.nix | 519 ++++++++++-------- modules/config/theming/default.nix | 18 +- modules/config/theming/dracula.nix | 350 +++++++----- 7 files changed, 657 insertions(+), 386 deletions(-) create mode 100644 modules/config/theming/catppuccin-frappe.nix create mode 100644 modules/config/theming/catppuccin-latte.nix create mode 100644 modules/config/theming/catppuccin-macchiato.nix create mode 100644 modules/config/theming/catppuccin-mocha.nix diff --git a/modules/config/theming/catppuccin-frappe.nix b/modules/config/theming/catppuccin-frappe.nix new file mode 100644 index 0000000..b7d8169 --- /dev/null +++ b/modules/config/theming/catppuccin-frappe.nix @@ -0,0 +1,39 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.my.theming; +in +{ + config = mkIf (cfg.scheme == "catppuccin-frappe") + (import ./catppuccin.nix + { + inherit config lib pkgs; + rosewater = "f2d5cf"; + flamingo = "eebebe"; + pink = "f4b8e4"; + mauve = "ca9ee6"; + red = "e78284"; + maroon = "ea999c"; + peach = "ef9f76"; + yellow = "e5c890"; + green = "a6d189"; + teal = "81c8be"; + sky = "99d1db"; + sapphire = "85c1dc"; + blue = "8caaee"; + lavender = "babbf1"; + text = "c6d0f5"; + subtext1 = "b5bfe2"; + subtext0 = "a5adce"; + overlay2 = "949cbb"; + overlay1 = "838ba7"; + overlay0 = "737994"; + surface2 = "626880"; + surface1 = "51576d"; + surface0 = "414559"; + base = "303446"; + mantle = "292c3c"; + crust = "232634"; + }); +} diff --git a/modules/config/theming/catppuccin-latte.nix b/modules/config/theming/catppuccin-latte.nix new file mode 100644 index 0000000..6743ed9 --- /dev/null +++ b/modules/config/theming/catppuccin-latte.nix @@ -0,0 +1,39 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.my.theming; +in +{ + config = mkIf (cfg.scheme == "catppuccin-latte") + (import ./catppuccin.nix + { + inherit config lib pkgs; + rosewater = "dc8a78"; + flamingo = "dd7878"; + pink = "ea76cb"; + mauve = "8839ef"; + red = "d20f39"; + maroon = "e64553"; + peach = "fe640b"; + yellow = "df8e1d"; + green = "40a02b"; + teal = "179299"; + sky = "04a5e5"; + sapphire = "209fb5"; + blue = "1e66f5"; + lavender = "7287fd"; + text = "4c4f69"; + subtext1 = "5c5f77"; + subtext0 = "6c6f85"; + overlay2 = "7c7f93"; + overlay1 = "8c8fa1"; + overlay0 = "9ca0b0"; + surface2 = "acb0be"; + surface1 = "bcc0cc"; + surface0 = "ccd0da"; + base = "eff1f5"; + mantle = "e6e9ef"; + crust = "dce0e8"; + }); +} diff --git a/modules/config/theming/catppuccin-macchiato.nix b/modules/config/theming/catppuccin-macchiato.nix new file mode 100644 index 0000000..70b4dd8 --- /dev/null +++ b/modules/config/theming/catppuccin-macchiato.nix @@ -0,0 +1,39 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.my.theming; +in +{ + config = mkIf (cfg.scheme == "catppuccin-macchiato") + (import ./catppuccin.nix + { + inherit config lib pkgs; + rosewater = "f4dbd6"; + flamingo = "f0c6c6"; + pink = "f5bde6"; + mauve = "c6a0f6"; + red = "ed8796"; + maroon = "ee99a0"; + peach = "f5a97f"; + yellow = "eed49f"; + green = "a6da95"; + teal = "8bd5ca"; + sky = "91d7e3"; + sapphire = "7dc4e4"; + blue = "8aadf4"; + lavender = "b7bdf8"; + text = "cad3f5"; + subtext1 = "b8c0e0"; + subtext0 = "a5adcb"; + overlay2 = "939ab7"; + overlay1 = "8087a2"; + overlay0 = "6e738d"; + surface2 = "5b6078"; + surface1 = "494d64"; + surface0 = "363a4f"; + base = "24273a"; + mantle = "1e2030"; + crust = "181926"; + }); +} diff --git a/modules/config/theming/catppuccin-mocha.nix b/modules/config/theming/catppuccin-mocha.nix new file mode 100644 index 0000000..ab35068 --- /dev/null +++ b/modules/config/theming/catppuccin-mocha.nix @@ -0,0 +1,39 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.my.theming; +in +{ + config = mkIf (cfg.scheme == "catppuccin-mocha") + (import ./catppuccin.nix + { + inherit config lib pkgs; + rosewater = "f5e0dc"; + flamingo = "f2cdcd"; + pink = "f5c2e7"; + mauve = "cba6f7"; + red = "f38ba8"; + maroon = "eba0ac"; + peach = "fab387"; + yellow = "f9e2af"; + green = "a6e3a1"; + teal = "94e2d5"; + sky = "89dceb"; + sapphire = "74c7ec"; + blue = "89b4fa"; + lavender = "b4befe"; + text = "cdd6f4"; + subtext1 = "bac2de"; + subtext0 = "a6adc8"; + overlay2 = "9399b2"; + overlay1 = "7f849c"; + overlay0 = "6c7086"; + surface2 = "585b70"; + surface1 = "45475a"; + surface0 = "494d64"; + base = "1e1e2e"; + mantle = "181825"; + crust = "11111b"; + }); +} diff --git a/modules/config/theming/catppuccin.nix b/modules/config/theming/catppuccin.nix index 0f77639..33acbac 100644 --- a/modules/config/theming/catppuccin.nix +++ b/modules/config/theming/catppuccin.nix @@ -1,272 +1,319 @@ -{ config, lib, pkgs, ... }: +{ config +, lib +, pkgs +, rosewater +, flamingo +, pink +, mauve +, red +, maroon +, peach +, yellow +, green +, teal +, sky +, sapphire +, blue +, lavender +, text +, subtext1 +, subtext0 +, overlay2 +, overlay1 +, overlay0 +, surface2 +, surface1 +, surface0 +, base +, mantle +, crust +}: with lib; let cfg = config.my.theming; - - rosewater = "#f2d5cf"; - flamingo = "#eebebe"; - pink = "#f4b8e4"; - mauve = "#ca9ee6"; - red = "#e78284"; - maroon = "#ea999c"; - peach = "#ef9f76"; - yellow = "#e5c890"; - green = "#a6d189"; - teal = "#81c8be"; - sky = "#99d1db"; - sapphire = "#85c1dc"; - blue = "#8caaee"; - lavender = "#babbf1"; - text = "#c6d0f5"; - subtext1 = "#b5bfe2"; - subtext0 = "#a5adce"; - overlay2 = "#949cbb"; - overlay1 = "#838ba7"; - overlay0 = "#737994"; - surface2 = "#626880"; - surface1 = "#51576d"; - surface0 = "#414559"; - base = "#303446"; - mantle = "#292c3c"; - crust = "#232634"; in { - config = mkIf (cfg.scheme == "catppuccin") { - home-manager.users.moritz = { - programs = { - kitty.extraConfig = - '' - # vim:ft=kitty + home-manager.users.moritz = { + programs = { + kitty.extraConfig = + '' + # vim:ft=kitty - ## name: Catppuccin-Frappe - ## author: Pocco81 (https://github.com/Pocco81) - ## license: MIT - ## upstream: https://github.com/catppuccin/kitty/blob/main/frappe.conf - ## blurb: Soothing pastel theme for the high-spirited! + ## name: Catppuccin-Frappe + ## author: Pocco81 (https://github.com/Pocco81) + ## license: MIT + ## upstream: https://github.com/catppuccin/kitty/blob/main/frappe.conf + ## blurb: Soothing pastel theme for the high-spirited! - # The basic colors - foreground #C6D0F5 - background #303446 - selection_foreground #303446 - selection_background ${rosewater} + # The basic colors + foreground #${text} + background #${base} + selection_foreground #${base} + selection_background #${rosewater} - # Cursor colors - cursor ${rosewater} - cursor_text_color #303446 + # Cursor colors + cursor #${rosewater} + cursor_text_color #${base} - # URL underline color when hovering with mouse - url_color ${rosewater} + # URL underline color when hovering with mouse + url_color #${rosewater} - # Kitty window border colors - active_border_color #BABBF1 - inactive_border_color #737994 - bell_border_color #E5C890 + # Kitty window border colors + active_border_color #${lavender} + inactive_border_color #${overlay0} + bell_border_color #${yellow} - # OS Window titlebar colors - wayland_titlebar_color system - macos_titlebar_color system + # OS Window titlebar colors + wayland_titlebar_color system + macos_titlebar_color system - # Tab bar colors - active_tab_foreground #232634 - active_tab_background ${mauve} - inactive_tab_foreground #C6D0F5 - inactive_tab_background #292C3C - tab_bar_background #232634 + # Tab bar colors + active_tab_foreground #${crust} + active_tab_background #${mauve} + inactive_tab_foreground #${text} + inactive_tab_background #${mantle} + tab_bar_background #${crust} - # Colors for marks (marked text in the terminal) - mark1_foreground #303446 - mark1_background #BABBF1 - mark2_foreground #303446 - mark2_background ${mauve} - mark3_foreground #303446 - mark3_background #85C1DC + # Colors for marks (marked text in the terminal) + mark1_foreground #${base} + mark1_background #${lavender} + mark2_foreground #${base} + mark2_background #${mauve} + mark3_foreground #${base} + mark3_background #${sapphire} - # The 16 terminal colors + # The 16 terminal colors - # black - color0 #51576D - color8 #626880 + # black + color0 #${surface1} + color8 #${surface2} - # red - color1 ${red} - color9 ${red} + # red + color1 #${red} + color9 #${red} - # green - color2 #A6D189 - color10 #A6D189 + # green + color2 #${green} + color10 #${green} - # yellow - color3 #E5C890 - color11 #E5C890 + # yellow + color3 #${yellow} + color11 #${yellow} - # blue - color4 #8CAAEE - color12 #8CAAEE + # blue + color4 #${blue} + color12 #${blue} - # magenta - color5 ${pink} - color13 ${pink} + # magenta + color5 #${pink} + color13 #${pink} - # cyan - color6 #81C8BE - color14 #81C8BE + # cyan + color6 #${teal} + color14 #${teal} - # white - color7 #B5BFE2 - color15 #A5ADCE - ''; - zathura.extraConfig = '' - set window-title-basename "true" - set selection-clipboard "clipboard" - - set default-fg "#C6D0F5" - set default-bg "#303446" - - set completion-bg "#414559" - set completion-fg "#C6D0F5" - set completion-highlight-bg "#575268" - set completion-highlight-fg "#C6D0F5" - set completion-group-bg "#414559" - set completion-group-fg "#8CAAEE" - - set statusbar-fg "#C6D0F5" - set statusbar-bg "#414559" - - set notification-bg "#414559" - set notification-fg "#C6D0F5" - set notification-error-bg "#414559" - set notification-error-fg "${red}" - set notification-warning-bg "#414559" - set notification-warning-fg "#FAE3B0" - - set inputbar-fg "#C6D0F5" - set inputbar-bg "#414559" - - set recolor-lightcolor "#303446" - set recolor-darkcolor "#C6D0F5" - - set index-fg "#C6D0F5" - set index-bg "#303446" - set index-active-fg "#C6D0F5" - set index-active-bg "#414559" - - set render-loading-bg "#303446" - set render-loading-fg "#C6D0F5" - - set highlight-color "#575268" - set highlight-fg "${pink}" - set highlight-active-color "${pink}" + # white + color7 #${subtext1} + color15 #${subtext0} ''; - rofi = { - theme = "custom"; - extraConfig = { - show-icons = true; - terminal = "alacritty"; - drun-display-format = "{icon} {name}"; - location = 0; - disable-history = false; - hide-scrollbar = true; - display-drun = "  Apps "; - display-run = "  Run "; - display-window = " 﩯 Window"; - display-Network = " 󰤨 Network"; - sidebar-mode = true; - }; - }; - }; - xsession.windowManager.bspwm = { - settings = { - focused_border_color = mauve; - normal_border_color = base; - active_border_color = base; - }; - }; - services = { - dunst.settings = { - global = { - # Defines color of the frame around the notification window. - frame_color = blue; + zathura.extraConfig = '' + set window-title-basename "true" + set selection-clipboard "clipboard" - # Define a color for the separator. - # possible values are: - # * auto: dunst tries to find a color fitting to the background; - # * foreground: use the same color as the foreground; - # * frame: use the same color as the frame; - # * anything else will be interpreted as a X color. - separator_color = "frame"; - }; + set default-fg "#${text}" + set default-bg "#${base}" - urgency_low = { - background = base; - foreground = text; - }; - urgency_normal = { - background = base; - foreground = text; - }; - urgency_critical = { - background = base; - foreground = text; - frame_color = peach; - }; + set completion-bg "#${surface0}" + set completion-fg "#${text}" + set completion-highlight-bg "#575268" + set completion-highlight-fg "#${text}" + set completion-group-bg "#${surface0}" + set completion-group-fg "#${blue}" + + set statusbar-fg "#${text}" + set statusbar-bg "#${surface0}" + + set notification-bg "#${surface0}" + set notification-fg "#${text}" + set notification-error-bg "#${surface0}" + set notification-error-fg "#${red}" + set notification-warning-bg "#${surface0}" + set notification-warning-fg "#FAE3B0" + + set inputbar-fg "#${text}" + set inputbar-bg "#${surface0}" + + set recolor-lightcolor "#${base}" + set recolor-darkcolor "#${text}" + + set index-fg "#${text}" + set index-bg "#${base}" + set index-active-fg "#${text}" + set index-active-bg "#${surface0}" + + set render-loading-bg "#${base}" + set render-loading-fg "#${text}" + + set highlight-color "#575268" + set highlight-fg "#${pink}" + set highlight-active-color "#${pink}" + ''; + rofi = { + theme = "custom"; + extraConfig = { + show-icons = true; + terminal = "alacritty"; + drun-display-format = "{icon} {name}"; + location = 0; + disable-history = false; + hide-scrollbar = true; + display-drun = "  Apps "; + display-run = "  Run "; + display-window = " 﩯 Window"; + display-Network = " 󰤨 Network"; + sidebar-mode = true; }; - polybar = { - config = { - "bar/bottom" = { - background = base; - foreground = text; - border-color = base; - }; - "module/bspwm" = { - label-focused-foreground = pink; - label-occupied-foreground = overlay1; - label-urgent-foreground = maroon; - label-empty-foreground = overlay1; - label-separator-foreground = base; - }; - "module/cpu" = { - format-foreground = base; - format-background = green; - }; - "module/time" = { - format-foreground = base; - format-background = blue; - }; - "module/date" = { - format-foreground = base; - format-background = peach; - }; - "module/memory" = { - format-foreground = base; - format-background = blue; - }; - "module/pulseaudio" = { - format-volume-foreground = base; - format-volume-background = mauve; - label-muted = "%{F${red}}婢 %{F${base}}muted"; - format-muted-foreground = base; - format-muted-background = red; - }; - "module/network" = { - format-connected-foreground = base; - format-connected-background = mauve; - }; + }; + }; + xsession.windowManager.bspwm.settings = { + focused_border_color = "#${mauve}"; + normal_border_color = "#${base}"; + active_border_color = "#${base}"; + }; + services = { + dunst.settings = { + global = { + # Defines color of the frame around the notification window. + frame_color = "#${blue}"; + + # Define a color for the separator. + # possible values are: + # * auto: dunst tries to find a color fitting to the background; + # * foreground: use the same color as the foreground; + # * frame: use the same color as the frame; + # * anything else will be interpreted as a X color. + separator_color = "frame"; + }; + + urgency_low = { + background = "#${base}"; + foreground = "#${text}"; + }; + urgency_normal = { + background = "#${base}"; + foreground = "#${text}"; + }; + urgency_critical = { + background = "#${base}"; + foreground = "#${text}"; + frame_color = "#${peach}"; + }; + }; + polybar = { + config = { + "bar/bottom" = { + background = base; + foreground = text; + border-color = base; + }; + "module/bspwm" = { + label-focused-foreground = pink; + label-occupied-foreground = overlay1; + label-urgent-foreground = maroon; + label-empty-foreground = overlay1; + label-separator-foreground = base; + }; + "module/cpu" = { + format-foreground = base; + format-background = green; + }; + "module/time" = { + format-foreground = base; + format-background = blue; + }; + "module/date" = { + format-foreground = base; + format-background = peach; + }; + "module/memory" = { + format-foreground = base; + format-background = blue; + }; + "module/pulseaudio" = { + format-volume-foreground = base; + format-volume-background = mauve; + label-muted = "婢 muted"; + format-muted-foreground = base; + format-muted-background = red; + }; + "module/network" = { + format-connected-foreground = base; + format-connected-background = mauve; }; }; }; - xdg.configFile."rofi/custom.rasi".text = '' + }; + xdg.configFile = { + "fish/conf.d/theme.fish".text = '' + # Catppuccin color palette + + # --> special + set -l foreground ${text} + set -l selection ${surface0} + + # --> palette + set -l teal ${teal} + set -l flamingo ${flamingo} + set -l mauve ${mauve} + set -l pink ${pink} + set -l red ${red} + set -l peach ${peach} + set -l green ${green} + set -l yellow ${yellow} + set -l blue ${blue} + set -l gray ${overlay0} + + # Syntax Highlighting + set -g fish_color_normal $foreground + set -g fish_color_command $blue + set -g fish_color_param $flamingo + set -g fish_color_keyword $red + set -g fish_color_quote $green + set -g fish_color_redirection $pink + set -g fish_color_end $peach + set -g fish_color_error $red + set -g fish_color_gray $gray + set -g fish_color_selection --background=$selection + set -g fish_color_search_match --background=$selection + set -g fish_color_operator $pink + set -g fish_color_escape $flamingo + set -g fish_color_autosuggestion $gray + set -g fish_color_cancel $red + + # Prompt + set -g fish_color_cwd $yellow + set -g fish_color_user $teal + set -g fish_color_host $blue + + # Completion Pager + set -g fish_pager_color_progress $gray + set -g fish_pager_color_prefix $pink + set -g fish_pager_color_completion $foreground + set -g fish_pager_color_description $gray + ''; + "rofi/custom.rasi".text = '' * { - bg-col: #303446; - bg-col-light: #303446; - border-col: #303446; - selected-col: #303446; - blue: #8caaee; - fg-col: #c6d0f5; - fg-col2: ${red}; - grey: #737994; + bg-col: #${base}; + bg-col-light: #${base}; + border-col: #${base}; + selected-col: #${base}; + blue: #${blue}; + fg-col: #${text}; + fg-col2: #${red}; + grey: #${overlay0}; width: 900; font: "JetBrainsMono Nerd Font 14"; diff --git a/modules/config/theming/default.nix b/modules/config/theming/default.nix index 61165df..ba2f6cf 100644 --- a/modules/config/theming/default.nix +++ b/modules/config/theming/default.nix @@ -10,7 +10,13 @@ let cfg = config.my.theming; in { - imports = [ ./dracula.nix ./catppuccin.nix ]; + imports = [ + ./dracula.nix + ./catppuccin-frappe.nix + ./catppuccin-latte.nix + ./catppuccin-macchiato.nix + ./catppuccin-mocha.nix + ]; options.my.theming = { enable = mkOption { @@ -19,8 +25,14 @@ in example = true; }; scheme = mkOption { - default = "catppuccin"; - type = types.enum [ "dracula" "catppuccin" ]; + default = "catppuccin-macchiato"; + type = types.enum [ + "dracula" + "catppuccin-latte" + "catppuccin-frappe" + "catppuccin-macchiato" + "catppuccin-mocha" + ]; }; }; diff --git a/modules/config/theming/dracula.nix b/modules/config/theming/dracula.nix index 7e5cbb1..235e0c3 100644 --- a/modules/config/theming/dracula.nix +++ b/modules/config/theming/dracula.nix @@ -149,16 +149,18 @@ in }; services = { dunst.settings = { - # Defines color of the frame around the notification window. - frame_color = "#282a36"; + global = { + # Defines color of the frame around the notification window. + frame_color = "#282a36"; - # Define a color for the separator. - # possible values are: - # * auto: dunst tries to find a color fitting to the background; - # * foreground: use the same color as the foreground; - # * frame: use the same color as the frame; - # * anything else will be interpreted as a X color. - separator_color = "frame"; + # Define a color for the separator. + # possible values are: + # * auto: dunst tries to find a color fitting to the background; + # * foreground: use the same color as the foreground; + # * frame: use the same color as the frame; + # * anything else will be interpreted as a X color. + separator_color = "frame"; + }; urgency_low = { background = "#282a36"; @@ -219,148 +221,202 @@ in }; }; }; - xdg.configFile."rofi/dracula.rasi".text = '' - * { - /* Dracula theme colour palette */ - drac-bgd: #282a36; - drac-cur: #44475a; - drac-fgd: #f8f8f2; - drac-cmt: #6272a4; - drac-cya: #8be9fd; - drac-grn: #50fa7b; - drac-ora: #ffb86c; - drac-pnk: #ff79c6; - drac-pur: #bd93f9; - drac-red: #ff5555; - drac-yel: #f1fa8c; + xdg.configFile = { + "fish/conf.d/theme.fish".text = '' + # Dracula Color Palette + set -l foreground f8f8f2 + set -l selection 44475a + set -l comment 6272a4 + set -l red ff5555 + set -l orange ffb86c + set -l yellow f1fa8c + set -l green 50fa7b + set -l purple bd93f9 + set -l cyan 8be9fd + set -l pink ff79c6 - font: "FiraCode Nerd Font Mono 13"; + # Syntax Highlighting Colors + set -gx fish_color_normal $foreground + set -gx fish_color_command $cyan + set -gx fish_color_keyword $pink + set -gx fish_color_quote $yellow + set -gx fish_color_redirection $foreground + set -gx fish_color_end $orange + set -gx fish_color_error $red + set -gx fish_color_param $purple + set -gx fish_color_comment $comment + set -gx fish_color_selection --background=$selection + set -gx fish_color_search_match --background=$selection + set -gx fish_color_operator $green + set -gx fish_color_escape $pink + set -gx fish_color_autosuggestion $comment + set -gx fish_color_cancel $red --reverse + set -gx fish_color_option $orange - foreground: @drac-fgd; - background-color: @drac-bgd; - active-background: @drac-pnk; - urgent-foreground: @foreground; - urgent-background: @drac-red; + # Default Prompt Colors + set -gx fish_color_cwd $green + set -gx fish_color_host $purple + set -gx fish_color_host_remote $purple + set -gx fish_color_user $cyan - selected-background: @active-background; - selected-urgent-background: @urgent-background; - selected-active-background: @active-background; - separatorcolor: @active-background; - bordercolor: #6272a4; - } + # Completion Pager Colors + set -gx fish_pager_color_progress $comment + set -gx fish_pager_color_background + set -gx fish_pager_color_prefix $cyan + set -gx fish_pager_color_completion $foreground + set -gx fish_pager_color_description $comment + set -gx fish_pager_color_selected_background --background=$selection + set -gx fish_pager_color_selected_prefix $cyan + set -gx fish_pager_color_selected_completion $foreground + set -gx fish_pager_color_selected_description $comment + set -gx fish_pager_color_secondary_background + set -gx fish_pager_color_secondary_prefix $cyan + set -gx fish_pager_color_secondary_completion $foreground + set -gx fish_pager_color_secondary_description $comment + ''; + "rofi/dracula.rasi".text = '' + * { + /* Dracula theme colour palette */ + drac-bgd: #282a36; + drac-cur: #44475a; + drac-fgd: #f8f8f2; + drac-cmt: #6272a4; + drac-cya: #8be9fd; + drac-grn: #50fa7b; + drac-ora: #ffb86c; + drac-pnk: #ff79c6; + drac-pur: #bd93f9; + drac-red: #ff5555; + drac-yel: #f1fa8c; - #window { - background-color: @background-color; - border: 3; - border-radius: 6; - border-color: @bordercolor; - padding: 5; - } - #mainbox { - border: 0; - padding: 5; - } - #message { - border: 1px dash 0px 0px ; - border-color: @separatorcolor; - padding: 1px ; - } - #textbox { - text-color: @foreground; - } - #listview { - fixed-height: 0; - border: 2px dash 0px 0px ; - border-color: @bordercolor; - spacing: 2px ; - scrollbar: false; - padding: 2px 0px 0px ; - } - #element { - border: 0; - padding: 1px ; - } - #element.normal.normal { - background-color: @background-color; - text-color: @foreground; - } - #element.normal.urgent { - background-color: @urgent-background; - text-color: @urgent-foreground; - } - #element.normal.active { - background-color: @active-background; - text-color: @background-color; - } - #element.selected.normal { - background-color: @selected-background; - text-color: @foreground; - } - #element.selected.urgent { - background-color: @selected-urgent-background; - text-color: @foreground; - } - #element.selected.active { - background-color: @selected-active-background; - text-color: @background-color; - } - #element.alternate.normal { - background-color: @background-color; - text-color: @foreground; - } - #element.alternate.urgent { - background-color: @urgent-background; - text-color: @foreground; - } - #element.alternate.active { - background-color: @active-background; - text-color: @foreground; - } - #scrollbar { - width: 2px ; - border: 0; - handle-width: 8px ; - padding: 0; - } - #sidebar { - border: 2px dash 0px 0px ; - border-color: @separatorcolor; - } - #button.selected { - background-color: @selected-background; - text-color: @foreground; - } - #inputbar { - spacing: 0; - text-color: @foreground; - padding: 1px ; - } - #case-indicator { - spacing: 0; - text-color: @foreground; - } - #entry { - spacing: 0; - text-color: @drac-cya; - } - #prompt { - spacing: 0; - text-color: @drac-grn; - } - #inputbar { - children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; - } - #textbox-prompt-colon { - expand: false; - str: ":"; - margin: 0px 0.3em 0em 0em ; - text-color: @drac-grn; - } - element-text, element-icon { - background-color: inherit; - text-color: inherit; - } - ''; + font: "FiraCode Nerd Font Mono 13"; + + foreground: @drac-fgd; + background-color: @drac-bgd; + active-background: @drac-pnk; + urgent-foreground: @foreground; + urgent-background: @drac-red; + + selected-background: @active-background; + selected-urgent-background: @urgent-background; + selected-active-background: @active-background; + separatorcolor: @active-background; + bordercolor: #6272a4; + } + + #window { + background-color: @background-color; + border: 3; + border-radius: 6; + border-color: @bordercolor; + padding: 5; + } + #mainbox { + border: 0; + padding: 5; + } + #message { + border: 1px dash 0px 0px ; + border-color: @separatorcolor; + padding: 1px ; + } + #textbox { + text-color: @foreground; + } + #listview { + fixed-height: 0; + border: 2px dash 0px 0px ; + border-color: @bordercolor; + spacing: 2px ; + scrollbar: false; + padding: 2px 0px 0px ; + } + #element { + border: 0; + padding: 1px ; + } + #element.normal.normal { + background-color: @background-color; + text-color: @foreground; + } + #element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; + } + #element.normal.active { + background-color: @active-background; + text-color: @background-color; + } + #element.selected.normal { + background-color: @selected-background; + text-color: @foreground; + } + #element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @foreground; + } + #element.selected.active { + background-color: @selected-active-background; + text-color: @background-color; + } + #element.alternate.normal { + background-color: @background-color; + text-color: @foreground; + } + #element.alternate.urgent { + background-color: @urgent-background; + text-color: @foreground; + } + #element.alternate.active { + background-color: @active-background; + text-color: @foreground; + } + #scrollbar { + width: 2px ; + border: 0; + handle-width: 8px ; + padding: 0; + } + #sidebar { + border: 2px dash 0px 0px ; + border-color: @separatorcolor; + } + #button.selected { + background-color: @selected-background; + text-color: @foreground; + } + #inputbar { + spacing: 0; + text-color: @foreground; + padding: 1px ; + } + #case-indicator { + spacing: 0; + text-color: @foreground; + } + #entry { + spacing: 0; + text-color: @drac-cya; + } + #prompt { + spacing: 0; + text-color: @drac-grn; + } + #inputbar { + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; + } + #textbox-prompt-colon { + expand: false; + str: ":"; + margin: 0px 0.3em 0em 0em ; + text-color: @drac-grn; + } + element-text, element-icon { + background-color: inherit; + text-color: inherit; + } + ''; + }; }; }; } From b2abaa7c40661010a971e516807aea306d7722f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 7 Sep 2022 19:19:26 +0200 Subject: [PATCH 05/58] :rocket: add tray service to start polybar --- modules/programs/bspwm/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/programs/bspwm/default.nix b/modules/programs/bspwm/default.nix index 7c0d4a4..314a37b 100644 --- a/modules/programs/bspwm/default.nix +++ b/modules/programs/bspwm/default.nix @@ -51,7 +51,6 @@ in focus_follows_pointer = true; }; startupPrograms = [ - "${pkgs.systemd}/bin/systemctl --user start polybar.service" "randomWallpaper" "${pkgs.synology-drive-client}/bin/synology-drive" ]; @@ -72,6 +71,15 @@ in ''; }; }; + systemd.user.targets.tray = { + Unit = { + Description = "Bspwm Tray Target"; + After = [ "graphical-session.target" ]; + }; + Install = { + WantedBy = [ "graphical-session.target" ]; + }; + }; home.packages = with pkgs; [ bc # HACK to get bsp-layout to work From a793a65fbdbec8ccbb6c7d0a775293e49883159a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 8 Sep 2022 21:20:49 +0200 Subject: [PATCH 06/58] :lock: update inputs --- flake.lock | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/flake.lock b/flake.lock index 91f8b76..194284b 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1652712410, - "narHash": "sha256-hMJ2TqLt0DleEnQFGUHK9sV2aAzJPU8pZeiZoqRozbE=", + "lastModified": 1662241716, + "narHash": "sha256-urqPvSvvGUhkwzTDxUI8N1nsdMysbAfjmBNZaTYBZRU=", "owner": "ryantm", "repo": "agenix", - "rev": "7e5e58b98c3dcbf497543ff6f22591552ebfe65b", + "rev": "c96da5835b76d3d8e8d99a0fec6fe32f8539ee2e", "type": "github" }, "original": { @@ -23,11 +23,11 @@ "arkenfox-userjs": { "flake": false, "locked": { - "lastModified": 1659264624, - "narHash": "sha256-iONF1YbWlW99k71lIUA/hw5+Rv1kf5M3mCItW6JmjbI=", + "lastModified": 1661276035, + "narHash": "sha256-9jZuUOeIfDQF7YwFOxSREZGWaIR9qpyTtr+cEnMk3EI=", "owner": "arkenfox", "repo": "user.js", - "rev": "6e53e841f78c512f4d1eedb6a2409df746eea979", + "rev": "06bfef8fd155fdf62e409c30cd1d68572f0c8b41", "type": "github" }, "original": { @@ -120,11 +120,11 @@ ] }, "locked": { - "lastModified": 1660732240, - "narHash": "sha256-u3/pq8k7t9FHFEtArNinHs8ovY4hkFFuwB+zFX7FfIQ=", + "lastModified": 1662502665, + "narHash": "sha256-2Ok8NSGmGP+qLCsDfIsUWyMNqLWt8U4Lcu86KbjgN9s=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "8a8ab5655af3e7a741b8230a2c36453622ea330d", + "rev": "ae5528c72a1e1afbbcb7be7e813f4b3598f919ed", "type": "github" }, "original": { @@ -218,11 +218,11 @@ "utils": "utils_2" }, "locked": { - "lastModified": 1660574517, - "narHash": "sha256-Lp5D2pAPrM3iAc1eeR0iGwz5rM+SYOWzVxI3p17nlrU=", + "lastModified": 1662472236, + "narHash": "sha256-epA5KzVUxw9ZV+st2aU4oFfJGyIcYleTpX28wsCQQP4=", "owner": "nix-community", "repo": "home-manager", - "rev": "688e5c85b7537f308b82167c8eb4ecfb70a49861", + "rev": "de94878b6b83f7f2cfda9cdff005417a6d7ac82c", "type": "github" }, "original": { @@ -233,11 +233,11 @@ }, "master": { "locked": { - "lastModified": 1660737173, - "narHash": "sha256-GIoZbN7ZWzQZu0NnnNgawIivtZlA8gER2gOrniZXyic=", + "lastModified": 1662568909, + "narHash": "sha256-ukn8fVka6+/vsQd0IyEPVNr+NBZXWZAW37z+DOCGTMw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c085fe3e5ae411bcce050e61a84b418e38c8235b", + "rev": "0446732359536566de33d8893bd4c682174e31e2", "type": "github" }, "original": { @@ -270,11 +270,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1660639432, - "narHash": "sha256-2WDiboOCfB0LhvnDVMXOAr8ZLDfm3WdO54CkoDPwN1A=", + "lastModified": 1662096612, + "narHash": "sha256-R+Q8l5JuyJryRPdiIaYpO5O3A55rT+/pItBrKcy7LM4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6c6409e965a6c883677be7b9d87a95fab6c3472e", + "rev": "21de2b973f9fee595a7a1ac4693efff791245c34", "type": "github" }, "original": { @@ -304,11 +304,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1659629599, - "narHash": "sha256-c9rvaqaH3HZo/C70E7rB18YSywa4ryTtN7CZ3cuCmoA=", + "lastModified": 1660830093, + "narHash": "sha256-HUhx3a82C7bgp2REdGFeHJdhEAzMGCk3V8xIvfBqg1I=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "6a9402e8f233de16536349d1dd3f4595c23386a4", + "rev": "8cb8ea5f1c7bc2984f460587fddd5f2e558f6eb8", "type": "github" }, "original": { @@ -337,11 +337,11 @@ }, "stable": { "locked": { - "lastModified": 1660581366, - "narHash": "sha256-et+bi9/jlSF/pHx5AYB9ZP2XDdZEQ0vnF7xlvs4503Y=", + "lastModified": 1662099760, + "narHash": "sha256-MdZLCTJPeHi/9fg6R9fiunyDwP3XHJqDd51zWWz9px0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3d47bbaa26e7a771059d828eecf3bd8bf28a8b0f", + "rev": "67e45078141102f45eff1589a831aeaa3182b41e", "type": "github" }, "original": { From 88042fbeeca5bdd76360085c9e99cc8de4593085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 27 Sep 2022 14:10:24 +0200 Subject: [PATCH 07/58] :rocket: add mullvad --- modules/profiles/desktop.nix | 1 + modules/services/default.nix | 1 + modules/services/mullvad.nix | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 modules/services/mullvad.nix diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index 0588d7e..320beb0 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -88,6 +88,7 @@ with lib; { services = { dunst.enable = true; kdeconnect.enable = true; + mullvad.enable = true; openconnect.enable = true; openvpn.enable = true; picom.enable = true; diff --git a/modules/services/default.nix b/modules/services/default.nix index 0dc2d3d..4d2b238 100644 --- a/modules/services/default.nix +++ b/modules/services/default.nix @@ -6,6 +6,7 @@ imports = [ ./dunst.nix ./kdeconnect.nix + ./mullvad.nix ./openconnect.nix ./openvpn.nix ./picom.nix diff --git a/modules/services/mullvad.nix b/modules/services/mullvad.nix new file mode 100644 index 0000000..dac4f74 --- /dev/null +++ b/modules/services/mullvad.nix @@ -0,0 +1,26 @@ +{ config +, lib +, pkgs +, ... +}: + +with lib; +let + cfg = config.my.services.mullvad; +in +{ + options.my.services.mullvad = { + enable = mkOption { + default = false; + type = types.bool; + example = true; + }; + }; + + config = lib.mkIf cfg.enable { + services.mullvad-vpn.enable = true; + users.users.moritz.packages = with pkgs; [ + mullvad-vpn + ]; + }; +} From 2feb9347043a3e12edf828c424135bde868f2465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 27 Sep 2022 14:10:53 +0200 Subject: [PATCH 08/58] :rocket: update hardware-configurations --- hosts/nixos-desktop/hardware-configuration.nix | 14 ++++---------- hosts/nixos-laptop/hardware-configuration.nix | 10 +++++----- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/hosts/nixos-desktop/hardware-configuration.nix b/hosts/nixos-desktop/hardware-configuration.nix index dc6bd93..fab68a6 100644 --- a/hosts/nixos-desktop/hardware-configuration.nix +++ b/hosts/nixos-desktop/hardware-configuration.nix @@ -17,7 +17,7 @@ fileSystems."/" = { device = "/dev/disk/by-uuid/668a49b3-d169-461f-861d-0c3e6a1642d1"; fsType = "btrfs"; - options = [ "subvol=root" ]; + options = [ "subvol=root" "compress=zstd" ]; }; boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/30025a9f-44cf-4074-8ae2-d4925efd67dd"; @@ -25,25 +25,19 @@ fileSystems."/home" = { device = "/dev/disk/by-uuid/668a49b3-d169-461f-861d-0c3e6a1642d1"; fsType = "btrfs"; - options = [ "subvol=home" ]; + options = [ "subvol=home" "compress=zstd" ]; }; fileSystems."/nix" = { device = "/dev/disk/by-uuid/668a49b3-d169-461f-861d-0c3e6a1642d1"; fsType = "btrfs"; - options = [ "subvol=nix" ]; - }; - - fileSystems."/persist" = { - device = "/dev/disk/by-uuid/668a49b3-d169-461f-861d-0c3e6a1642d1"; - fsType = "btrfs"; - options = [ "subvol=persist" ]; + options = [ "subvol=nix" "compress=zstd" ]; }; fileSystems."/var/log" = { device = "/dev/disk/by-uuid/668a49b3-d169-461f-861d-0c3e6a1642d1"; fsType = "btrfs"; - options = [ "subvol=log" ]; + options = [ "subvol=log" "compress=zstd" ]; neededForBoot = true; }; diff --git a/hosts/nixos-laptop/hardware-configuration.nix b/hosts/nixos-laptop/hardware-configuration.nix index b0c8aa8..0a7d47b 100644 --- a/hosts/nixos-laptop/hardware-configuration.nix +++ b/hosts/nixos-laptop/hardware-configuration.nix @@ -17,7 +17,7 @@ fileSystems."/" = { device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154"; fsType = "btrfs"; - options = [ "subvol=root" ]; + options = [ "subvol=root" "compress=zstd" ]; }; boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/078b81ba-238e-471d-9951-b743588532b8"; @@ -25,14 +25,14 @@ fileSystems."/log" = { device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154"; fsType = "btrfs"; - options = [ "subvol=log" ]; + options = [ "subvol=log" "compress=zstd" ]; neededForBoot = true; }; fileSystems."/nix" = { device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154"; fsType = "btrfs"; - options = [ "subvol=nix" ]; + options = [ "subvol=nix" "compress=zstd" ]; }; fileSystems."/boot" = { @@ -43,13 +43,13 @@ fileSystems."/persist" = { device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154"; fsType = "btrfs"; - options = [ "subvol=persist" ]; + options = [ "subvol=persist" "compress=zstd" ]; }; fileSystems."/home" = { device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154"; fsType = "btrfs"; - options = [ "subvol=home" ]; + options = [ "subvol=home" "compress=zstd" ]; }; swapDevices = [{ device = "/dev/disk/by-uuid/29ebf65f-e6ca-4625-9f72-a9321152be1b"; }]; From 586f6ba6b68873aa36f957183114249a57e2c2c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 27 Sep 2022 14:11:35 +0200 Subject: [PATCH 09/58] :bug: fix emacs ledger xcat not working --- modules/programs/ledger/default.nix | 31 ++++++++++++++++------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/modules/programs/ledger/default.nix b/modules/programs/ledger/default.nix index 3efcfab..29f8ee6 100644 --- a/modules/programs/ledger/default.nix +++ b/modules/programs/ledger/default.nix @@ -18,13 +18,22 @@ in }; config = mkIf cfg.enable { - my.shell.aliases = { - bal = "ledger bal"; - balcash = "ledger bal -R -X € --current --flat ^assets:bank ^liabilities"; - balnet = "ledger bal -R -X € --current --depth 2 ^assets ^liabilities"; - bud = ''ledger --budget --unbudgeted bal ^expenses -p "this month"''; - budr = ''ledger --budget reg -p "this month" ^expenses''; - reg = "ledger reg -R -V --tail 15"; + my.shell = { + variables = { + LEDGER_FILE = "/home/moritz/Nextcloud/Notes/ledger/main.ledger"; + }; + aliases = + let + applyCommon = name: command: "${command} --payee note --strict --explicit"; + in + mapAttrs applyCommon { + bal = "ledger bal"; + balcash = "ledger bal -R -X € --current --flat ^assets:bank ^liabilities"; + balnet = "ledger bal -R -X € --current --depth 2 ^assets ^liabilities"; + bud = ''ledger bal --budget --unbudgeted -p "this month"''; + budr = ''ledger reg --budget --unbudgeted -p "this month"''; + reg = "ledger reg -R -V --tail 15"; + }; }; home-manager.users.moritz = { home.packages = with pkgs; let @@ -40,17 +49,11 @@ in ''; }; in - [ ledger reg-copy ]; + [ ledger reg-copy hledger hledger-ui hledger-web ]; xdg.configFile = { "fish/completions/ledger.fish" = { text = builtins.readFile ./ledger.fish; }; - "ledger/ledgerrc".text = '' - --strict - --explicit - --payee note - --file ~/Notes/ledger/main.ledger - ''; }; }; }; From d8d763575a0d94c9077ea45f54b5eae7705043a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 6 Oct 2022 20:31:23 +0200 Subject: [PATCH 10/58] :bug: fix emacs ledger xcat not working --- modules/programs/ledger/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/programs/ledger/default.nix b/modules/programs/ledger/default.nix index 29f8ee6..a219fd6 100644 --- a/modules/programs/ledger/default.nix +++ b/modules/programs/ledger/default.nix @@ -50,9 +50,11 @@ in }; in [ ledger reg-copy hledger hledger-ui hledger-web ]; - xdg.configFile = { - "fish/completions/ledger.fish" = { - text = builtins.readFile ./ledger.fish; + home-manager.users.moritz = { + xdg.configFile = { + "fish/completions/ledger.fish" = { + text = builtins.readFile ./ledger.fish; + }; }; }; }; From 4988dd62786309a9efa027396336e4a9caa6191a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 27 Sep 2022 14:12:50 +0200 Subject: [PATCH 11/58] :sparkles: cleanup utils inputs --- flake.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index b833ccf..e1a7416 100644 --- a/flake.nix +++ b/flake.nix @@ -12,10 +12,7 @@ pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; - utils = { - url = "github:gytis-ivaskevicius/flake-utils-plus"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + utils.url = "github:gytis-ivaskevicius/flake-utils-plus"; agenix = { url = "github:ryantm/agenix"; From 4f930b234618f7556584cd62b0ecbea9f520611c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 27 Sep 2022 14:14:01 +0200 Subject: [PATCH 12/58] :lock: update inputs --- flake.lock | 78 +++++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/flake.lock b/flake.lock index 194284b..99a2fec 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1662241716, - "narHash": "sha256-urqPvSvvGUhkwzTDxUI8N1nsdMysbAfjmBNZaTYBZRU=", + "lastModified": 1664140963, + "narHash": "sha256-pFxDtOLduRFlol0Y4ShE+soRQX4kbhaCNBtDOvx7ykw=", "owner": "ryantm", "repo": "agenix", - "rev": "c96da5835b76d3d8e8d99a0fec6fe32f8539ee2e", + "rev": "6acb1fe5f8597d5ce63fc82bc7fcac7774b1cdf0", "type": "github" }, "original": { @@ -23,11 +23,11 @@ "arkenfox-userjs": { "flake": false, "locked": { - "lastModified": 1661276035, - "narHash": "sha256-9jZuUOeIfDQF7YwFOxSREZGWaIR9qpyTtr+cEnMk3EI=", + "lastModified": 1662893183, + "narHash": "sha256-NyP/kJlV1Ai7os3gMqukKMdRSQ78GAjPCJkZDZtDdeo=", "owner": "arkenfox", "repo": "user.js", - "rev": "06bfef8fd155fdf62e409c30cd1d68572f0c8b41", + "rev": "3f09afdee07c5aea33f6dc4194e1425d6400a0d7", "type": "github" }, "original": { @@ -83,11 +83,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1656989878, - "narHash": "sha256-SvK+H9M62lhPvVRWfl7HGG0oRO90r1E8ju3PPp6A6N8=", + "lastModified": 1663284638, + "narHash": "sha256-rXAX14yB8v9BOG4ZsdGEedpZAnNqhQ4DtjQwzFX/TLY=", "owner": "nix-community", "repo": "comma", - "rev": "f5732a6e8871348bafa3139a2f0d9bb7bc34c076", + "rev": "c83ff3839983b3cb8deb407ff618ca12179de588", "type": "github" }, "original": { @@ -120,11 +120,11 @@ ] }, "locked": { - "lastModified": 1662502665, - "narHash": "sha256-2Ok8NSGmGP+qLCsDfIsUWyMNqLWt8U4Lcu86KbjgN9s=", + "lastModified": 1664251341, + "narHash": "sha256-1f0KvK1VA8tGK7RVYZv17vSJ6URyt8fs81kRGfzPK3Q=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "ae5528c72a1e1afbbcb7be7e813f4b3598f919ed", + "rev": "550ce5667fee8f74aa20ad6456720ed84ebdd241", "type": "github" }, "original": { @@ -197,11 +197,11 @@ "forgit-git": { "flake": false, "locked": { - "lastModified": 1660668993, - "narHash": "sha256-TSF4Vr5uf/+MVU4yCdIHNnwB7kkp4mF+hkhKtLqQvmk=", + "lastModified": 1663431390, + "narHash": "sha256-dz7HNm9+dgb2ibomdrYdtSUC+ksrYdRR5RjBxSmc9eI=", "owner": "wfxr", "repo": "forgit", - "rev": "3f50933f047510020428114551da0ee5cdfb32a3", + "rev": "49579b2d1f620db6a71d070b40416c1af8a32168", "type": "github" }, "original": { @@ -218,11 +218,11 @@ "utils": "utils_2" }, "locked": { - "lastModified": 1662472236, - "narHash": "sha256-epA5KzVUxw9ZV+st2aU4oFfJGyIcYleTpX28wsCQQP4=", + "lastModified": 1664273942, + "narHash": "sha256-PFQR1UJQs7a7eaH5YoCZky5dmxR5cjaKRK+MpPbR7YE=", "owner": "nix-community", "repo": "home-manager", - "rev": "de94878b6b83f7f2cfda9cdff005417a6d7ac82c", + "rev": "1f5ef2bb419a327fae28a83b50fab50959132c24", "type": "github" }, "original": { @@ -233,11 +233,11 @@ }, "master": { "locked": { - "lastModified": 1662568909, - "narHash": "sha256-ukn8fVka6+/vsQd0IyEPVNr+NBZXWZAW37z+DOCGTMw=", + "lastModified": 1664278750, + "narHash": "sha256-frpTZQ+QMS7Xwi3fQSYdUTKd5e4YnrrDcS4WT+fdpfI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0446732359536566de33d8893bd4c682174e31e2", + "rev": "ff346a442d1e5ec81b24c312c06fd134bcc9c088", "type": "github" }, "original": { @@ -254,11 +254,11 @@ ] }, "locked": { - "lastModified": 1653413650, - "narHash": "sha256-wojDHjb+eU80MPH+3HQaK0liUy8EgR95rvmCl24i58Y=", + "lastModified": 1662220400, + "narHash": "sha256-9o2OGQqu4xyLZP9K6kNe1pTHnyPz0Wr3raGYnr9AIgY=", "owner": "nix-community", "repo": "naersk", - "rev": "69daaceebe12c070cd5ae69ba38f277bbf033695", + "rev": "6944160c19cb591eb85bbf9b2f2768a935623ed3", "type": "github" }, "original": { @@ -270,11 +270,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1662096612, - "narHash": "sha256-R+Q8l5JuyJryRPdiIaYpO5O3A55rT+/pItBrKcy7LM4=", + "lastModified": 1664235386, + "narHash": "sha256-hlkYFCJ9VKZPRW50vtpHHq4h1PJrptD5BbdLOEp4Lyc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "21de2b973f9fee595a7a1ac4693efff791245c34", + "rev": "ea4a87537cfdc83eebcd1804a5ec51057018784f", "type": "github" }, "original": { @@ -304,11 +304,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1660830093, - "narHash": "sha256-HUhx3a82C7bgp2REdGFeHJdhEAzMGCk3V8xIvfBqg1I=", + "lastModified": 1663082609, + "narHash": "sha256-lmCCIu4dj59qbzkGKHQtolhpIEQMeAd2XUbXVPqgPYo=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "8cb8ea5f1c7bc2984f460587fddd5f2e558f6eb8", + "rev": "60cad1a326df17a8c6cf2bb23436609fdd83024e", "type": "github" }, "original": { @@ -337,11 +337,11 @@ }, "stable": { "locked": { - "lastModified": 1662099760, - "narHash": "sha256-MdZLCTJPeHi/9fg6R9fiunyDwP3XHJqDd51zWWz9px0=", + "lastModified": 1664178928, + "narHash": "sha256-+WVCZH/3Ifef4Da9N1tkGnmfX0QwtkJQz013QuImu10=", "owner": "nixos", "repo": "nixpkgs", - "rev": "67e45078141102f45eff1589a831aeaa3182b41e", + "rev": "b542cc75fa03a3a29350d4c3b69739e946268a93", "type": "github" }, "original": { @@ -353,11 +353,11 @@ }, "utils": { "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "owner": "numtide", "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", "type": "github" }, "original": { @@ -368,11 +368,11 @@ }, "utils_2": { "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "owner": "numtide", "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", "type": "github" }, "original": { From fff714f7aaef4b3bd18165f316309a3b4b08da97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 27 Sep 2022 18:02:09 +0200 Subject: [PATCH 13/58] :bug: fix issues from input update --- modules/programs/thunar.nix | 2 +- modules/services/picom.nix | 1 - overlays/default.nix | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/programs/thunar.nix b/modules/programs/thunar.nix index 20a3be7..99ba7b4 100644 --- a/modules/programs/thunar.nix +++ b/modules/programs/thunar.nix @@ -26,7 +26,7 @@ in ]; services.gvfs = { enable = true; - package = lib.mkForce pkgs.gnome3.gvfs; + package = lib.mkForce pkgs.gnome.gvfs; }; }; } diff --git a/modules/services/picom.nix b/modules/services/picom.nix index 4c41830..1b0b863 100644 --- a/modules/services/picom.nix +++ b/modules/services/picom.nix @@ -45,7 +45,6 @@ in # needed for nvidia with glx backend xrender-sync-fence = true; }; - experimentalBackends = true; inactiveOpacity = 0.97; opacityRules = [ "100:fullscreen" "100:class_g = 'Polybar'" ]; vSync = true; diff --git a/overlays/default.nix b/overlays/default.nix index 5f8d1a9..dc2ac76 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,6 +1,7 @@ { inputs }: final: prev: { inherit (inputs.comma.packages."${prev.system}") comma; nixpkgs-review-checks = inputs.nixpkgs-review-checks.defaultPackage."${prev.system}"; + kdeconnect = prev.plasma5Packages.kdeconnect-kde; agenix = inputs.agenix.defaultPackage."${prev.system}"; master = import inputs.master { inherit (prev) system; From aa42f6678e2f279e0425a2d49defcda120815638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 27 Sep 2022 18:02:45 +0200 Subject: [PATCH 14/58] :sparkles: rework email module --- hosts/nixos-desktop/default.nix | 6 ---- hosts/nixos-laptop/default.nix | 6 ---- modules/config/default.nix | 1 - modules/config/email.nix | 50 -------------------------------- modules/profiles/desktop.nix | 1 + modules/programs/default.nix | 1 + modules/programs/email.nix | 25 ++++++++++++++++ secrets/email-desktop.age | Bin 771 -> 0 bytes secrets/email-laptop.age | 15 ---------- secrets/secrets.nix | 2 -- 10 files changed, 27 insertions(+), 80 deletions(-) delete mode 100644 modules/config/email.nix create mode 100644 modules/programs/email.nix delete mode 100644 secrets/email-desktop.age delete mode 100644 secrets/email-laptop.age diff --git a/hosts/nixos-desktop/default.nix b/hosts/nixos-desktop/default.nix index 9a1fa86..a3c800a 100644 --- a/hosts/nixos-desktop/default.nix +++ b/hosts/nixos-desktop/default.nix @@ -14,12 +14,6 @@ # KERNEL boot.kernelPackages = pkgs.linuxPackages_latest; - # MY MODULES - my.email = { - enable = true; - passwordFile = ../../secrets/email-desktop.age; - }; - # BOOT boot = { supportedFilesystems = [ "btrfs" "ntfs" ]; diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index f6012e9..22ca98f 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -11,12 +11,6 @@ ./hardware-configuration.nix ]; - # MY MODULES - my.email = { - enable = true; - passwordFile = ../../secrets/email-desktop.age; - }; - # BOOT boot = { supportedFilesystems = [ "btrfs" ]; diff --git a/modules/config/default.nix b/modules/config/default.nix index 2e34077..7312bcb 100644 --- a/modules/config/default.nix +++ b/modules/config/default.nix @@ -7,7 +7,6 @@ { imports = [ ./bin - ./email.nix ./nix.nix ./shell.nix ./theming diff --git a/modules/config/email.nix b/modules/config/email.nix deleted file mode 100644 index 0801a75..0000000 --- a/modules/config/email.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ config -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.email; - name = "Moritz Böhme"; - email = "mail@moritzboeh.me"; - mailDirectory = "/home/moritz/.mail"; -in -{ - options.my.email = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - passwordFile = mkOption { - default = null; - type = types.path; - description = "File containing the email password."; - }; - }; - - config = mkIf cfg.enable { - # Protonbridge Setup - environment.systemPackages = with pkgs; [ protonmail-bridge ]; - systemd.user.services.protonmail-bridge = { - description = "Protonmail Bridge"; - enable = true; - script = "${pkgs.protonmail-bridge}/bin/protonmail-bridge --log-level debug"; - path = [ - pkgs.gnome3.gnome-keyring - ]; # HACK: https://github.com/ProtonMail/proton-bridge/issues/176 - wantedBy = [ "graphical-session.target" ]; - partOf = [ "graphical-session.target" ]; - }; - age.secrets.email = { - file = cfg.passwordFile; - owner = "1000"; - }; - - # Email Applications - home-manager.users.moritz.home.packages = with pkgs; [ thunderbird ]; - networking.firewall.allowedTCPPorts = [ 33728 1025 1143 ]; - }; -} diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index 320beb0..f22621f 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -23,6 +23,7 @@ with lib; { bspwm.enable = true; code.enable = true; emacs.enable = true; + email.enable = true; firefox = { enable = true; arkenfox = { diff --git a/modules/programs/default.nix b/modules/programs/default.nix index bdc63b1..3033d19 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -11,6 +11,7 @@ ./code.nix ./direnv.nix ./emacs.nix + ./email.nix ./firefox.nix ./fish.nix ./git.nix diff --git a/modules/programs/email.nix b/modules/programs/email.nix new file mode 100644 index 0000000..4717780 --- /dev/null +++ b/modules/programs/email.nix @@ -0,0 +1,25 @@ +{ config +, lib +, pkgs +, ... +}: + +with lib; +let + cfg = config.my.programs.email; +in +{ + options.my.programs.email = { + enable = mkOption { + default = false; + type = types.bool; + example = true; + }; + }; + + config = mkIf cfg.enable { + # Email Applications + users.users.moritz.packages = with pkgs; [ thunderbird ]; + networking.firewall.allowedTCPPorts = [ 33728 1025 1143 ]; + }; +} diff --git a/secrets/email-desktop.age b/secrets/email-desktop.age deleted file mode 100644 index 3d5245b6f5b1417aab6580303e47bde280788ec9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 771 zcmZY6yQY+t zImQBBlZRp@^C~3>H9a0u;iZ(*tBRP*eyy4vRLoT}JIu@V7-EqKlSyYz+lr-~D1agG z7JGZHd)5k}l5bWqjD}`Ui8<}IW-dKBgZNTZZFp{n+g92NV8G|oX_`(d-LQu8G(3i$ z#y|n`Q;sk(Xau!LFgZnCy0Q;al#dMCa}{oi9m zs{!1K98D=Fe_!0z)?Uc2A+8W%w5S@%vKe=yXI8}T(ZP`pnE^M8UTg4{T;;%V6a`^T zm(jqG7f1z-2EQ~ z@BJ z{NJ1W@PTy2@qJiEeih-!&+gAd`G;Pmy|6ZP)q ssh-ed25519 CjuqfA 42ZhJgcVV9rxkVmvEj4aCeeVx4Tldtx2L54hS1mZCxE -dqSOKoGxChgMHmiY4SgoJqxH9nSGlLVnmbke2+xZHYA --> ssh-ed25519 QRYDmg yHGmTle30O7BQ7SFG7m5gaZctmwT26LNfJPbocs1WTM -lQZa4yp8R8UZpG+/JGuZ4z4gxlGXColGCs8qlKFyCP4 --> ssh-ed25519 wG6LYg wokwDVXoQaZlpX4qM/2OmSo9lbDFIqqg/dKesIETJBI -0MBgUClVsQksxRCa4WhSvQlzZRl673CZeeP7PVfHtCI --> ssh-ed25519 ZYd7Zg cGYmLN+nSv5NGR+HMbofhtzbmZ/LjftCpcUIbZ5Z+hY -3u9UgW7TDWX+dfuJuIwRxSkwTOLrUw1znEkU9ao5Ltw --> ssh-ed25519 as9VYQ dK/VaOUKsr58sTfiF3qjUPHi3mxfioW5IXkyMmx+xCY -mTF8kUni1pxBrcE+j4mHZx/Zs8D8SgqWjfRkDH66m5k --> Pzw,"-grease R`h7fZ+ 'U[<2@ `Ay6[ -3a6T ---- I5udQOeevThPQ3VGfarWDe+n1y1DnC1vNqd+hU53ENw - ǻ@C wWLous fzb+4 \ No newline at end of file diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 375fd0e..90e1b43 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -13,8 +13,6 @@ in { "nordvpn.age".publicKeys = all; "spotifyd.age".publicKeys = all; - "email-desktop.age".publicKeys = all; - "email-laptop.age".publicKeys = all; "home-vpn.age".publicKeys = all; "home-vpn-password.age".publicKeys = all; "github.age".publicKeys = all; From 85de3b3ac6fc8466be5135a452cb7b18ad843231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 6 Oct 2022 20:32:21 +0200 Subject: [PATCH 15/58] :sparkles: make use of systemPackage --- modules/profiles/desktop.nix | 1 - modules/programs/bspwm/default.nix | 19 ++-- modules/programs/emacs.nix | 128 +++++++++++----------- modules/programs/fish.nix | 2 +- modules/programs/ledger/default.nix | 36 +++--- modules/programs/rofi/default.nix | 10 +- modules/programs/spotify.nix | 2 +- modules/virtualisation/virtualisation.nix | 2 +- 8 files changed, 97 insertions(+), 103 deletions(-) diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index f22621f..62fd2b8 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -85,7 +85,6 @@ with lib; { thunar.enable = true; zathura.enable = true; }; - services = { dunst.enable = true; kdeconnect.enable = true; diff --git a/modules/programs/bspwm/default.nix b/modules/programs/bspwm/default.nix index 314a37b..dff5175 100644 --- a/modules/programs/bspwm/default.nix +++ b/modules/programs/bspwm/default.nix @@ -80,16 +80,15 @@ in WantedBy = [ "graphical-session.target" ]; }; }; - - home.packages = with pkgs; [ - bc # HACK to get bsp-layout to work - brightnessctl - bsp-layout - feh - pamixer - playerctl - synology-drive-client - ]; }; + environment.systemPackages = with pkgs; [ + bc # HACK to get bsp-layout to work + brightnessctl + bsp-layout + feh + pamixer + playerctl + synology-drive-client + ]; }; } diff --git a/modules/programs/emacs.nix b/modules/programs/emacs.nix index 1a2a7d1..41faef0 100644 --- a/modules/programs/emacs.nix +++ b/modules/programs/emacs.nix @@ -24,78 +24,76 @@ in emacs = "emacsclient -t -a 'emacs -t'"; }; fonts.fonts = [ pkgs.emacs-all-the-icons-fonts ]; + environment.systemPackages = with pkgs; [ + ### Emacs itself + binutils # native-comp needs 'as', provided by this + myEmacs + ### Doom dependencies + git + (ripgrep.override { withPCRE2 = true; }) + gnutls # for TLS connectivity + + ### Optional dependencies + fd # faster projectile indexing + imagemagick # for image-dired + zstd # for undo-fu-session/undo-tree compression + + ### Module dependencies + ## :checkers + # spell + (hunspellWithDicts [ + hunspellDicts.en_GB-ize + hunspellDicts.en_US + hunspellDicts.de_DE + ]) + + # grammar + languagetool + + ## : tools + # lookup & org +roam + sqlite + gcc # HACK to get emacsqlite binary + wordnet + graphviz + + ## :lang + # latex & org (latex previews) + stable.texlive.combined.scheme-full # HACK to fix broken perl package + texlab + + # nix + nixfmt # for formating nix + rnix-lsp + + # markdown & org +pandoc + pandoc + + # python + nodePackages.pyright + + # sh + nodePackages.bash-language-server + + ## :email + # mu4e + mu + isync + + ## :app + # everywhere + xdotool + xorg.xwininfo + xclip + xorg.xprop + ]; home-manager.users.moritz = { home.sessionPath = [ "/home/moritz/.config/emacs/bin/" ]; services.emacs = { enable = true; package = myEmacs; }; - - home.packages = with pkgs; [ - ### Emacs itself - binutils # native-comp needs 'as', provided by this - myEmacs - - ### Doom dependencies - git - (ripgrep.override { withPCRE2 = true; }) - gnutls # for TLS connectivity - - ### Optional dependencies - fd # faster projectile indexing - imagemagick # for image-dired - zstd # for undo-fu-session/undo-tree compression - - ### Module dependencies - ## :checkers - # spell - (hunspellWithDicts [ - hunspellDicts.en_GB-ize - hunspellDicts.en_US - hunspellDicts.de_DE - ]) - - # grammar - languagetool - - ## : tools - # lookup & org +roam - sqlite - gcc # HACK to get emacsqlite binary - wordnet - graphviz - - ## :lang - # latex & org (latex previews) - stable.texlive.combined.scheme-full # HACK to fix broken perl package - texlab - - # nix - nixfmt # for formating nix - rnix-lsp - - # markdown & org +pandoc - pandoc - - # python - nodePackages.pyright - - # sh - nodePackages.bash-language-server - - ## :email - # mu4e - mu - isync - - ## :app - # everywhere - xdotool - xorg.xwininfo - xclip - xorg.xprop - ]; }; }; } diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index d38f6d5..2db1fd4 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -25,6 +25,7 @@ in config = lib.mkIf cfg.enable { # set as default shell users.users.moritz.shell = pkgs.fish; + environment.systemPackages = with pkgs.fishPlugins; [ fzf-fish pisces ]; # needed for nix completions programs.fish.enable = true; @@ -88,7 +89,6 @@ in fzf.enableFishIntegration = true; starship.enableFishIntegration = true; }; - home.packages = with pkgs.fishPlugins; [ fzf-fish pisces ]; }; }; } diff --git a/modules/programs/ledger/default.nix b/modules/programs/ledger/default.nix index a219fd6..8ed7a1b 100644 --- a/modules/programs/ledger/default.nix +++ b/modules/programs/ledger/default.nix @@ -35,26 +35,24 @@ in reg = "ledger reg -R -V --tail 15"; }; }; + environment.systemPackages = with pkgs; let + reg-copy = writeShellApplication { + name = "reg-copy"; + + runtimeInputs = [ ledger xclip ]; + + text = '' + table="$(printf '%-10s %-30s %8s %8s\n' Datum Beschreibung Einzeln Gesamt && ledger reg -V --format '%10D %.30P %8t %8T\n' "$@")" + echo "$table" + echo "$table" | xclip -selection clipboard + ''; + }; + in + [ ledger reg-copy hledger hledger-ui hledger-web ]; home-manager.users.moritz = { - home.packages = with pkgs; let - reg-copy = writeShellApplication { - name = "reg-copy"; - - runtimeInputs = [ ledger xclip ]; - - text = '' - table="$(printf '%-10s %-30s %8s %8s\n' Datum Beschreibung Einzeln Gesamt && ledger reg -V --format '%10D %.30P %8t %8T\n' "$@")" - echo "$table" - echo "$table" | xclip -selection clipboard - ''; - }; - in - [ ledger reg-copy hledger hledger-ui hledger-web ]; - home-manager.users.moritz = { - xdg.configFile = { - "fish/completions/ledger.fish" = { - text = builtins.readFile ./ledger.fish; - }; + xdg.configFile = { + "fish/completions/ledger.fish" = { + text = builtins.readFile ./ledger.fish; }; }; }; diff --git a/modules/programs/rofi/default.nix b/modules/programs/rofi/default.nix index 28e7363..ec02515 100644 --- a/modules/programs/rofi/default.nix +++ b/modules/programs/rofi/default.nix @@ -52,6 +52,11 @@ in }; config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + (lib.mkIf config.networking.networkmanager.enable networkmanager_dmenu) + (lib.mkIf config.hardware.bluetooth.enable rofi-bluetooth) + rofi-power-menu + ]; home-manager.users.moritz = { programs.rofi = { enable = true; @@ -59,11 +64,6 @@ in pkgs.rofi.override { plugins = with pkgs; [ rofi-calc rofi-emoji ]; }; extraConfig = { combi-modi = "drun,window,emoji"; }; }; - home.packages = with pkgs; [ - (lib.mkIf config.networking.networkmanager.enable networkmanager_dmenu) - (lib.mkIf config.hardware.bluetooth.enable rofi-bluetooth) - rofi-power-menu - ]; xdg = { enable = true; configFile."networkmanager-dmenu/config.ini".text = '' diff --git a/modules/programs/spotify.nix b/modules/programs/spotify.nix index 283f9be..7010d7f 100644 --- a/modules/programs/spotify.nix +++ b/modules/programs/spotify.nix @@ -22,8 +22,8 @@ in file = ../../secrets/spotifyd.age; owner = "1000"; }; + environment.systemPackages = with pkgs; [ spotify-tui sptlrx ]; home-manager.users.moritz = { - home.packages = with pkgs; [ spotify-tui sptlrx ]; services.spotifyd = { enable = true; package = pkgs.spotifyd.override { withMpris = true; }; diff --git a/modules/virtualisation/virtualisation.nix b/modules/virtualisation/virtualisation.nix index 3326a40..bd84cda 100644 --- a/modules/virtualisation/virtualisation.nix +++ b/modules/virtualisation/virtualisation.nix @@ -22,7 +22,7 @@ in enable = true; package = pkgs.libvirt; }; - home-manager.users.moritz.home.packages = with pkgs; [ virt-manager ]; + environment.systemPackages = with pkgs; [ virt-manager ]; users.users.moritz.extraGroups = [ "libvirtd" ]; }; } From a7f9f05ccfd8985398c70fc0568208c0698838ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 6 Oct 2022 20:19:28 +0200 Subject: [PATCH 16/58] :bug: fix polybar battery module --- modules/config/theming/catppuccin.nix | 135 ++++++++++++++------------ modules/config/theming/default.nix | 3 + 2 files changed, 74 insertions(+), 64 deletions(-) diff --git a/modules/config/theming/catppuccin.nix b/modules/config/theming/catppuccin.nix index 33acbac..99ecea9 100644 --- a/modules/config/theming/catppuccin.nix +++ b/modules/config/theming/catppuccin.nix @@ -36,89 +36,88 @@ in { home-manager.users.moritz = { programs = { - kitty.extraConfig = - '' - # vim:ft=kitty + kitty.extraConfig = '' + # vim:ft=kitty - ## name: Catppuccin-Frappe - ## author: Pocco81 (https://github.com/Pocco81) - ## license: MIT - ## upstream: https://github.com/catppuccin/kitty/blob/main/frappe.conf - ## blurb: Soothing pastel theme for the high-spirited! + ## name: Catppuccin-Frappe + ## author: Pocco81 (https://github.com/Pocco81) + ## license: MIT + ## upstream: https://github.com/catppuccin/kitty/blob/main/frappe.conf + ## blurb: Soothing pastel theme for the high-spirited! - # The basic colors - foreground #${text} - background #${base} - selection_foreground #${base} - selection_background #${rosewater} + # The basic colors + foreground #${text} + background #${base} + selection_foreground #${base} + selection_background #${rosewater} - # Cursor colors - cursor #${rosewater} - cursor_text_color #${base} + # Cursor colors + cursor #${rosewater} + cursor_text_color #${base} - # URL underline color when hovering with mouse - url_color #${rosewater} + # URL underline color when hovering with mouse + url_color #${rosewater} - # Kitty window border colors - active_border_color #${lavender} - inactive_border_color #${overlay0} - bell_border_color #${yellow} + # Kitty window border colors + active_border_color #${lavender} + inactive_border_color #${overlay0} + bell_border_color #${yellow} - # OS Window titlebar colors - wayland_titlebar_color system - macos_titlebar_color system + # OS Window titlebar colors + wayland_titlebar_color system + macos_titlebar_color system - # Tab bar colors - active_tab_foreground #${crust} - active_tab_background #${mauve} - inactive_tab_foreground #${text} - inactive_tab_background #${mantle} - tab_bar_background #${crust} + # Tab bar colors + active_tab_foreground #${crust} + active_tab_background #${mauve} + inactive_tab_foreground #${text} + inactive_tab_background #${mantle} + tab_bar_background #${crust} - # Colors for marks (marked text in the terminal) - mark1_foreground #${base} - mark1_background #${lavender} - mark2_foreground #${base} - mark2_background #${mauve} - mark3_foreground #${base} - mark3_background #${sapphire} + # Colors for marks (marked text in the terminal) + mark1_foreground #${base} + mark1_background #${lavender} + mark2_foreground #${base} + mark2_background #${mauve} + mark3_foreground #${base} + mark3_background #${sapphire} - # The 16 terminal colors + # The 16 terminal colors - # black - color0 #${surface1} - color8 #${surface2} + # black + color0 #${surface1} + color8 #${surface2} - # red - color1 #${red} - color9 #${red} + # red + color1 #${red} + color9 #${red} - # green - color2 #${green} - color10 #${green} + # green + color2 #${green} + color10 #${green} - # yellow - color3 #${yellow} - color11 #${yellow} + # yellow + color3 #${yellow} + color11 #${yellow} - # blue - color4 #${blue} - color12 #${blue} + # blue + color4 #${blue} + color12 #${blue} - # magenta - color5 #${pink} - color13 #${pink} + # magenta + color5 #${pink} + color13 #${pink} - # cyan - color6 #${teal} - color14 #${teal} + # cyan + color6 #${teal} + color14 #${teal} - # white - color7 #${subtext1} - color15 #${subtext0} - ''; + # white + color7 #${subtext1} + color15 #${subtext0} + ''; zathura.extraConfig = '' set window-title-basename "true" set selection-clipboard "clipboard" @@ -253,6 +252,14 @@ in format-connected-foreground = base; format-connected-background = mauve; }; + "module/battery" = { + format-charging-foreground = base; + format-charging-background = green; + format-full-foreground = base; + format-full-background = green; + format-discharging-foreground = base; + format-discharging-background = red; + }; }; }; }; diff --git a/modules/config/theming/default.nix b/modules/config/theming/default.nix index ba2f6cf..882b3cc 100644 --- a/modules/config/theming/default.nix +++ b/modules/config/theming/default.nix @@ -74,8 +74,11 @@ in time-format = "%H:%M"; format-charging = " "; + format-charging-padding = 1; format-discharging = " "; + format-discharging-padding = 1; format-full = " "; + format-full-padding = 1; label-charging = "%percentage%% %time% remaining"; label-discharging = "%percentage%% %time% remaining"; From ad1cf2489b710b4aba67dc38ab4f111fcd38e348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 6 Oct 2022 20:19:59 +0200 Subject: [PATCH 17/58] :bug: fix missing groups --- modules/profiles/base.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index 921cb2c..8349bf8 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -9,7 +9,7 @@ with lib; users.users.moritz = { isNormalUser = true; home = "/home/moritz"; - extraGroups = [ "wheel" ]; # "networkmanager" "video" "dialout" + extraGroups = [ "wheel" "networkmanager" "video" ]; initialPassword = "password"; # CHANGE ME PLEASE openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGoAqa2m7hIzZ2LS96Z+RCIlRvhBM/j7h27tMBCwMT+a" # Moritz From 0e664ab358ef48d2c4be6e4c581acd5e756e4836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 6 Oct 2022 20:27:14 +0200 Subject: [PATCH 18/58] :bug: fix picom flickering --- modules/services/picom.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/services/picom.nix b/modules/services/picom.nix index 1b0b863..53b565c 100644 --- a/modules/services/picom.nix +++ b/modules/services/picom.nix @@ -30,6 +30,9 @@ in glx-no-rebind-pixmap = true; glx-no-stencil = true; + # against flicker + unredir-if-possible = false; + # fastest swap method glx-swap-method = 1; From 97f95b7a96dfb256beefa5c14aaf02cadb0a5cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 9 Oct 2022 20:49:35 +0200 Subject: [PATCH 19/58] :rocket: add howdy --- flake.lock | 115 ++++++++++++++++++++++++++++++--- flake.nix | 4 ++ hosts/nixos-laptop/default.nix | 5 ++ modules/profiles/base.nix | 18 +++--- modules/profiles/desktop.nix | 2 + modules/security/default.nix | 13 ---- 6 files changed, 127 insertions(+), 30 deletions(-) diff --git a/flake.lock b/flake.lock index 99a2fec..6edd3ac 100644 --- a/flake.lock +++ b/flake.lock @@ -165,6 +165,21 @@ } }, "flake-utils_2": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { "locked": { "lastModified": 1644229661, "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", @@ -179,7 +194,7 @@ "type": "github" } }, - "flake-utils_3": { + "flake-utils_4": { "locked": { "lastModified": 1644229661, "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", @@ -231,6 +246,27 @@ "type": "github" } }, + "howdy": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs", + "pre-commit-hooks": "pre-commit-hooks", + "utils": "utils_3" + }, + "locked": { + "lastModified": 1665340940, + "narHash": "sha256-6IIBGkD4spWRvMTEXRxWa31IerfVc1SSTruggY/lNR4=", + "ref": "refs/heads/main", + "rev": "17159cf269ce194703bc04671bb6d2378d124959", + "revCount": 3, + "type": "git", + "url": "https://git.sr.ht/~moritzboehme/howdy" + }, + "original": { + "type": "git", + "url": "https://git.sr.ht/~moritzboehme/howdy" + } + }, "master": { "locked": { "lastModified": 1664278750, @@ -269,6 +305,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1665266435, + "narHash": "sha256-vLhkXxNzAIvJNLyjm6fGe9Rwy/lsE9dc5MgV7w1EtCs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "8e8b0bd1fd99ac2bdca112f9e2431d7c80b1d655", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1664235386, "narHash": "sha256-hlkYFCJ9VKZPRW50vtpHHq4h1PJrptD5BbdLOEp4Lyc=", @@ -284,7 +336,7 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_3": { "locked": { "lastModified": 1645655918, "narHash": "sha256-ZfbEFRW7o237+A1P7eTKhXje435FCAoe0blj2n20Was=", @@ -300,8 +352,33 @@ }, "pre-commit-hooks": { "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2" + "flake-utils": [ + "howdy", + "flake-utils" + ], + "nixpkgs": [ + "howdy", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1664708386, + "narHash": "sha256-aCD8UUGNYb5nYzRmtsq/0yP9gFOQQHr/Lsb5vW+mucw=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "2e4a708918e14fdbd534cc94aaa9470cd19b2464", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "pre-commit-hooks_2": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1663082609, @@ -328,11 +405,12 @@ "emacs-overlay": "emacs-overlay", "forgit-git": "forgit-git", "home-manager": "home-manager", + "howdy": "howdy", "master": "master", - "nixpkgs": "nixpkgs", - "pre-commit-hooks": "pre-commit-hooks", + "nixpkgs": "nixpkgs_2", + "pre-commit-hooks": "pre-commit-hooks_2", "stable": "stable", - "utils": "utils_3" + "utils": "utils_4" } }, "stable": { @@ -383,7 +461,28 @@ }, "utils_3": { "inputs": { - "flake-utils": "flake-utils_3" + "flake-utils": [ + "howdy", + "flake-utils" + ] + }, + "locked": { + "lastModified": 1657226504, + "narHash": "sha256-GIYNjuq4mJlFgqKsZ+YrgzWm0IpA4axA3MCrdKYj7gs=", + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "rev": "2bf0f91643c2e5ae38c1b26893ac2927ac9bd82a", + "type": "github" + }, + "original": { + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "type": "github" + } + }, + "utils_4": { + "inputs": { + "flake-utils": "flake-utils_4" }, "locked": { "lastModified": 1657226504, diff --git a/flake.nix b/flake.nix index e1a7416..0354470 100644 --- a/flake.nix +++ b/flake.nix @@ -62,6 +62,8 @@ url = "github:SenchoPens/base16.nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + + howdy.url = "git+https://git.sr.ht/~moritzboehme/howdy"; }; outputs = @@ -84,6 +86,7 @@ self.overlays.default inputs.utils.overlay inputs.emacs-overlay.overlay + inputs.howdy.overlays.default ]; ############### @@ -108,6 +111,7 @@ } inputs.agenix.nixosModules.age inputs.base16.nixosModule + inputs.howdy.nixosModules.default ]; hosts.nixos-laptop.modules = [ diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index 22ca98f..8bb6c1d 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -11,6 +11,11 @@ ./hardware-configuration.nix ]; + services.howdy = { + enable = true; + certainty = 3.0; + }; + # BOOT boot = { supportedFilesystems = [ "btrfs" ]; diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index 8349bf8..17e35fc 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -25,7 +25,7 @@ with lib; shell = { abbreviations = { us = "systemctl --user"; - rs = "doas systemctl"; + rs = "sudo systemctl"; }; aliases = { ls = "exa -lh --icons --git"; @@ -34,8 +34,8 @@ with lib; rm = "rm -i"; mv = "mv -i"; - nix-switch = "doas nixos-rebuild switch --flake ~/.dotfiles"; - nix-boot = "doas nixos-rebuild boot --flake ~/.dotfiles"; + nix-switch = "sudo nixos-rebuild switch --flake ~/.dotfiles"; + nix-boot = "sudo nixos-rebuild boot --flake ~/.dotfiles"; nix-lock = "pushd ~/.dotfiles && nix flake update && popd"; latexwatch = ''find -type f -name "*.tex" | entr -c latexmk -pdf -silent''; @@ -110,6 +110,12 @@ with lib; (builtins.attrValues config.fileSystems)); }; + i18n.extraLocaleSettings = { + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; + home-manager.users.moritz = { programs = { # Let Home Manager install and manage itself. @@ -120,12 +126,6 @@ with lib; home = { username = "moritz"; homeDirectory = "/home/moritz"; - language = { - base = "en_US.UTF-8"; - time = "de_DE.UTF-8"; - numeric = "de_DE.UTF-8"; - paper = "de_DE.UTF-8"; - }; stateVersion = "21.05"; }; xdg.userDirs.enable = true; diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index 62fd2b8..962c48b 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -97,6 +97,8 @@ with lib; { }; }; + programs.xss-lock.enable = true; + environment.systemPackages = with pkgs; [ # nix nixpkgs-review diff --git a/modules/security/default.nix b/modules/security/default.nix index c877f90..3506583 100644 --- a/modules/security/default.nix +++ b/modules/security/default.nix @@ -68,19 +68,6 @@ # So we don't have to do this later... security.acme.acceptTerms = true; - # Enable doas as an alternative to sudo - security.doas = { - enable = lib.mkDefault true; - extraRules = [ - # Do not ask for a password again for some time after the user successfully authenticates. - { - groups = [ "wheel" "doas" ]; - persist = true; - } - ]; - }; - security.sudo.enable = !config.security.doas.enable; - # SSH services.openssh = { # Disable ssh password login From c327ef7aa50e48fcdeda40fe109efeaa3e4e1cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 9 Oct 2022 20:51:45 +0200 Subject: [PATCH 20/58] :rocket: explicitly enable fish module --- modules/profiles/base.nix | 1 + modules/programs/fish.nix | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index 17e35fc..ae26616 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -43,6 +43,7 @@ with lib; variables = { EDITOR = "vim"; }; }; programs = { + fish.enable = true; vim.enable = true; helix.enable = true; kakoune.enable = true; diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index 2db1fd4..8df6f75 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -16,9 +16,9 @@ in { options.my.programs.fish = { enable = mkOption { - default = true; + default = false; type = types.bool; - example = false; + example = true; }; }; From a63ffacbc0112187777788e92b30778d1eff2fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 9 Oct 2022 20:52:48 +0200 Subject: [PATCH 21/58] :rocket: use emacs from nixpkgs --- modules/programs/emacs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/emacs.nix b/modules/programs/emacs.nix index 41faef0..6544ed9 100644 --- a/modules/programs/emacs.nix +++ b/modules/programs/emacs.nix @@ -8,7 +8,7 @@ with lib; let cfg = config.my.programs.emacs; - myEmacs = with pkgs; ((emacsPackagesFor emacsUnstable).emacsWithPackages + myEmacs = with pkgs; ((emacsPackagesFor emacs).emacsWithPackages (epkgs: [ epkgs.vterm ])); in { From cff826549bffd5682f4bb27b58649886b9cc472a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 15 Oct 2022 18:21:12 +0200 Subject: [PATCH 22/58] :rocket: add logseq module --- modules/profiles/desktop.nix | 2 +- modules/programs/default.nix | 1 + modules/programs/logseq.nix | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 modules/programs/logseq.nix diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index 962c48b..63a09b3 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -79,6 +79,7 @@ with lib; { hub.enable = true; kitty.enable = true; ledger.enable = true; + logseq.enable = true; python.enable = true; rofi.enable = true; spotify.enable = true; @@ -114,7 +115,6 @@ with lib; { jellyfin-media-player keepassxc libreoffice - logseq pavucontrol signal-desktop tlaplusToolbox diff --git a/modules/programs/default.nix b/modules/programs/default.nix index 3033d19..e72d357 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -22,6 +22,7 @@ ./kakoune.nix ./kitty.nix ./ledger + ./logseq.nix ./python.nix ./rofi ./spotify.nix diff --git a/modules/programs/logseq.nix b/modules/programs/logseq.nix new file mode 100644 index 0000000..7d6fc03 --- /dev/null +++ b/modules/programs/logseq.nix @@ -0,0 +1,26 @@ +{ config +, lib +, pkgs +, ... +}: + +with lib; +let + cfg = config.my.programs.logseq; +in +{ + options.my.programs.logseq = { + enable = mkOption { + default = false; + type = types.bool; + example = true; + }; + }; + + config = mkIf cfg.enable { + users.users.moritz.packages = with pkgs; [ + logseq + ]; + xdg.mime.defaultApplications."x-scheme-handler/logseq" = "logseq.desktop"; + }; +} From c0d3ca1cf2708eeb6e1e5b6da5b19755c3a4e202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 15 Oct 2022 18:21:56 +0200 Subject: [PATCH 23/58] :rocket: add lazygit --- modules/profiles/base.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index ae26616..b41b3ab 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -83,13 +83,14 @@ with lib; exa gparted hub + hut + lazygit neofetch tmux ttyper up viu wget - hut ]; fonts.fonts = with pkgs; [ From a98589b6f8170b2b0bcefc275616a6bd87fe3c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 15 Oct 2022 19:05:51 +0200 Subject: [PATCH 24/58] :sparkles: prettify --- flake.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 0354470..0291ddd 100644 --- a/flake.nix +++ b/flake.nix @@ -67,11 +67,7 @@ }; outputs = - inputs @ { self - , nixpkgs - , utils - , ... - }: + inputs@{ self, nixpkgs, utils, ... }: utils.lib.mkFlake { inherit self inputs; @@ -98,6 +94,7 @@ ./modules/profiles/gaming.nix ./modules/profiles/desktop.nix ]; + hostDefaults.modules = [ ./modules/default.nix self.nixosModules.base @@ -118,6 +115,7 @@ ./hosts/nixos-laptop self.nixosModules.desktop ]; + hosts.nixos-desktop.modules = [ ./hosts/nixos-desktop self.nixosModules.desktop @@ -140,6 +138,7 @@ cachix ]; }; + checks.pre-commit-check = inputs.pre-commit-hooks.lib."${system}".run { src = ./.; hooks = { From 5c0752b891f436dca516f297be59f6b183840361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 15 Oct 2022 20:00:09 +0200 Subject: [PATCH 25/58] :sparkles: make use of mkEnableOption --- modules/config/bin/default.nix | 8 +---- modules/config/nix.nix | 19 +++++----- modules/config/theming/default.nix | 6 +--- modules/config/wallpapers.nix | 8 +---- modules/config/yubikey.nix | 8 +---- modules/profiles/base.nix | 11 ++++-- modules/profiles/desktop.nix | 2 +- modules/programs/adb.nix | 8 +---- modules/programs/bspwm/default.nix | 8 +---- modules/programs/code.nix | 9 ++--- modules/programs/default.nix | 1 - modules/programs/direnv.nix | 8 +---- modules/programs/emacs.nix | 9 ++--- modules/programs/email.nix | 25 -------------- modules/programs/firefox.nix | 6 +--- modules/programs/fish.nix | 8 +---- modules/programs/git.nix | 6 +--- modules/programs/gnome.nix | 8 +---- modules/programs/gpg.nix | 9 ++--- modules/programs/helix.nix | 8 +---- modules/programs/hub.nix | 9 ++--- modules/programs/kakoune.nix | 8 +---- modules/programs/kitty.nix | 8 +---- modules/programs/ledger/default.nix | 8 +---- modules/programs/logseq.nix | 8 +---- modules/programs/python.nix | 9 ++++- modules/programs/rofi/default.nix | 42 +---------------------- modules/programs/spotify.nix | 8 +---- modules/programs/sway.nix | 8 +---- modules/programs/thunar.nix | 8 +---- modules/programs/xmonad/default.nix | 8 +---- modules/programs/zathura.nix | 8 +---- modules/programs/zsh.nix | 8 +---- modules/services/dunst.nix | 8 +---- modules/services/kdeconnect.nix | 8 +---- modules/services/mullvad.nix | 8 +---- modules/services/openconnect.nix | 8 +---- modules/services/openvpn.nix | 8 +---- modules/services/picom.nix | 8 +---- modules/services/printing.nix | 8 +---- modules/services/redshift.nix | 8 +---- modules/virtualisation/podman.nix | 8 +---- modules/virtualisation/virtualisation.nix | 15 ++++---- 43 files changed, 73 insertions(+), 329 deletions(-) delete mode 100644 modules/programs/email.nix diff --git a/modules/config/bin/default.nix b/modules/config/bin/default.nix index f001be9..7f4520e 100644 --- a/modules/config/bin/default.nix +++ b/modules/config/bin/default.nix @@ -14,13 +14,7 @@ let sxhkdHelp = import ./sxhkdHelp.nix { inherit pkgs; }; in { - options.my.bin = { - enable = mkOption { - default = true; - type = types.bool; - example = false; - }; - }; + options.my.bin.enable = mkEnableOption "bin"; config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ diff --git a/modules/config/nix.nix b/modules/config/nix.nix index 5747c41..0dbd9ff 100644 --- a/modules/config/nix.nix +++ b/modules/config/nix.nix @@ -11,22 +11,21 @@ let in { options.my.nix = { - gc.enable = mkOption { - default = true; - type = types.bool; - example = false; - }; - optimise.enable = mkOption { - default = true; - type = types.bool; - example = false; + gc = { + enable = mkEnableOption "nix-gc"; + minimumFreedGB = mkOption { + default = 32; + type = types.int; + apply = number: toString (number * 1024 * 1024 * 1024); + }; }; + optimise.enable = mkEnableOption "nix-optimise"; }; config.nix = { gc = { automatic = cfg.gc.enable; - options = "--max-freed $((32 * 1024**3)) --delete-older-than 14d"; + options = "--max-freed ${cfg.gc.minimumFreedGB} --delete-older-than 14d"; dates = "weekly"; }; diff --git a/modules/config/theming/default.nix b/modules/config/theming/default.nix index 882b3cc..eb9180f 100644 --- a/modules/config/theming/default.nix +++ b/modules/config/theming/default.nix @@ -19,11 +19,7 @@ in ]; options.my.theming = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; + enable = mkEnableOption "theming"; scheme = mkOption { default = "catppuccin-macchiato"; type = types.enum [ diff --git a/modules/config/wallpapers.nix b/modules/config/wallpapers.nix index 0ea8f62..526a017 100644 --- a/modules/config/wallpapers.nix +++ b/modules/config/wallpapers.nix @@ -9,13 +9,7 @@ let cfg = config.my.wallpapers; in { - options.my.wallpapers = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.wallpapers.enable = mkEnableOption "wallpapers"; config = mkIf cfg.enable { home-manager.users.moritz.xdg = { diff --git a/modules/config/yubikey.nix b/modules/config/yubikey.nix index 889c7a5..4695434 100644 --- a/modules/config/yubikey.nix +++ b/modules/config/yubikey.nix @@ -9,13 +9,7 @@ let cfg = config.my.yubikey; in { - options.my.yubikey = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.yubikey = mkEnableOption "yubikey"; config = { services.udev.packages = [ pkgs.yubikey-personalization ]; diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index b41b3ab..d00a341 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -22,6 +22,11 @@ with lib; time.timeZone = "Europe/Berlin"; my = { + nix = { + gc.enable = true; + optimise.enable = true; + }; + bin.enable = true; shell = { abbreviations = { us = "systemctl --user"; @@ -43,10 +48,13 @@ with lib; variables = { EDITOR = "vim"; }; }; programs = { + direnv.enable = true; fish.enable = true; - vim.enable = true; + git.enable = true; + gpg.enable = true; helix.enable = true; kakoune.enable = true; + vim.enable = true; }; }; @@ -82,7 +90,6 @@ with lib; entr exa gparted - hub hut lazygit neofetch diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index 63a09b3..d8b8e12 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -23,7 +23,6 @@ with lib; { bspwm.enable = true; code.enable = true; emacs.enable = true; - email.enable = true; firefox = { enable = true; arkenfox = { @@ -119,6 +118,7 @@ with lib; { signal-desktop tlaplusToolbox vlc + thunderbird ]; home-manager.users.moritz = { diff --git a/modules/programs/adb.nix b/modules/programs/adb.nix index e52d43d..c839ce6 100644 --- a/modules/programs/adb.nix +++ b/modules/programs/adb.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.adb; in { - options.my.programs.adb = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.adb.enable = mkEnableOption "adb"; config = mkIf cfg.enable { programs.adb.enable = true; diff --git a/modules/programs/bspwm/default.nix b/modules/programs/bspwm/default.nix index dff5175..ffb5448 100644 --- a/modules/programs/bspwm/default.nix +++ b/modules/programs/bspwm/default.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.bspwm; in { - options.my.programs.bspwm = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.bspwm.enable = mkEnableOption "true"; config = lib.mkIf cfg.enable { services = { diff --git a/modules/programs/code.nix b/modules/programs/code.nix index 0f58530..93cda16 100644 --- a/modules/programs/code.nix +++ b/modules/programs/code.nix @@ -9,13 +9,8 @@ let cfg = config.my.programs.code; in { - options.my.programs.code = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.code.enable = mkEnableOption "code"; + config = mkIf cfg.enable { home-manager.users.moritz = { programs.vscode = { diff --git a/modules/programs/default.nix b/modules/programs/default.nix index e72d357..02ef7d9 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -11,7 +11,6 @@ ./code.nix ./direnv.nix ./emacs.nix - ./email.nix ./firefox.nix ./fish.nix ./git.nix diff --git a/modules/programs/direnv.nix b/modules/programs/direnv.nix index 83489cc..1235326 100644 --- a/modules/programs/direnv.nix +++ b/modules/programs/direnv.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.direnv; in { - options.my.programs.direnv = { - enable = mkOption { - default = true; - type = types.bool; - example = false; - }; - }; + options.my.programs.direnv.enable = mkEnableOption "direnv"; config = mkIf cfg.enable { home-manager.users.moritz.programs.direnv = { diff --git a/modules/programs/emacs.nix b/modules/programs/emacs.nix index 6544ed9..d9e884c 100644 --- a/modules/programs/emacs.nix +++ b/modules/programs/emacs.nix @@ -12,13 +12,8 @@ let (epkgs: [ epkgs.vterm ])); in { - options.my.programs.emacs = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.emacs.enable = mkEnableOption "emacs"; + config = mkIf cfg.enable { my.shell.aliases = { emacs = "emacsclient -t -a 'emacs -t'"; diff --git a/modules/programs/email.nix b/modules/programs/email.nix deleted file mode 100644 index 4717780..0000000 --- a/modules/programs/email.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ config -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.programs.email; -in -{ - options.my.programs.email = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; - - config = mkIf cfg.enable { - # Email Applications - users.users.moritz.packages = with pkgs; [ thunderbird ]; - networking.firewall.allowedTCPPorts = [ 33728 1025 1143 ]; - }; -} diff --git a/modules/programs/firefox.nix b/modules/programs/firefox.nix index ee4cab0..d0f8e4d 100644 --- a/modules/programs/firefox.nix +++ b/modules/programs/firefox.nix @@ -12,11 +12,7 @@ let in { options.my.programs.firefox = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; + enable = mkEnableOption "firefox"; arkenfox = { enable = mkEnableOption "arkenfox"; overrides = mkOption { diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index 8df6f75..a2d64c8 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -14,13 +14,7 @@ let exportedVariables = lib.concatStringsSep "\n" exportVariables; in { - options.my.programs.fish = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.fish.enable = mkEnableOption "fish"; config = lib.mkIf cfg.enable { # set as default shell diff --git a/modules/programs/git.nix b/modules/programs/git.nix index 46c2885..42497af 100644 --- a/modules/programs/git.nix +++ b/modules/programs/git.nix @@ -10,11 +10,7 @@ let in { options.my.programs.git = { - enable = mkOption { - default = true; - type = types.bool; - example = false; - }; + enable = mkEnableOption "git"; signing = mkOption { default = false; type = types.bool; diff --git a/modules/programs/gnome.nix b/modules/programs/gnome.nix index 8e7c2ee..f60df75 100644 --- a/modules/programs/gnome.nix +++ b/modules/programs/gnome.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.gnome; in { - options.my.programs.gnome = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.gnome.enable = mkEnableOption "gnome"; config = lib.mkIf cfg.enable { hardware = { diff --git a/modules/programs/gpg.nix b/modules/programs/gpg.nix index eb2c845..5371d62 100644 --- a/modules/programs/gpg.nix +++ b/modules/programs/gpg.nix @@ -9,13 +9,8 @@ let cfg = config.my.programs.gpg; in { - options.my.programs.gpg = { - enable = mkOption { - default = true; - type = types.bool; - example = true; - }; - }; + options.my.programs.gpg.enable = mkEnableOption "gpg"; + config = mkIf cfg.enable { home-manager.users.moritz.programs.gpg.enable = true; environment.shellInit = '' diff --git a/modules/programs/helix.nix b/modules/programs/helix.nix index 93bb5ab..821a09c 100644 --- a/modules/programs/helix.nix +++ b/modules/programs/helix.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.helix; in { - options.my.programs.helix = { - enable = mkOption { - default = true; - type = types.bool; - example = false; - }; - }; + options.my.programs.helix.enable = mkEnableOption "helix"; config = mkIf cfg.enable { home-manager.users.moritz.programs.helix = { diff --git a/modules/programs/hub.nix b/modules/programs/hub.nix index 8759d23..14b9c60 100644 --- a/modules/programs/hub.nix +++ b/modules/programs/hub.nix @@ -9,13 +9,8 @@ let cfg = config.my.programs.hub; in { - options.my.programs.hub = { - enable = mkOption { - default = true; - type = types.bool; - example = false; - }; - }; + options.my.programs.hub.enable = mkEnableOption "hub"; + config = mkIf cfg.enable { age.secrets = { github = { diff --git a/modules/programs/kakoune.nix b/modules/programs/kakoune.nix index a4efa50..874ef2d 100644 --- a/modules/programs/kakoune.nix +++ b/modules/programs/kakoune.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.kakoune; in { - options.my.programs.kakoune = { - enable = mkOption { - default = true; - type = types.bool; - example = false; - }; - }; + options.my.programs.kakoune.enable = mkEnableOption "kakoune"; config = mkIf cfg.enable { home-manager.users.moritz = { diff --git a/modules/programs/kitty.nix b/modules/programs/kitty.nix index f55f40f..8ab1958 100644 --- a/modules/programs/kitty.nix +++ b/modules/programs/kitty.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.kitty; in { - options.my.programs.kitty = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.kitty.enable = mkEnableOption "kitty"; config = mkIf cfg.enable { my.shell.aliases.ssh = "kitty +kitten ssh"; diff --git a/modules/programs/ledger/default.nix b/modules/programs/ledger/default.nix index 8ed7a1b..348e0e1 100644 --- a/modules/programs/ledger/default.nix +++ b/modules/programs/ledger/default.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.ledger; in { - options.my.programs.ledger = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.ledger.enable = mkEnableOption "ledger"; config = mkIf cfg.enable { my.shell = { diff --git a/modules/programs/logseq.nix b/modules/programs/logseq.nix index 7d6fc03..948e39c 100644 --- a/modules/programs/logseq.nix +++ b/modules/programs/logseq.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.logseq; in { - options.my.programs.logseq = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.logseq.enable = mkEnableOption "logseq"; config = mkIf cfg.enable { users.users.moritz.packages = with pkgs; [ diff --git a/modules/programs/python.nix b/modules/programs/python.nix index 7480cb5..f0dadfb 100644 --- a/modules/programs/python.nix +++ b/modules/programs/python.nix @@ -30,7 +30,14 @@ in example = [ "python39" ]; }; packages = mkOption { - default = [ "isort" "pytest" "flake8" "python-lsp-server" ]; + default = [ + "flake8" + "isort" + "mypy" + "poetry" + "pytest" + "python-lsp-server" + ]; type = with types; listOf (enum commonPackages); }; }; diff --git a/modules/programs/rofi/default.nix b/modules/programs/rofi/default.nix index ec02515..56fa79a 100644 --- a/modules/programs/rofi/default.nix +++ b/modules/programs/rofi/default.nix @@ -7,49 +7,9 @@ with lib; let cfg = config.my.programs.rofi; - - rofi-bluetooth = with pkgs; stdenv.mkDerivation rec { - pname = "rofi-bluetooth"; - version = "unstable-2021-03-05"; - - src = fetchFromGitHub { - repo = pname; - owner = "nickclyde"; - # https://github.com/nickclyde/rofi-bluetooth/issues/19 - rev = "893db1f2b549e7bc0e9c62e7670314349a29cdf2"; - sha256 = "sha256-3oROJKEQCuSnLfbJ+JSSc9hcmJTPrLHRQJsrUcaOMss="; - }; - - nativeBuildInputs = [ makeWrapper ]; - - installPhase = '' - runHook preInstall - - install -D --target-directory=$out/bin/ ./rofi-bluetooth - - wrapProgram $out/bin/rofi-bluetooth \ - --prefix PATH ":" ${lib.makeBinPath [ rofi-unwrapped bluez ] } - - runHook postInstall - ''; - - meta = with lib; { - description = "Rofi-based interface to connect to bluetooth devices and display status info"; - homepage = "https://github.com/nickclyde/rofi-bluetooth"; - license = licenses.gpl3Only; - maintainers = with maintainers; [ MoritzBoehme ]; - platforms = platforms.linux; - }; - }; in { - options.my.programs.rofi = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.rofi.enable = mkEnableOption "rofi"; config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ diff --git a/modules/programs/spotify.nix b/modules/programs/spotify.nix index 7010d7f..f6d39bd 100644 --- a/modules/programs/spotify.nix +++ b/modules/programs/spotify.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.spotify; in { - options.my.programs.spotify = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.spotify.enable = mkEnableOption "spotify"; config = mkIf cfg.enable { age.secrets.spotifyd = { diff --git a/modules/programs/sway.nix b/modules/programs/sway.nix index a3b6716..f7ae605 100644 --- a/modules/programs/sway.nix +++ b/modules/programs/sway.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.sway; in { - options.my.programs.sway = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.sway.enable = mkEnableOption "sway"; config = lib.mkIf cfg.enable { hardware.opengl = { diff --git a/modules/programs/thunar.nix b/modules/programs/thunar.nix index 99ba7b4..3a6a6c7 100644 --- a/modules/programs/thunar.nix +++ b/modules/programs/thunar.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.thunar; in { - options.my.programs.thunar = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.thunar.enable = mkEnableOption "thunar"; config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ diff --git a/modules/programs/xmonad/default.nix b/modules/programs/xmonad/default.nix index dcaab68..80ceb83 100644 --- a/modules/programs/xmonad/default.nix +++ b/modules/programs/xmonad/default.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.xmonad; in { - options.my.programs.xmonad = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.xmonad.enable = mkEnableOption "xmonad"; config = lib.mkIf cfg.enable { services = { diff --git a/modules/programs/zathura.nix b/modules/programs/zathura.nix index 0389b1e..4eb23e3 100644 --- a/modules/programs/zathura.nix +++ b/modules/programs/zathura.nix @@ -9,13 +9,7 @@ let cfg = config.my.programs.zathura; in { - options.my.programs.zathura = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.zathura.enable = mkEnableOption "zathura"; config = mkIf cfg.enable { home-manager.users.moritz.programs.zathura = { diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index d5e775b..8088627 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -11,13 +11,7 @@ let shellConfig = config.my.shell; in { - options.my.programs.zsh = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.programs.zsh.enable = mkEnableOption "zsh"; config = lib.mkIf cfg.enable { environment.pathsToLink = [ "/share/zsh" ]; diff --git a/modules/services/dunst.nix b/modules/services/dunst.nix index 80b330c..898faaa 100644 --- a/modules/services/dunst.nix +++ b/modules/services/dunst.nix @@ -9,13 +9,7 @@ let cfg = config.my.services.dunst; in { - options.my.services.dunst = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.services.dunst.enable = mkEnableOption "dunst"; config = lib.mkIf cfg.enable { home-manager.users.moritz = { diff --git a/modules/services/kdeconnect.nix b/modules/services/kdeconnect.nix index 6d66419..3ce2e31 100644 --- a/modules/services/kdeconnect.nix +++ b/modules/services/kdeconnect.nix @@ -13,13 +13,7 @@ let cfg = config.my.services.kdeconnect; in { - options.my.services.kdeconnect = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.services.kdeconnect.enable = mkEnableOption "kdeconnect"; config = mkIf cfg.enable { home-manager.users.moritz.services.kdeconnect.enable = mkIf (!config.my.programs.gnome.enable) true; diff --git a/modules/services/mullvad.nix b/modules/services/mullvad.nix index dac4f74..3840016 100644 --- a/modules/services/mullvad.nix +++ b/modules/services/mullvad.nix @@ -9,13 +9,7 @@ let cfg = config.my.services.mullvad; in { - options.my.services.mullvad = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.services.mullvad.enable = mkEnableOption "mullvad"; config = lib.mkIf cfg.enable { services.mullvad-vpn.enable = true; diff --git a/modules/services/openconnect.nix b/modules/services/openconnect.nix index 8203acb..ad38514 100644 --- a/modules/services/openconnect.nix +++ b/modules/services/openconnect.nix @@ -9,13 +9,7 @@ let cfg = config.my.services.openconnect; in { - options.my.services.openconnect = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.services.openconnect.enable = mkEnableOption "openconnect"; config = lib.mkIf cfg.enable { networking.openconnect.interfaces = { diff --git a/modules/services/openvpn.nix b/modules/services/openvpn.nix index 900721f..b0b49bc 100644 --- a/modules/services/openvpn.nix +++ b/modules/services/openvpn.nix @@ -9,13 +9,7 @@ let cfg = config.my.services.openvpn; in { - options.my.services.openvpn = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.services.openvpn.enable = mkEnableOption "openvpn"; config = lib.mkIf cfg.enable { age.secrets = { diff --git a/modules/services/picom.nix b/modules/services/picom.nix index 53b565c..13b0024 100644 --- a/modules/services/picom.nix +++ b/modules/services/picom.nix @@ -9,13 +9,7 @@ let cfg = config.my.services.picom; in { - options.my.services.picom = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.services.picom.enable = mkEnableOption "picom"; config = lib.mkIf cfg.enable { home-manager.users.moritz = { diff --git a/modules/services/printing.nix b/modules/services/printing.nix index fd5e44c..ab7edd9 100644 --- a/modules/services/printing.nix +++ b/modules/services/printing.nix @@ -5,13 +5,7 @@ let cfg = config.my.services.printing; in { - options.my.services.printing = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.services.printing.enable = mkEnableOption "printing"; config = lib.mkIf cfg.enable { services = { diff --git a/modules/services/redshift.nix b/modules/services/redshift.nix index d4878ae..6e75b5e 100644 --- a/modules/services/redshift.nix +++ b/modules/services/redshift.nix @@ -5,13 +5,7 @@ let cfg = config.my.services.redshift; in { - options.my.services.redshift = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.services.redshift.enable = mkEnableOption "redshift"; config = lib.mkIf cfg.enable { services.redshift.enable = true; diff --git a/modules/virtualisation/podman.nix b/modules/virtualisation/podman.nix index 15c8547..f3fdf35 100644 --- a/modules/virtualisation/podman.nix +++ b/modules/virtualisation/podman.nix @@ -9,13 +9,7 @@ let cfg = config.my.virtualisation.podman; in { - options.my.virtualisation.podman = { - enable = mkOption { - default = false; - type = types.bool; - example = false; - }; - }; + options.my.virtualisation.podman.enable = mkEnableOption "podman"; config = mkIf cfg.enable { virtualisation.podman = { diff --git a/modules/virtualisation/virtualisation.nix b/modules/virtualisation/virtualisation.nix index bd84cda..f51862f 100644 --- a/modules/virtualisation/virtualisation.nix +++ b/modules/virtualisation/virtualisation.nix @@ -9,20 +9,17 @@ let cfg = config.my.virtualisation.libvirtd; in { - options.my.virtualisation.libvirtd = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - }; + options.my.virtualisation.libvirtd.enable = mkEnableOption "libvirtd"; config = mkIf cfg.enable { virtualisation.libvirtd = { enable = true; package = pkgs.libvirt; }; - environment.systemPackages = with pkgs; [ virt-manager ]; - users.users.moritz.extraGroups = [ "libvirtd" ]; + + users.users.moritz = { + extraGroups = [ "libvirtd" ]; + packages = with pkgs; [ virt-manager ]; + }; }; } From 4b08e874b77cbc3921deba6224a218ee5109b301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 3 Nov 2022 21:03:36 +0100 Subject: [PATCH 26/58] :rocket: add ssh module --- modules/profiles/desktop.nix | 4 ++++ modules/programs/default.nix | 1 + modules/programs/ssh.nix | 39 ++++++++++++++++++++++++++++++++++++ secrets/secrets.nix | 7 ++++--- secrets/ssh-home.age | 17 ++++++++++++++++ 5 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 modules/programs/ssh.nix create mode 100644 secrets/ssh-home.age diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index d8b8e12..3be4db6 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -81,6 +81,10 @@ with lib; { logseq.enable = true; python.enable = true; rofi.enable = true; + ssh = { + enable = true; + includeSecrets = [ ../../secrets/ssh-home.age ]; + }; spotify.enable = true; thunar.enable = true; zathura.enable = true; diff --git a/modules/programs/default.nix b/modules/programs/default.nix index 02ef7d9..82e2dd4 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -25,6 +25,7 @@ ./python.nix ./rofi ./spotify.nix + ./ssh.nix ./sway.nix ./thunar.nix ./vim.nix diff --git a/modules/programs/ssh.nix b/modules/programs/ssh.nix new file mode 100644 index 0000000..2c484ae --- /dev/null +++ b/modules/programs/ssh.nix @@ -0,0 +1,39 @@ +{ config +, lib +, pkgs +, ... +}: + +with lib; +let + cfg = config.my.programs.ssh; + + baseName = path: removeSuffix ".age" (baseNameOf path); +in +{ + options.my.programs.ssh = { + enable = mkEnableOption "ssh"; + includeSecrets = mkOption { + default = [ ]; + type = with types; listOf path; + }; + }; + + config = + mkIf cfg.enable + { + age.secrets = listToAttrs (map + (path: { + name = baseName path; + value = { + file = path; + owner = "1000"; + }; + }) + cfg.includeSecrets); + home-manager.users.moritz.programs.ssh = { + enable = true; + includes = map (path: "/run/agenix/" + baseName path) cfg.includeSecrets; + }; + }; +} diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 90e1b43..0862e22 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -11,10 +11,11 @@ let all = users ++ hosts; in { + "github.age".publicKeys = all; + "home-vpn-password.age".publicKeys = all; + "home-vpn.age".publicKeys = all; "nordvpn.age".publicKeys = all; "spotifyd.age".publicKeys = all; - "home-vpn.age".publicKeys = all; - "home-vpn-password.age".publicKeys = all; - "github.age".publicKeys = all; + "ssh-home.age".publicKeys = all; "uni-vpn.age".publicKeys = all; } diff --git a/secrets/ssh-home.age b/secrets/ssh-home.age new file mode 100644 index 0000000..29c1542 --- /dev/null +++ b/secrets/ssh-home.age @@ -0,0 +1,17 @@ +age-encryption.org/v1 +-> ssh-ed25519 CjuqfA wMWvHzKojsGU5q8ElLz2IiwI0NvWZN6rPLL8nvIu9xE +n0FjkxhJTOaG7RF6MEzaAz9ZWiP1trQHdNiaPCc5aCo +-> ssh-ed25519 QRYDmg ChVNe6JXbocNnJnO0Y7XVrW0Tic5V5aIWuxGiG6pXnw +FIDIKw6K0Y+WY5GJV262KTayMwxPCCBXMqXXMQruCPI +-> ssh-ed25519 wG6LYg X/hbVXUoJNAkrgGz5MtyMjYRtBkF+FERXsRg1t8lFio +x7zWga14+MZKbTQxRhoQjeBvuQOoG/uF6ZOW2XSgm/g +-> ssh-ed25519 ZYd7Zg 2ONwuLBf5b3SrCdH+8ZiebO7KBqfKjan1Sw+LX/oTQ4 +bk6LwwvZ/i5UCxUakWA9J4MUT+3ENWMGAZyXpHRFMNI +-> ssh-ed25519 as9VYQ H2i5xdWKf96tzdmTOZ0PHZciuZgSHSYTNxbvcQ3PzDs +LRwILXh0IzTJrXJf2xa97m8cBV6KuvjDPWdeNTRZNdw +-> G(S/7!"#-grease 0y 81:sY?B +r6URopooo8jE5fqfSgjBHWrwDVMa0IwklhiWXsbMzgzBhac8DSDiGMEfXxKAFDFV +GTFSR0sZoA +--- QLqXqFiqJnIc1aMFvU0Giexu9m6E2ESU6kVpiu/vD5I +9v.}rcdnqü7 |nA4H̿P4~ +8m%꥟p'di97>rx\KüeaxD7CtGlsEvŔIc |Cw6G%,%yT᭵8 \ No newline at end of file From cff6561279531078b93b79374232b7abc95757e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 3 Nov 2022 21:04:24 +0100 Subject: [PATCH 27/58] :bug: fix openssl issues --- flake.lock | 94 +++++++++++++++++--------------------------- overlays/default.nix | 2 +- 2 files changed, 37 insertions(+), 59 deletions(-) diff --git a/flake.lock b/flake.lock index 6edd3ac..a579e21 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1664140963, - "narHash": "sha256-pFxDtOLduRFlol0Y4ShE+soRQX4kbhaCNBtDOvx7ykw=", + "lastModified": 1665870395, + "narHash": "sha256-Tsbqb27LDNxOoPLh0gw2hIb6L/6Ow/6lIBvqcHzEKBI=", "owner": "ryantm", "repo": "agenix", - "rev": "6acb1fe5f8597d5ce63fc82bc7fcac7774b1cdf0", + "rev": "a630400067c6d03c9b3e0455347dc8559db14288", "type": "github" }, "original": { @@ -23,11 +23,11 @@ "arkenfox-userjs": { "flake": false, "locked": { - "lastModified": 1662893183, - "narHash": "sha256-NyP/kJlV1Ai7os3gMqukKMdRSQ78GAjPCJkZDZtDdeo=", + "lastModified": 1665257885, + "narHash": "sha256-4PNnCRLomAd5OdN4UEbsVSm8eNuteZHKaUqRVvIBvN8=", "owner": "arkenfox", "repo": "user.js", - "rev": "3f09afdee07c5aea33f6dc4194e1425d6400a0d7", + "rev": "f4187632faef76df4de0cbb0cdc7199f22fadd76", "type": "github" }, "original": { @@ -83,11 +83,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1663284638, - "narHash": "sha256-rXAX14yB8v9BOG4ZsdGEedpZAnNqhQ4DtjQwzFX/TLY=", + "lastModified": 1666010793, + "narHash": "sha256-6zhTpR0cfaHrupOXRZAdCzLAGINgsB6h3HQnj7+qHWs=", "owner": "nix-community", "repo": "comma", - "rev": "c83ff3839983b3cb8deb407ff618ca12179de588", + "rev": "691120d169189f3a9cb29b1c72bcd521ac372b2b", "type": "github" }, "original": { @@ -120,11 +120,11 @@ ] }, "locked": { - "lastModified": 1664251341, - "narHash": "sha256-1f0KvK1VA8tGK7RVYZv17vSJ6URyt8fs81kRGfzPK3Q=", + "lastModified": 1666352875, + "narHash": "sha256-kbzTmj9ihe4rowgjLxD4uT4nKh304lN0RJMd5yBX03w=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "550ce5667fee8f74aa20ad6456720ed84ebdd241", + "rev": "3d7c61b6dc5fc9d7c5e4a74e575c582aa567d547", "type": "github" }, "original": { @@ -212,11 +212,11 @@ "forgit-git": { "flake": false, "locked": { - "lastModified": 1663431390, - "narHash": "sha256-dz7HNm9+dgb2ibomdrYdtSUC+ksrYdRR5RjBxSmc9eI=", + "lastModified": 1665756353, + "narHash": "sha256-NKL4c4k9Nath8NQ3sWUTGUzp517jRX4v0qVaKMJSMrw=", "owner": "wfxr", "repo": "forgit", - "rev": "49579b2d1f620db6a71d070b40416c1af8a32168", + "rev": "2872548075e63bc83a0b960e2813b16571998563", "type": "github" }, "original": { @@ -233,11 +233,11 @@ "utils": "utils_2" }, "locked": { - "lastModified": 1664273942, - "narHash": "sha256-PFQR1UJQs7a7eaH5YoCZky5dmxR5cjaKRK+MpPbR7YE=", + "lastModified": 1666253070, + "narHash": "sha256-MtaNgghmfp+ywh5mv9FcspFT4ACaYINSN+D98PCkrP0=", "owner": "nix-community", "repo": "home-manager", - "rev": "1f5ef2bb419a327fae28a83b50fab50959132c24", + "rev": "c485669ca529e01c1505429fa9017c9a93f15559", "type": "github" }, "original": { @@ -250,15 +250,14 @@ "inputs": { "flake-utils": "flake-utils_2", "nixpkgs": "nixpkgs", - "pre-commit-hooks": "pre-commit-hooks", - "utils": "utils_3" + "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1665340940, - "narHash": "sha256-6IIBGkD4spWRvMTEXRxWa31IerfVc1SSTruggY/lNR4=", + "lastModified": 1665343480, + "narHash": "sha256-mMaZFrDDiBcHDe8+lA87P3iMPea+RGfik5/E4Dyzk8U=", "ref": "refs/heads/main", - "rev": "17159cf269ce194703bc04671bb6d2378d124959", - "revCount": 3, + "rev": "24a7cfb8c2fef1873275dbdf7c8ad562c22083de", + "revCount": 5, "type": "git", "url": "https://git.sr.ht/~moritzboehme/howdy" }, @@ -269,11 +268,11 @@ }, "master": { "locked": { - "lastModified": 1664278750, - "narHash": "sha256-frpTZQ+QMS7Xwi3fQSYdUTKd5e4YnrrDcS4WT+fdpfI=", + "lastModified": 1666360603, + "narHash": "sha256-EbTKhA5z4us1tOwitpbwHy42K6VF0jeisHuM197Ak5I=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ff346a442d1e5ec81b24c312c06fd134bcc9c088", + "rev": "2615fa1055a8462db5c5be0b2ef5fd77b42aad10", "type": "github" }, "original": { @@ -322,11 +321,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1664235386, - "narHash": "sha256-hlkYFCJ9VKZPRW50vtpHHq4h1PJrptD5BbdLOEp4Lyc=", + "lastModified": 1666333455, + "narHash": "sha256-oHXIeLB/sPWxKNcSdV1DQi1ddNVoJ17T1yDiMMeygL4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ea4a87537cfdc83eebcd1804a5ec51057018784f", + "rev": "93e0ac196106dce51878469c9a763c6233af5c57", "type": "github" }, "original": { @@ -381,11 +380,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1663082609, - "narHash": "sha256-lmCCIu4dj59qbzkGKHQtolhpIEQMeAd2XUbXVPqgPYo=", + "lastModified": 1666160137, + "narHash": "sha256-8bQu+6poMzUyS2n3C1v3hkO6ZhRzj8Pf3CDCNckqQE4=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "60cad1a326df17a8c6cf2bb23436609fdd83024e", + "rev": "e6c8efee1c108bb27522b9fd25b1cd0eb3288681", "type": "github" }, "original": { @@ -410,16 +409,16 @@ "nixpkgs": "nixpkgs_2", "pre-commit-hooks": "pre-commit-hooks_2", "stable": "stable", - "utils": "utils_4" + "utils": "utils_3" } }, "stable": { "locked": { - "lastModified": 1664178928, - "narHash": "sha256-+WVCZH/3Ifef4Da9N1tkGnmfX0QwtkJQz013QuImu10=", + "lastModified": 1666249138, + "narHash": "sha256-CzK8NA8xEMKAhvHXB8UMODckcH97sZXm6lziKNWLv0M=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b542cc75fa03a3a29350d4c3b69739e946268a93", + "rev": "44fc3cb097324c9f9f93313dd3f103e78d722968", "type": "github" }, "original": { @@ -460,27 +459,6 @@ } }, "utils_3": { - "inputs": { - "flake-utils": [ - "howdy", - "flake-utils" - ] - }, - "locked": { - "lastModified": 1657226504, - "narHash": "sha256-GIYNjuq4mJlFgqKsZ+YrgzWm0IpA4axA3MCrdKYj7gs=", - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", - "rev": "2bf0f91643c2e5ae38c1b26893ac2927ac9bd82a", - "type": "github" - }, - "original": { - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", - "type": "github" - } - }, - "utils_4": { "inputs": { "flake-utils": "flake-utils_4" }, diff --git a/overlays/default.nix b/overlays/default.nix index dc2ac76..d29fe96 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,7 +1,7 @@ { inputs }: final: prev: { inherit (inputs.comma.packages."${prev.system}") comma; nixpkgs-review-checks = inputs.nixpkgs-review-checks.defaultPackage."${prev.system}"; - kdeconnect = prev.plasma5Packages.kdeconnect-kde; + openssl = final.master.openssl_3; # HACK to fix openssl CVE-2022-3786 and CVE-2022-3602 agenix = inputs.agenix.defaultPackage."${prev.system}"; master = import inputs.master { inherit (prev) system; From 01d3e38d4ad5dea2b128ffe9aae3d42426c14619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 10 Nov 2022 22:12:36 +0100 Subject: [PATCH 28/58] :bug: fix ssh --- modules/programs/kitty.nix | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/modules/programs/kitty.nix b/modules/programs/kitty.nix index 8ab1958..76c4a10 100644 --- a/modules/programs/kitty.nix +++ b/modules/programs/kitty.nix @@ -12,7 +12,7 @@ in options.my.programs.kitty.enable = mkEnableOption "kitty"; config = mkIf cfg.enable { - my.shell.aliases.ssh = "kitty +kitten ssh"; + my.shell.aliases.ssh = "TERM=xterm-256color command ssh"; home-manager.users.moritz = { programs.kitty = { enable = true; @@ -32,11 +32,6 @@ in size = 10; }; }; - xdg.configFile."kitty/ssh.conf" = { - text = '' - env TERM=xterm-color - ''; - }; }; }; } From 89958d0fd76ad5d7b3abb27b3d5eb64cbfb58362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 10 Nov 2022 22:13:39 +0100 Subject: [PATCH 29/58] :rocket: add keyboard layout switching --- modules/programs/bspwm/sxhkdrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/programs/bspwm/sxhkdrc b/modules/programs/bspwm/sxhkdrc index 52f51f3..1f25526 100755 --- a/modules/programs/bspwm/sxhkdrc +++ b/modules/programs/bspwm/sxhkdrc @@ -30,7 +30,7 @@ alt + shift + c alt + {t,shift + t,s,f} bspc node -t {tiled,pseudo_tiled,floating,fullscreen} -# switch layout +# switch window layout alt + space bsp-layout next --layouts wide,tall,tiled @@ -107,6 +107,10 @@ super + h super + s share +# switch keyboard layout +super + l + setxkbmap -query | grep -Eq "layout:\s+de" && setxkbmap us && dunstify "Layout US"|| (setxkbmap de && dunstify "Layout DE") + # Apps # start firefox super + {_,shift} + f From c4aa2ccc268a29fac3d0307256376482e88aa8e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 10 Nov 2022 22:14:15 +0100 Subject: [PATCH 30/58] :lock: update inputs --- flake.lock | 68 +++++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/flake.lock b/flake.lock index a579e21..cd15729 100644 --- a/flake.lock +++ b/flake.lock @@ -23,11 +23,11 @@ "arkenfox-userjs": { "flake": false, "locked": { - "lastModified": 1665257885, - "narHash": "sha256-4PNnCRLomAd5OdN4UEbsVSm8eNuteZHKaUqRVvIBvN8=", + "lastModified": 1667741320, + "narHash": "sha256-WB9w/UoFqp/WyRhe87dNqwbMAXa8lmsK/QCeTzRWmj8=", "owner": "arkenfox", "repo": "user.js", - "rev": "f4187632faef76df4de0cbb0cdc7199f22fadd76", + "rev": "8a65c5a7bad0ec764d968b0941ebdf01bdcd2408", "type": "github" }, "original": { @@ -120,11 +120,11 @@ ] }, "locked": { - "lastModified": 1666352875, - "narHash": "sha256-kbzTmj9ihe4rowgjLxD4uT4nKh304lN0RJMd5yBX03w=", + "lastModified": 1667823539, + "narHash": "sha256-AwDCZgUT004T+skxK62ZWAlP+60yomMaHb0/+hHH448=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "3d7c61b6dc5fc9d7c5e4a74e575c582aa567d547", + "rev": "a864e84bd842d00d686e040f552e2fa7030351a0", "type": "github" }, "original": { @@ -151,11 +151,11 @@ }, "flake-utils": { "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "owner": "numtide", "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "type": "github" }, "original": { @@ -181,11 +181,11 @@ }, "flake-utils_3": { "locked": { - "lastModified": 1644229661, - "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "lastModified": 1667077288, + "narHash": "sha256-bdC8sFNDpT0HK74u9fUkpbf1MEzVYJ+ka7NXCdgBoaA=", "owner": "numtide", "repo": "flake-utils", - "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "rev": "6ee9ebb6b1ee695d2cacc4faa053a7b9baa76817", "type": "github" }, "original": { @@ -233,11 +233,11 @@ "utils": "utils_2" }, "locked": { - "lastModified": 1666253070, - "narHash": "sha256-MtaNgghmfp+ywh5mv9FcspFT4ACaYINSN+D98PCkrP0=", + "lastModified": 1667708081, + "narHash": "sha256-FChEy05x4ed/pttjfTeKxjPCnHknMYrUtDyBiYbreT4=", "owner": "nix-community", "repo": "home-manager", - "rev": "c485669ca529e01c1505429fa9017c9a93f15559", + "rev": "1ef0da321217c6c19b7a30509631c080a19321e5", "type": "github" }, "original": { @@ -268,11 +268,11 @@ }, "master": { "locked": { - "lastModified": 1666360603, - "narHash": "sha256-EbTKhA5z4us1tOwitpbwHy42K6VF0jeisHuM197Ak5I=", + "lastModified": 1667830549, + "narHash": "sha256-4ndTwPd+lMMWN/3oJlEBxkVw+8wQs9hB5a2+CvyHHwI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2615fa1055a8462db5c5be0b2ef5fd77b42aad10", + "rev": "1ef74a785480396ba179200196cac8256a67cfce", "type": "github" }, "original": { @@ -321,11 +321,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1666333455, - "narHash": "sha256-oHXIeLB/sPWxKNcSdV1DQi1ddNVoJ17T1yDiMMeygL4=", + "lastModified": 1667669848, + "narHash": "sha256-nD2dk2A+1zUlUT18ppDFVWwimi26+ultc2QRsulQwQ8=", "owner": "nixos", "repo": "nixpkgs", - "rev": "93e0ac196106dce51878469c9a763c6233af5c57", + "rev": "1f3ebb2bd1a353a42e8f833895c26d8415c7b791", "type": "github" }, "original": { @@ -337,11 +337,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1645655918, - "narHash": "sha256-ZfbEFRW7o237+A1P7eTKhXje435FCAoe0blj2n20Was=", - "owner": "nixos", + "lastModified": 1667292599, + "narHash": "sha256-7ISOUI1aj6UKMPIL+wwthENL22L3+A9V+jS8Is3QsRo=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "77a7a4197740213879b9a1d2e1788c6c8ade4274", + "rev": "ef2f213d9659a274985778bff4ca322f3ef3ac68", "type": "github" }, "original": { @@ -380,11 +380,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1666160137, - "narHash": "sha256-8bQu+6poMzUyS2n3C1v3hkO6ZhRzj8Pf3CDCNckqQE4=", + "lastModified": 1667760143, + "narHash": "sha256-+X5CyeNEKp41bY/I1AJgW/fn69q5cLJ1bgiaMMCKB3M=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "e6c8efee1c108bb27522b9fd25b1cd0eb3288681", + "rev": "06f48d63d473516ce5b8abe70d15be96a0147fcd", "type": "github" }, "original": { @@ -414,11 +414,11 @@ }, "stable": { "locked": { - "lastModified": 1666249138, - "narHash": "sha256-CzK8NA8xEMKAhvHXB8UMODckcH97sZXm6lziKNWLv0M=", + "lastModified": 1667653703, + "narHash": "sha256-Xow4vx52/g5zkhlgZnMEm/TEXsj+13jTPCc2jIhW1xU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "44fc3cb097324c9f9f93313dd3f103e78d722968", + "rev": "f09ad462c5a121d0239fde645aacb2221553a217", "type": "github" }, "original": { @@ -445,11 +445,11 @@ }, "utils_2": { "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "owner": "numtide", "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "type": "github" }, "original": { From 592e58370c2c7e5329ec857ef111c34a69f52cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 13 Nov 2022 11:50:25 +0100 Subject: [PATCH 31/58] :bug: fix picard not compiling --- modules/profiles/desktop.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index 3be4db6..7e08788 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -110,7 +110,7 @@ with lib; { # ripping abcde handbrake - picard + stable.picard # HACK to fix broken picard 2.8.3 # other anki From 64265350c02ee3a29c8aae9fd66cefe9c67aa794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 17 Nov 2022 08:25:59 +0100 Subject: [PATCH 32/58] :sparkles: use prettier i3-lock --- modules/profiles/desktop.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index 7e08788..e4fcc95 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -101,7 +101,10 @@ with lib; { }; }; - programs.xss-lock.enable = true; + programs.xss-lock = { + enable = true; + lockerCommand = "${pkgs.i3lock-fancy-rapid}/bin/i3lock-fancy-rapid 10 5"; + }; environment.systemPackages = with pkgs; [ # nix From e316e96b6022e4ca20b3af4d3feee63dbe204256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 17 Nov 2022 08:27:56 +0100 Subject: [PATCH 33/58] :rocket: add plantuml --- modules/profiles/desktop.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index e4fcc95..3334689 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -126,6 +126,7 @@ with lib; { tlaplusToolbox vlc thunderbird + plantuml ]; home-manager.users.moritz = { From 25018b268061aced3702f3cc9928f0d0c564c8c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 17 Nov 2022 08:28:19 +0100 Subject: [PATCH 34/58] :x: remove openssl overlay --- overlays/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/overlays/default.nix b/overlays/default.nix index d29fe96..5f8d1a9 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,7 +1,6 @@ { inputs }: final: prev: { inherit (inputs.comma.packages."${prev.system}") comma; nixpkgs-review-checks = inputs.nixpkgs-review-checks.defaultPackage."${prev.system}"; - openssl = final.master.openssl_3; # HACK to fix openssl CVE-2022-3786 and CVE-2022-3602 agenix = inputs.agenix.defaultPackage."${prev.system}"; master = import inputs.master { inherit (prev) system; From 0272237c04c02bea7cb32a24dccfc12d471d1817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 17 Nov 2022 08:34:29 +0100 Subject: [PATCH 35/58] :rocket: traffic everything trough uni-vpn --- modules/services/openconnect.nix | 1 - secrets/uni-vpn.age | 31 +++++++++++++++---------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/modules/services/openconnect.nix b/modules/services/openconnect.nix index ad38514..6a9433a 100644 --- a/modules/services/openconnect.nix +++ b/modules/services/openconnect.nix @@ -29,7 +29,6 @@ in }; age.secrets.uniVPN = { file = ../../secrets/uni-vpn.age; - owner = "1000"; }; }; } diff --git a/secrets/uni-vpn.age b/secrets/uni-vpn.age index 0caaad8..2c7daaa 100644 --- a/secrets/uni-vpn.age +++ b/secrets/uni-vpn.age @@ -1,17 +1,16 @@ age-encryption.org/v1 --> ssh-ed25519 CjuqfA RCNX2PCn0Nw3onGVpZKa2rwiX0OzHmwAyT5AYIPf3g4 -02E2bsAAS3FYna5dM+ReGTudrQVxC8T1hoFN7x10IMk --> ssh-ed25519 QRYDmg GSOSIihN5uQaRSTIHaHChqPnCePdtdQtMnD+YVOqSi8 -w8gMVpQh/GPuOeh8Kqlq5hUTwpGNGb+46TN5r7yPvG8 --> ssh-ed25519 wG6LYg g9yPEjf86J1JFigQ4wbcncQwB8vudbchp63648qchBY -jjAhYIacIbMWa+CX4ZIsnFXAS4DPIreCK8QeTgsVZsw --> ssh-ed25519 ZYd7Zg 8WQ39l77S3Hk5h9t0drUo8r1CFCDFNoAsBc8vIEIiT8 -nHvduRxFp+d7bu6n9mLTRTSnv+XfvD1c3xydkspcMZk --> ssh-ed25519 as9VYQ tDd4uU7mzJLeLbVupNeJQGTjY2lrtQA0Q7UREaCfCA8 -2zZslafI8HgoSXm1+tk/OP4jWMsVt7RxVBMS0pwNZf0 --> Uf`/-grease = r3?M -PM4EdUqyhLGuVj+AdzDNJrT70t6iyYGfXizxRCJdZ5gWG3BIPU3e1nVQhe599PYi -3VKQjDSbMvt/Hskxue8u5Q ---- spycnP0LXUKbLdOHOfmdtXoIKb8EL7yBY/zry/5LQ/I -"c'٤l$f!M}r*oaI6c!ModYw)u -M tͺ-_ \ No newline at end of file +-> ssh-ed25519 CjuqfA wsRuh5f7FBwEuH60mY/n5B2rfMXmN9loDRI5sgLAmQY +QRNPLd433Ax/F/NMCGdUUl1dXKvpaqErPYlDRPASkLA +-> ssh-ed25519 QRYDmg 1TN+ZhZMn3a5Ny/rrWZedHIwf69NCNj82RGfDt4VI1s +I+VsfBTJZ7gIIGROjU5hkvRZ/+OkxxPda9qYn28O5dg +-> ssh-ed25519 wG6LYg WhRpXAXmZPYLSmNcqvuLQIkwbOnyP/Fqmt5ZhvNqQx8 +lKyFPSmEgY/BuLKxTOQMrOVf7ScL50WwvghgDQT6gsY +-> ssh-ed25519 ZYd7Zg E4VAC6uIuBdXZ0jciRW/835qIaDWixDig6oGi8KqFlw +15J0vEUwCFiViXP7UlKmAmKfm+d6UgjcA3gHvDzSQwg +-> ssh-ed25519 as9VYQ +sGqCqiBOgMcF90Rt6xKRHm0fqZMXflg6OBRwAhVU2k +rgzztigEJ1WCdI9AuXcjP2VZrPQxiecYRPfg4RdOyFM +-> xA'C-grease s-9 ?tXT 38r l[ +lAYTp6Ot +--- RvWgnW1+4pux4UMOamln/5/xVLsyIgxAZwYOYZJGQo4 +H +I!4HQ uR7~Չ!3\B6 yGN7|v>n+2z'>D \ No newline at end of file From ffced49e218679d2f6a47d524874237fe2468439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 17 Nov 2022 08:36:18 +0100 Subject: [PATCH 36/58] :bug: fix nvdia driver not building --- hosts/nixos-desktop/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hosts/nixos-desktop/default.nix b/hosts/nixos-desktop/default.nix index a3c800a..32cf357 100644 --- a/hosts/nixos-desktop/default.nix +++ b/hosts/nixos-desktop/default.nix @@ -12,7 +12,8 @@ ]; # KERNEL - boot.kernelPackages = pkgs.linuxPackages_latest; + # HACK to get nvidia driver to build + # boot.kernelPackages = pkgs.linuxPackages_latest; # BOOT boot = { From 06f43053534c63c71c95c3430ce3ece778d4334d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 18 Nov 2022 13:27:12 +0100 Subject: [PATCH 37/58] :sparkles: use sourcehut specific input for howdy --- flake.lock | 38 ++++++++++++-------------------------- flake.nix | 5 ++++- 2 files changed, 16 insertions(+), 27 deletions(-) diff --git a/flake.lock b/flake.lock index cd15729..f4eef20 100644 --- a/flake.lock +++ b/flake.lock @@ -249,21 +249,23 @@ "howdy": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs", + "nixpkgs": [ + "nixpkgs" + ], "pre-commit-hooks": "pre-commit-hooks" }, "locked": { "lastModified": 1665343480, "narHash": "sha256-mMaZFrDDiBcHDe8+lA87P3iMPea+RGfik5/E4Dyzk8U=", - "ref": "refs/heads/main", + "owner": "~moritzboehme", + "repo": "howdy", "rev": "24a7cfb8c2fef1873275dbdf7c8ad562c22083de", - "revCount": 5, - "type": "git", - "url": "https://git.sr.ht/~moritzboehme/howdy" + "type": "sourcehut" }, "original": { - "type": "git", - "url": "https://git.sr.ht/~moritzboehme/howdy" + "owner": "~moritzboehme", + "repo": "howdy", + "type": "sourcehut" } }, "master": { @@ -304,22 +306,6 @@ } }, "nixpkgs": { - "locked": { - "lastModified": 1665266435, - "narHash": "sha256-vLhkXxNzAIvJNLyjm6fGe9Rwy/lsE9dc5MgV7w1EtCs=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "8e8b0bd1fd99ac2bdca112f9e2431d7c80b1d655", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { "locked": { "lastModified": 1667669848, "narHash": "sha256-nD2dk2A+1zUlUT18ppDFVWwimi26+ultc2QRsulQwQ8=", @@ -335,7 +321,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_2": { "locked": { "lastModified": 1667292599, "narHash": "sha256-7ISOUI1aj6UKMPIL+wwthENL22L3+A9V+jS8Is3QsRo=", @@ -377,7 +363,7 @@ "pre-commit-hooks_2": { "inputs": { "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1667760143, @@ -406,7 +392,7 @@ "home-manager": "home-manager", "howdy": "howdy", "master": "master", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "pre-commit-hooks": "pre-commit-hooks_2", "stable": "stable", "utils": "utils_3" diff --git a/flake.nix b/flake.nix index 0291ddd..dd0e546 100644 --- a/flake.nix +++ b/flake.nix @@ -63,7 +63,10 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - howdy.url = "git+https://git.sr.ht/~moritzboehme/howdy"; + howdy = { + url = "sourcehut:~moritzboehme/howdy"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = From cf6a2bafaf72dbb3cec843630c769d5ed7fc7999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 18 Nov 2022 13:29:30 +0100 Subject: [PATCH 38/58] :rocket: add gaming as module for laptop --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index dd0e546..2e2363c 100644 --- a/flake.nix +++ b/flake.nix @@ -117,6 +117,7 @@ hosts.nixos-laptop.modules = [ ./hosts/nixos-laptop self.nixosModules.desktop + self.nixosModules.gaming ]; hosts.nixos-desktop.modules = [ From e90fd62f5e177385f854e38b83db1026bf47015e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 24 Nov 2022 13:47:48 +0100 Subject: [PATCH 39/58] :sparkles: clean up --- flake.lock | 121 +------------------------------------- flake.nix | 18 ------ modules/profiles/base.nix | 2 +- modules/programs/fish.nix | 6 -- overlays/default.nix | 1 - 5 files changed, 4 insertions(+), 144 deletions(-) diff --git a/flake.lock b/flake.lock index f4eef20..c98adf4 100644 --- a/flake.lock +++ b/flake.lock @@ -53,65 +53,6 @@ "type": "github" } }, - "base16": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1658847131, - "narHash": "sha256-X6Mml7cT0YR3WCD5fkUhpRVV5ZPcwdcDsND8r8xMqTE=", - "owner": "SenchoPens", - "repo": "base16.nix", - "rev": "6b404cda2e04ca3cf5ca7b877af9c469e1386acb", - "type": "github" - }, - "original": { - "owner": "SenchoPens", - "repo": "base16.nix", - "type": "github" - } - }, - "comma": { - "inputs": { - "flake-compat": "flake-compat", - "naersk": "naersk", - "nixpkgs": [ - "nixpkgs" - ], - "utils": "utils" - }, - "locked": { - "lastModified": 1666010793, - "narHash": "sha256-6zhTpR0cfaHrupOXRZAdCzLAGINgsB6h3HQnj7+qHWs=", - "owner": "nix-community", - "repo": "comma", - "rev": "691120d169189f3a9cb29b1c72bcd521ac372b2b", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "comma", - "type": "github" - } - }, - "dracula-fish": { - "flake": false, - "locked": { - "lastModified": 1657833273, - "narHash": "sha256-WywEGAGaRwfHJpT+B3oKoyrnLJZxURTQ+MK9e5Asxl0=", - "owner": "dracula", - "repo": "fish", - "rev": "610147cc384ff161fbabb9a9ebfd22b743f82b67", - "type": "github" - }, - "original": { - "owner": "dracula", - "repo": "fish", - "type": "github" - } - }, "emacs-overlay": { "inputs": { "flake-utils": "flake-utils", @@ -133,22 +74,6 @@ "type": "github" } }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-utils": { "locked": { "lastModified": 1667395993, @@ -230,7 +155,7 @@ "nixpkgs": [ "nixpkgs" ], - "utils": "utils_2" + "utils": "utils" }, "locked": { "lastModified": 1667708081, @@ -283,28 +208,6 @@ "type": "github" } }, - "naersk": { - "inputs": { - "nixpkgs": [ - "comma", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1662220400, - "narHash": "sha256-9o2OGQqu4xyLZP9K6kNe1pTHnyPz0Wr3raGYnr9AIgY=", - "owner": "nix-community", - "repo": "naersk", - "rev": "6944160c19cb591eb85bbf9b2f2768a935623ed3", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "master", - "repo": "naersk", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1667669848, @@ -384,9 +287,6 @@ "agenix": "agenix", "arkenfox-userjs": "arkenfox-userjs", "asus-touchpad-numpad-driver": "asus-touchpad-numpad-driver", - "base16": "base16", - "comma": "comma", - "dracula-fish": "dracula-fish", "emacs-overlay": "emacs-overlay", "forgit-git": "forgit-git", "home-manager": "home-manager", @@ -395,7 +295,7 @@ "nixpkgs": "nixpkgs", "pre-commit-hooks": "pre-commit-hooks_2", "stable": "stable", - "utils": "utils_3" + "utils": "utils_2" } }, "stable": { @@ -415,21 +315,6 @@ } }, "utils": { - "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "utils_2": { "locked": { "lastModified": 1667395993, "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", @@ -444,7 +329,7 @@ "type": "github" } }, - "utils_3": { + "utils_2": { "inputs": { "flake-utils": "flake-utils_4" }, diff --git a/flake.nix b/flake.nix index 2e2363c..bdb2968 100644 --- a/flake.nix +++ b/flake.nix @@ -29,17 +29,6 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - comma = { - url = "github:nix-community/comma"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - # Fish specific - dracula-fish = { - url = "github:dracula/fish"; - flake = false; - }; - # Zsh specific forgit-git = { url = "github:wfxr/forgit"; @@ -57,12 +46,6 @@ flake = false; }; - # Theming - base16 = { - url = "github:SenchoPens/base16.nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - howdy = { url = "sourcehut:~moritzboehme/howdy"; inputs.nixpkgs.follows = "nixpkgs"; @@ -110,7 +93,6 @@ }; } inputs.agenix.nixosModules.age - inputs.base16.nixosModule inputs.howdy.nixosModules.default ]; diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index d00a341..6bccdc3 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -109,6 +109,7 @@ with lib; programs = { mtr.enable = true; command-not-found.enable = true; + starship.enable = true; }; services = { @@ -130,7 +131,6 @@ with lib; # Let Home Manager install and manage itself. home-manager.enable = true; fzf.enable = true; - starship.enable = true; }; home = { username = "moritz"; diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index a2d64c8..c143217 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -73,12 +73,6 @@ in fish_greeting = ""; cheat = "cht.sh $argv | bat -p"; }; - plugins = [ - { - name = "dracula"; - src = inputs.dracula-fish; - } - ]; }; fzf.enableFishIntegration = true; starship.enableFishIntegration = true; diff --git a/overlays/default.nix b/overlays/default.nix index 5f8d1a9..a31bed2 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,5 +1,4 @@ { inputs }: final: prev: { - inherit (inputs.comma.packages."${prev.system}") comma; nixpkgs-review-checks = inputs.nixpkgs-review-checks.defaultPackage."${prev.system}"; agenix = inputs.agenix.defaultPackage."${prev.system}"; master = import inputs.master { From ad7ba759a64b5043da4cc6436216764573d6a334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 24 Nov 2022 13:45:23 +0100 Subject: [PATCH 40/58] :rocket: make polybar smaller --- modules/config/theming/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/config/theming/default.nix b/modules/config/theming/default.nix index eb9180f..deedad2 100644 --- a/modules/config/theming/default.nix +++ b/modules/config/theming/default.nix @@ -41,15 +41,15 @@ in monitor = "\${env:MONITOR}"; bottom = true; width = "100%"; - heigth = 20; + heigth = 15; - border-size = 5; + border-size = 2; separator = " "; - font-0 = "FiraCode Nerd Font:size=9;0"; - font-1 = "FiraCode Nerd Font:size=9;1"; - font-2 = "FiraCode Nerd Font:size=9;2"; + font-0 = "FiraCode Nerd Font:size=8;0"; + font-1 = "FiraCode Nerd Font:size=8;1"; + font-2 = "FiraCode Nerd Font:size=8;2"; modules-left = "cpu memory network battery"; modules-center = "bspwm"; From 9918bfe0c69c426f52a3f36eb64dea28e1668de8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 25 Nov 2022 10:24:29 +0100 Subject: [PATCH 41/58] :rocket: add hyprland module --- flake.lock | 60 ++++++++- flake.nix | 5 + hosts/nixos-desktop/default.nix | 8 +- hosts/nixos-laptop/default.nix | 12 +- modules/config/nix.nix | 2 + modules/profiles/desktop.nix | 2 +- modules/programs/default.nix | 1 + modules/programs/hyprland/default.nix | 71 +++++++++++ modules/programs/hyprland/hyprland.conf | 160 ++++++++++++++++++++++++ modules/programs/rofi/default.nix | 2 +- overlays/default.nix | 6 + 11 files changed, 318 insertions(+), 11 deletions(-) create mode 100644 modules/programs/hyprland/default.nix create mode 100644 modules/programs/hyprland/hyprland.conf diff --git a/flake.lock b/flake.lock index c98adf4..9bcef5d 100644 --- a/flake.lock +++ b/flake.lock @@ -193,6 +193,25 @@ "type": "sourcehut" } }, + "hyprland": { + "inputs": { + "nixpkgs": "nixpkgs", + "wlroots": "wlroots" + }, + "locked": { + "lastModified": 1669309881, + "narHash": "sha256-Au7BTeUe++JCOWwvO4O3xLpWlZlbmsOJK+EurjIbgqE=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "379597e78f512ff2d64a83ba3eb21b7a3444d4f9", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, "master": { "locked": { "lastModified": 1667830549, @@ -209,6 +228,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1668765800, + "narHash": "sha256-rC40+/W6Hio7b/RsY8SvQPKNx4WqNcTgfYv8cUMAvJk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "52b2ac8ae18bbad4374ff0dd5aeee0fdf1aea739", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1667669848, "narHash": "sha256-nD2dk2A+1zUlUT18ppDFVWwimi26+ultc2QRsulQwQ8=", @@ -224,7 +259,7 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_3": { "locked": { "lastModified": 1667292599, "narHash": "sha256-7ISOUI1aj6UKMPIL+wwthENL22L3+A9V+jS8Is3QsRo=", @@ -266,7 +301,7 @@ "pre-commit-hooks_2": { "inputs": { "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1667760143, @@ -291,8 +326,9 @@ "forgit-git": "forgit-git", "home-manager": "home-manager", "howdy": "howdy", + "hyprland": "hyprland", "master": "master", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "pre-commit-hooks": "pre-commit-hooks_2", "stable": "stable", "utils": "utils_2" @@ -346,6 +382,24 @@ "repo": "flake-utils-plus", "type": "github" } + }, + "wlroots": { + "flake": false, + "locked": { + "host": "gitlab.freedesktop.org", + "lastModified": 1668785720, + "narHash": "sha256-CX+PYJP2PxZWL380WzyMNsrfRgIb/78brdwvDg/zj28=", + "owner": "wlroots", + "repo": "wlroots", + "rev": "4ff46e6cf9463e594605928feeb7c55cf323b5e7", + "type": "gitlab" + }, + "original": { + "host": "gitlab.freedesktop.org", + "owner": "wlroots", + "repo": "wlroots", + "type": "gitlab" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index bdb2968..5336489 100644 --- a/flake.nix +++ b/flake.nix @@ -50,6 +50,10 @@ url = "sourcehut:~moritzboehme/howdy"; inputs.nixpkgs.follows = "nixpkgs"; }; + + hyprland = { + url = "github:hyprwm/Hyprland"; + }; }; outputs = @@ -92,6 +96,7 @@ extraSpecialArgs = { inherit inputs self; }; }; } + inputs.hyprland.nixosModules.default inputs.agenix.nixosModules.age inputs.howdy.nixosModules.default ]; diff --git a/hosts/nixos-desktop/default.nix b/hosts/nixos-desktop/default.nix index 32cf357..0bbdc40 100644 --- a/hosts/nixos-desktop/default.nix +++ b/hosts/nixos-desktop/default.nix @@ -4,6 +4,7 @@ { lib , config , pkgs +, inputs , ... }: { imports = [ @@ -13,7 +14,7 @@ # KERNEL # HACK to get nvidia driver to build - # boot.kernelPackages = pkgs.linuxPackages_latest; + boot.kernelPackages = pkgs.linuxPackages_latest; # BOOT boot = { @@ -59,12 +60,13 @@ ''; }; - services.xserver.videoDrivers = [ "nvidia" ]; + # services.xserver.videoDrivers = [ "nvidia" ]; hardware.opengl = { enable = true; driSupport32Bit = true; + driSupport = true; }; - hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_470; + # hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_470; services.xserver.xrandrHeads = [ { output = "HDMI-1"; } { diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index 8bb6c1d..4c7130d 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -11,9 +11,15 @@ ./hardware-configuration.nix ]; - services.howdy = { - enable = true; - certainty = 3.0; + # services.howdy = { + # enable = true; + # certainty = 3.0; + # }; + + + my.programs = { + bspwm.enable = false; + hyprland.enable = true; }; # BOOT diff --git a/modules/config/nix.nix b/modules/config/nix.nix index 0dbd9ff..a932cbb 100644 --- a/modules/config/nix.nix +++ b/modules/config/nix.nix @@ -51,12 +51,14 @@ in "https://jupyterwith.cachix.org" "https://nix-community.cachix.org" "https://pre-commit-hooks.cachix.org" + "https://hyprland.cachix.org" ]; trusted-public-keys = [ "jupyterwith.cachix.org-1:/kDy2B6YEhXGJuNguG1qyqIodMyO4w8KwWH4/vAc7CI=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc=" + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ]; trusted-users = [ "root" "@wheel" ]; diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index 3334689..b56dd38 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -20,7 +20,7 @@ with lib; { programs = { adb.enable = true; - bspwm.enable = true; + bspwm.enable = mkDefault true; code.enable = true; emacs.enable = true; firefox = { diff --git a/modules/programs/default.nix b/modules/programs/default.nix index 82e2dd4..abc4c23 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -32,5 +32,6 @@ ./xmonad ./zathura.nix ./zsh.nix + ./hyprland ]; } diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix new file mode 100644 index 0000000..d05ad4c --- /dev/null +++ b/modules/programs/hyprland/default.nix @@ -0,0 +1,71 @@ +{ config +, lib +, pkgs +, inputs +, ... +}: + +with lib; +let + cfg = config.my.programs.hyprland; + + hyprland-default = inputs.hyprland.packages.${pkgs.system}.default; + hyprland-nvidia = hyprland-default.override { nvidiaPatches = true; }; + hyprland = if cfg.nvidiaSupport then hyprland-nvidia else hyprland-default; +in +{ + options.my.programs.hyprland = { + enable = mkEnableOption "hyprland"; + nvidiaSupport = mkEnableOption "enable nvidia Support"; + }; + + config = mkIf cfg.enable { + home-manager.users.moritz = { + imports = [ inputs.hyprland.homeManagerModules.default ]; + programs.waybar = { + enable = true; + package = pkgs.waybar-hyprland; + systemd.enable = true; + settings = { + mainBar = { + layer = "top"; + position = "top"; + height = 30; + output = [ + "eDP-1" + "HDMI-A-1" + ]; + modules-left = [ "wlr/workspaces" ]; + modules-center = [ "hyprland/window" ]; + modules-right = [ "network" "memory" "cpu" "battery" "clock" ]; + modules = { + "wlr/workspaces" = { + on-click = "activate"; + }; + }; + }; + }; + }; + wayland.windowManager.hyprland = { + enable = true; + package = hyprland; + extraConfig = builtins.readFile ./hyprland.conf; + }; + }; + programs.hyprland = { + enable = true; + package = null; + }; + services.xserver = { + enable = true; + displayManager = { + gdm.enable = true; + sessionPackages = [ hyprland ]; + }; + }; + xdg.portal = { + enable = true; + wlr.enable = true; + }; + }; +} diff --git a/modules/programs/hyprland/hyprland.conf b/modules/programs/hyprland/hyprland.conf new file mode 100644 index 0000000..c8ac776 --- /dev/null +++ b/modules/programs/hyprland/hyprland.conf @@ -0,0 +1,160 @@ +# +# Please note not all available settings / options are set here. +# For a full list, see the wiki +# + +# See https://wiki.hyprland.org/Configuring/Monitors/ +monitor=,preferred,auto,1 + + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more + +# Execute your favorite apps at launch +# exec-once = waybar & hyprpaper & firefox + +# Source a file (multi-file configs) +# source = ~/.config/hypr/myColors.conf + +# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ +input { + kb_layout = de + kb_variant = + kb_model = + kb_options = + kb_rules = + + follow_mouse = 1 + + touchpad { + natural_scroll = yes + } + + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. +} + +general { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + gaps_in = 5 + gaps_out = 5 + border_size = 2 + col.active_border = rgba(1affffee) + col.inactive_border = rgba(595959aa) + + layout = dwindle +} + +decoration { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + rounding = 5 + inactive_opacity = 0.98 + blur = yes + blur_size = 8 + blur_passes = 1 + blur_new_optimizations = on + + drop_shadow = yes + shadow_range = 4 + shadow_render_power = 3 + col.shadow = rgba(1a1a1aee) +} + +animations { + enabled = yes + + # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + + bezier = myBezier, 0.45, 0, 0.55, 1 + + animation = windows, 1, 3, myBezier + animation = windowsOut, 1, 3, myBezier + animation = border, 1, 3, myBezier + animation = fade, 1, 3, myBezier + animation = workspaces, 1, 3, myBezier +} + +dwindle { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = yes # you probably want this +} + +master { + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + new_is_master = true +} + +gestures { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + workspace_swipe = on +} + +# Example per-device config +# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more +device:epic mouse V1 { + sensitivity = -0.5 +} + +# Example windowrule v1 +# windowrule = float, ^(kitty)$ +# Example windowrule v2 +# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ +windowrulev2 = float,class:^(rofi)$ +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more +$mainMod = SUPER +$windowMod = ALT + +# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more +bind = $mainMod, RETURN, exec, kitty +bind = $mainMod, Q, killactive, +bind = $mainMod, M, exit, +bind = $mainMod, E, exec, emacsclient -c -a emacs +bind = $mainMod, F, togglefloating, +bind = $mainMod, D, exec, rofi -show combi +bind = $mainMod, P, pseudo, # dwindle +bind = $mainMod, T, togglesplit, # dwindle + +# Move focus with mainMod + arrow keys +bind = $mainMod, H, movefocus, l +bind = $mainMod, L, movefocus, r +bind = $mainMod, K, movefocus, u +bind = $mainMod, J, movefocus, d + +# Switch workspaces with mainMod + [0-9] +bind = $mainMod, 1, workspace, 1 +bind = $mainMod, 2, workspace, 2 +bind = $mainMod, 3, workspace, 3 +bind = $mainMod, 4, workspace, 4 +bind = $mainMod, 5, workspace, 5 +bind = $mainMod, 6, workspace, 6 +bind = $mainMod, 7, workspace, 7 +bind = $mainMod, 8, workspace, 8 +bind = $mainMod, 9, workspace, 9 +bind = $mainMod, 0, workspace, 10 + +# Move active window to a workspace with mainMod + SHIFT + [0-9] +bind = $mainMod SHIFT, 1, movetoworkspace, 1 +bind = $mainMod SHIFT, 2, movetoworkspace, 2 +bind = $mainMod SHIFT, 3, movetoworkspace, 3 +bind = $mainMod SHIFT, 4, movetoworkspace, 4 +bind = $mainMod SHIFT, 5, movetoworkspace, 5 +bind = $mainMod SHIFT, 6, movetoworkspace, 6 +bind = $mainMod SHIFT, 7, movetoworkspace, 7 +bind = $mainMod SHIFT, 8, movetoworkspace, 8 +bind = $mainMod SHIFT, 9, movetoworkspace, 9 +bind = $mainMod SHIFT, 0, movetoworkspace, 10 + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, mouse_down, workspace, e+1 +bind = $mainMod, mouse_up, workspace, e-1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow + +exec-once=synology-drive +exec-once=waybar diff --git a/modules/programs/rofi/default.nix b/modules/programs/rofi/default.nix index 56fa79a..1bb06dd 100644 --- a/modules/programs/rofi/default.nix +++ b/modules/programs/rofi/default.nix @@ -21,7 +21,7 @@ in programs.rofi = { enable = true; package = - pkgs.rofi.override { plugins = with pkgs; [ rofi-calc rofi-emoji ]; }; + pkgs.rofi-wayland.override { plugins = with pkgs; [ rofi-calc rofi-emoji ]; }; extraConfig = { combi-modi = "drun,window,emoji"; }; }; xdg = { diff --git a/overlays/default.nix b/overlays/default.nix index a31bed2..505736f 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,6 +1,12 @@ { inputs }: final: prev: { nixpkgs-review-checks = inputs.nixpkgs-review-checks.defaultPackage."${prev.system}"; agenix = inputs.agenix.defaultPackage."${prev.system}"; + waybar-hyprland = prev.waybar.overrideAttrs (old: { + postPatch = old.postPatch or "" + '' + ${final.gnused}/bin/sed -i 's,zext_workspace_handle_v1_activate(workspace_handle_);,const std::string command = "${final.hyprland}/bin/hyprctl dispatch workspace " + name_;\n\tsystem(command.c_str());,g' src/modules/wlr/workspace_manager.cpp + ''; + mesonFlags = old.mesonFlags or [ ] ++ [ "-Dexperimental=true" ]; + }); master = import inputs.master { inherit (prev) system; config.allowUnfree = true; From cd1d55d6428501c923d761261c36abd231a8d4b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 26 Nov 2022 11:37:59 +0100 Subject: [PATCH 42/58] :lock: update inputs --- flake.lock | 128 +++++++++++++++++++++++++---------- flake.nix | 2 +- modules/profiles/desktop.nix | 2 +- modules/programs/emacs.nix | 2 +- 4 files changed, 96 insertions(+), 38 deletions(-) diff --git a/flake.lock b/flake.lock index c98adf4..44334c4 100644 --- a/flake.lock +++ b/flake.lock @@ -23,11 +23,11 @@ "arkenfox-userjs": { "flake": false, "locked": { - "lastModified": 1667741320, - "narHash": "sha256-WB9w/UoFqp/WyRhe87dNqwbMAXa8lmsK/QCeTzRWmj8=", + "lastModified": 1669146650, + "narHash": "sha256-9FCZt15lrL/aeDaUBFh+U2A4PlTj0jUKbjUbGIFUBik=", "owner": "arkenfox", "repo": "user.js", - "rev": "8a65c5a7bad0ec764d968b0941ebdf01bdcd2408", + "rev": "6789dc7fefac5594d958a065463b4dc9d265c089", "type": "github" }, "original": { @@ -61,11 +61,11 @@ ] }, "locked": { - "lastModified": 1667823539, - "narHash": "sha256-AwDCZgUT004T+skxK62ZWAlP+60yomMaHb0/+hHH448=", + "lastModified": 1669439968, + "narHash": "sha256-VlQsxaHruFN29FOvRHUYecySRU9UzFqqpshfgoGxKes=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "a864e84bd842d00d686e040f552e2fa7030351a0", + "rev": "838bd1e55d9168d2df9dc0331565f884c3be3250", "type": "github" }, "original": { @@ -74,6 +74,22 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1668681692, + "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "009399224d5e398d03b22badca40a37ac85412a1", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1667395993, @@ -106,11 +122,11 @@ }, "flake-utils_3": { "locked": { - "lastModified": 1667077288, - "narHash": "sha256-bdC8sFNDpT0HK74u9fUkpbf1MEzVYJ+ka7NXCdgBoaA=", + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "owner": "numtide", "repo": "flake-utils", - "rev": "6ee9ebb6b1ee695d2cacc4faa053a7b9baa76817", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "type": "github" }, "original": { @@ -137,11 +153,11 @@ "forgit-git": { "flake": false, "locked": { - "lastModified": 1665756353, - "narHash": "sha256-NKL4c4k9Nath8NQ3sWUTGUzp517jRX4v0qVaKMJSMrw=", + "lastModified": 1669300261, + "narHash": "sha256-ca7EM/F0Spsdr3MbjIVwbjLVXg6/qWGczBQHLCcpU5A=", "owner": "wfxr", "repo": "forgit", - "rev": "2872548075e63bc83a0b960e2813b16571998563", + "rev": "98321ef05a10fe1b536ae88e283339e769866e24", "type": "github" }, "original": { @@ -150,6 +166,27 @@ "type": "github" } }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -158,11 +195,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1667708081, - "narHash": "sha256-FChEy05x4ed/pttjfTeKxjPCnHknMYrUtDyBiYbreT4=", + "lastModified": 1669328018, + "narHash": "sha256-aJRMobnNDEXKwoSZFS4hGjGU1WDNxkQ82BVKAEohOfY=", "owner": "nix-community", "repo": "home-manager", - "rev": "1ef0da321217c6c19b7a30509631c080a19321e5", + "rev": "62cb5bcf93896e4dd6b4507dac7ba2e2e3abc9d7", "type": "github" }, "original": { @@ -195,11 +232,11 @@ }, "master": { "locked": { - "lastModified": 1667830549, - "narHash": "sha256-4ndTwPd+lMMWN/3oJlEBxkVw+8wQs9hB5a2+CvyHHwI=", + "lastModified": 1669458704, + "narHash": "sha256-wpaBMBfjSDCnw4F7A1xBdqy2nW7dvjk3coISy+tTmX4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1ef74a785480396ba179200196cac8256a67cfce", + "rev": "3200a569242cdc75c191fc28b6adefe60315e921", "type": "github" }, "original": { @@ -210,11 +247,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1667669848, - "narHash": "sha256-nD2dk2A+1zUlUT18ppDFVWwimi26+ultc2QRsulQwQ8=", + "lastModified": 1669387357, + "narHash": "sha256-z1azVj/5Em5kGhh9OgBOsjTEgMab7hXL/aRilH9tzyI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1f3ebb2bd1a353a42e8f833895c26d8415c7b791", + "rev": "55b3f68bda6d4f4dc6092eed0508063f154fa4fd", "type": "github" }, "original": { @@ -224,18 +261,36 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs-stable": { "locked": { - "lastModified": 1667292599, - "narHash": "sha256-7ISOUI1aj6UKMPIL+wwthENL22L3+A9V+jS8Is3QsRo=", + "lastModified": 1668984258, + "narHash": "sha256-0gDMJ2T3qf58xgcSbYoXiRGUkPWmKyr5C3vcathWhKs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ef2f213d9659a274985778bff4ca322f3ef3ac68", + "rev": "cf63ade6f74bbc9d2a017290f1b2e33e8fbfa70a", "type": "github" }, "original": { - "id": "nixpkgs", - "type": "indirect" + "owner": "NixOS", + "ref": "nixos-22.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1668994630, + "narHash": "sha256-1lqx6HLyw6fMNX/hXrrETG1vMvZRGm2XVC9O/Jt0T6c=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "af50806f7c6ab40df3e6b239099e8f8385f6c78b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" } }, "pre-commit-hooks": { @@ -265,15 +320,18 @@ }, "pre-commit-hooks_2": { "inputs": { + "flake-compat": "flake-compat", "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_2" + "gitignore": "gitignore", + "nixpkgs": "nixpkgs_2", + "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1667760143, - "narHash": "sha256-+X5CyeNEKp41bY/I1AJgW/fn69q5cLJ1bgiaMMCKB3M=", + "lastModified": 1669152228, + "narHash": "sha256-FEDReoTLWJHXcNso7aaAlAUU7uOqIR6Hc/C/nqlfooE=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "06f48d63d473516ce5b8abe70d15be96a0147fcd", + "rev": "078b0dee35e2da01334af682ec347463b70a9986", "type": "github" }, "original": { @@ -300,16 +358,16 @@ }, "stable": { "locked": { - "lastModified": 1667653703, - "narHash": "sha256-Xow4vx52/g5zkhlgZnMEm/TEXsj+13jTPCc2jIhW1xU=", + "lastModified": 1669379897, + "narHash": "sha256-XM3xBfQD5tOtV4KAhQHyh53cJdqkLwotZa5JJIUjbQc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "f09ad462c5a121d0239fde645aacb2221553a217", + "rev": "8690906c4d80db5d85f52313a8487bf2e7b8d4c5", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-22.05", + "ref": "nixos-22.11", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index bdb2968..63bc345 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,7 @@ inputs = { master.url = "github:nixos/nixpkgs"; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - stable.url = "github:nixos/nixpkgs/nixos-22.05"; + stable.url = "github:nixos/nixpkgs/nixos-22.11"; pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index 3334689..4a01e2c 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -113,7 +113,7 @@ with lib; { # ripping abcde handbrake - stable.picard # HACK to fix broken picard 2.8.3 + picard # other anki diff --git a/modules/programs/emacs.nix b/modules/programs/emacs.nix index d9e884c..0059324 100644 --- a/modules/programs/emacs.nix +++ b/modules/programs/emacs.nix @@ -55,7 +55,7 @@ in ## :lang # latex & org (latex previews) - stable.texlive.combined.scheme-full # HACK to fix broken perl package + texlive.combined.scheme-full texlab # nix From 1b536e52b5381c1445c409eed86f6ed03a03580e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 26 Nov 2022 16:02:02 +0100 Subject: [PATCH 43/58] :rocket: improve hyprland experience --- flake.nix | 4 +- hosts/nixos-desktop/default.nix | 8 +- hosts/nixos-laptop/default.nix | 6 - modules/profiles/desktop.nix | 7 +- modules/programs/bspwm/default.nix | 6 + modules/programs/hyprland/config.nix | 178 ++++++++++++++++++++++++ modules/programs/hyprland/default.nix | 74 +++++++++- modules/programs/hyprland/hyprland.conf | 160 --------------------- overlays/default.nix | 2 +- 9 files changed, 263 insertions(+), 182 deletions(-) create mode 100644 modules/programs/hyprland/config.nix delete mode 100644 modules/programs/hyprland/hyprland.conf diff --git a/flake.nix b/flake.nix index 7d32d61..5aff38d 100644 --- a/flake.nix +++ b/flake.nix @@ -51,9 +51,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - hyprland = { - url = "github:hyprwm/Hyprland"; - }; + hyprland.url = "github:hyprwm/Hyprland"; }; outputs = diff --git a/hosts/nixos-desktop/default.nix b/hosts/nixos-desktop/default.nix index 0bbdc40..377c478 100644 --- a/hosts/nixos-desktop/default.nix +++ b/hosts/nixos-desktop/default.nix @@ -12,8 +12,9 @@ ./hardware-configuration.nix ]; + my.programs.hyprland.nvidiaSupport = true; + # KERNEL - # HACK to get nvidia driver to build boot.kernelPackages = pkgs.linuxPackages_latest; # BOOT @@ -59,14 +60,13 @@ nohook resolv.conf ''; }; - - # services.xserver.videoDrivers = [ "nvidia" ]; + hardware.nvidia.modesetting.enable = true; + services.xserver.videoDrivers = [ "nvidia" ]; hardware.opengl = { enable = true; driSupport32Bit = true; driSupport = true; }; - # hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_470; services.xserver.xrandrHeads = [ { output = "HDMI-1"; } { diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index 4c7130d..d89009d 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -16,12 +16,6 @@ # certainty = 3.0; # }; - - my.programs = { - bspwm.enable = false; - hyprland.enable = true; - }; - # BOOT boot = { supportedFilesystems = [ "btrfs" ]; diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index 92d25a9..eaec2b7 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -20,7 +20,7 @@ with lib; { programs = { adb.enable = true; - bspwm.enable = mkDefault true; + hyprland.enable = true; code.enable = true; emacs.enable = true; firefox = { @@ -101,11 +101,6 @@ with lib; { }; }; - programs.xss-lock = { - enable = true; - lockerCommand = "${pkgs.i3lock-fancy-rapid}/bin/i3lock-fancy-rapid 10 5"; - }; - environment.systemPackages = with pkgs; [ # nix nixpkgs-review diff --git a/modules/programs/bspwm/default.nix b/modules/programs/bspwm/default.nix index ffb5448..4ecf68c 100644 --- a/modules/programs/bspwm/default.nix +++ b/modules/programs/bspwm/default.nix @@ -75,6 +75,12 @@ in }; }; }; + + programs.xss-lock = { + enable = true; + lockerCommand = "${pkgs.i3lock-fancy-rapid}/bin/i3lock-fancy-rapid 10 5"; + }; + environment.systemPackages = with pkgs; [ bc # HACK to get bsp-layout to work brightnessctl diff --git a/modules/programs/hyprland/config.nix b/modules/programs/hyprland/config.nix new file mode 100644 index 0000000..51562a3 --- /dev/null +++ b/modules/programs/hyprland/config.nix @@ -0,0 +1,178 @@ +{ config +, lib +, pkgs +, ... +}: +'' + # + # Please note not all available settings / options are set here. + # For a full list, see the wiki + # + + # See https://wiki.hyprland.org/Configuring/Monitors/ + monitor=,preferred,auto,1 + + + # See https://wiki.hyprland.org/Configuring/Keywords/ for more + + # Execute your favorite apps at launch + # exec-once = waybar & hyprpaper & firefox + + # Source a file (multi-file configs) + # source = ~/.config/hypr/myColors.conf + + # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ + input { + kb_layout = de,us + kb_variant = + kb_model = + kb_options = grp:alt_shift_toggle + kb_rules = + + follow_mouse = 1 + + touchpad { + natural_scroll = yes + } + + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. + } + + general { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + gaps_in = 5 + gaps_out = 5 + border_size = 2 + col.active_border = rgba(1affffee) + col.inactive_border = rgba(595959aa) + + layout = dwindle + } + + decoration { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + rounding = 5 + inactive_opacity = 0.98 + blur = yes + blur_size = 8 + blur_passes = 1 + blur_new_optimizations = on + + drop_shadow = yes + shadow_range = 4 + shadow_render_power = 3 + col.shadow = rgba(1a1a1aee) + } + + animations { + enabled = yes + + # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + + bezier = myBezier, 0.45, 0, 0.55, 1 + + animation = windows, 1, 3, myBezier + animation = windowsOut, 1, 3, myBezier + animation = border, 1, 3, myBezier + animation = fade, 1, 3, myBezier + animation = workspaces, 1, 3, myBezier + } + + dwindle { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = yes # you probably want this + no_gaps_when_only = true + } + + master { + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + no_gaps_when_only = true + } + + gestures { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + workspace_swipe = on + } + + # Example per-device config + # See https://wiki.hyprland.org/Configuring/Keywords/#executing for more + device:epic mouse V1 { + sensitivity = -0.5 + } + + # Example windowrule v1 + # windowrule = float, ^(kitty)$ + # Example windowrule v2 + # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ + windowrulev2 = float,class:^([rR]ofi)$ + # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + + + # See https://wiki.hyprland.org/Configuring/Keywords/ for more + $mainMod = SUPER + $windowMod = ALT + + # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more + bind = $mainMod, D, exec, hyprctl keyword general:layout dwindle + bind = $mainMod, E, exec, emacsclient -c -a emacs + bind = $mainMod, F, togglefloating, + bind = $mainMod, M, exec, hyprctl keyword general:layout master + bind = $mainMod, P, pseudo, # dwindle + bind = $mainMod, Q, killactive, + bind = $mainMod, R, exec, rofi -show combi + bind = $mainMod, C, exec, rofi -show calc -modi calc -no-show-match -no-sort | xclip -selection clipboard + bind = $mainMod, B, exec, rofi-bluetooth + bind = $mainMod, RETURN, exec, kitty + bind = $mainMod, T, togglesplit, # dwindle + bind = , XF86AudioLowerVolume, exec, pamixer -d 5 + bind = , XF86AudioMute, exec, pamixer -t + bind = , XF86AudioNext, exec, playerctl -p "spotifyd,firefox" next + bind = , XF86AudioPlay, exec, playerctl -p "spotifyd,firefox" play-pause + bind = , XF86AudioPrev, exec, playerctl -p "spotifyd,firefox" previous + bind = , XF86AudioRaiseVolume, exec, pamixer -i 5 + bind = , XF86MonBrightnessDown, exec, brightnessctl s 10%- + bind = , XF86MonBrightnessUp, exec, brightnessctl s 10%+ + + # Move focus with mainMod + hjkl + bind = $mainMod, H, movefocus, l + bind = $mainMod, L, movefocus, r + bind = $mainMod, K, movefocus, u + bind = $mainMod, J, movefocus, d + + # Switch workspaces with mainMod + [0-9] + bind = $mainMod, 1, workspace, 1 + bind = $mainMod, 2, workspace, 2 + bind = $mainMod, 3, workspace, 3 + bind = $mainMod, 4, workspace, 4 + bind = $mainMod, 5, workspace, 5 + bind = $mainMod, 6, workspace, 6 + bind = $mainMod, 7, workspace, 7 + bind = $mainMod, 8, workspace, 8 + bind = $mainMod, 9, workspace, 9 + bind = $mainMod, 0, workspace, 10 + + # Move active window to a workspace with mainMod + SHIFT + [0-9] + bind = $mainMod SHIFT, 1, movetoworkspace, 1 + bind = $mainMod SHIFT, 2, movetoworkspace, 2 + bind = $mainMod SHIFT, 3, movetoworkspace, 3 + bind = $mainMod SHIFT, 4, movetoworkspace, 4 + bind = $mainMod SHIFT, 5, movetoworkspace, 5 + bind = $mainMod SHIFT, 6, movetoworkspace, 6 + bind = $mainMod SHIFT, 7, movetoworkspace, 7 + bind = $mainMod SHIFT, 8, movetoworkspace, 8 + bind = $mainMod SHIFT, 9, movetoworkspace, 9 + bind = $mainMod SHIFT, 0, movetoworkspace, 10 + + # Scroll through existing workspaces with mainMod + scroll + bind = $mainMod, mouse_down, workspace, e+1 + bind = $mainMod, mouse_up, workspace, e-1 + + # Move/resize windows with mainMod + LMB/RMB and dragging + bindm = $mainMod, mouse:272, movewindow + bindm = $mainMod, mouse:273, resizewindow + + exec-once=synology-drive +'' diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix index d05ad4c..42dec13 100644 --- a/modules/programs/hyprland/default.nix +++ b/modules/programs/hyprland/default.nix @@ -3,7 +3,7 @@ , pkgs , inputs , ... -}: +} @ args: with lib; let @@ -22,6 +22,7 @@ in config = mkIf cfg.enable { home-manager.users.moritz = { imports = [ inputs.hyprland.homeManagerModules.default ]; + programs.waybar = { enable = true; package = pkgs.waybar-hyprland; @@ -34,6 +35,7 @@ in output = [ "eDP-1" "HDMI-A-1" + "HDMI-A-2" ]; modules-left = [ "wlr/workspaces" ]; modules-center = [ "hyprland/window" ]; @@ -46,23 +48,91 @@ in }; }; }; + wayland.windowManager.hyprland = { enable = true; package = hyprland; - extraConfig = builtins.readFile ./hyprland.conf; + extraConfig = import ./config.nix args; }; + + services.swayidle = { + enable = true; + events = [ + { + event = "before-sleep"; + command = "${pkgs.swaylock-effects}/bin/swaylock -fF"; + } + { + event = "lock"; + command = "${pkgs.swaylock-effects}/bin/swaylock -fF"; + } + ]; + timeouts = [ + { + timeout = 300; + command = "${hyprland}/bin/hyprctl dispatch dpms off"; + resumeCommand = "${hyprland}/bin/hyprctl dispatch dpms on"; + } + { + timeout = 310; + command = "${pkgs.systemd}/bin/loginctl lock-session"; + } + ]; + }; + + # start swayidle as part of hyprland, not sway + systemd.user.services.swayidle.Install.WantedBy = lib.mkForce [ "hyprland-session.target" ]; }; + + users.users.moritz.packages = with pkgs; [ + swayidle + swaylock-effects + pamixer + playerctl + brightnessctl + ]; + + security.pam.services.swaylock = { }; + programs.hyprland = { enable = true; package = null; }; + + environment.sessionVariables = + { + XDG_CURRENT_DESKTOP = "Hyprland"; + XDG_SESSION_TYPE = "wayland"; + XDG_SESSION_DESKTOP = "Hyprland"; + QT_AUTO_SCREEN_SCALE_FACTOR = "1"; + QT_QPA_PLATFORM = "wayland;xcb"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + QT_QPA_PLATFORMTHEME = "qt5ct"; + _JAVA_AWT_WM_NONEREPARENTING = "1"; + } // + (if cfg.nvidiaSupport then + { + LIBVA_DRIVER_NAME = "nvidia"; + XDG_SESSION_TYPE = "wayland"; + GBM_BACKEND = "nvidia-drm"; + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + WLR_NO_HARDWARE_CURSORS = "1"; + __GL_VRR_ALLOWED = "0"; + } else { }); + services.xserver = { enable = true; displayManager = { gdm.enable = true; + autoLogin = { + enable = true; + user = "moritz"; + }; + defaultSession = "hyprland"; sessionPackages = [ hyprland ]; }; }; + xdg.portal = { enable = true; wlr.enable = true; diff --git a/modules/programs/hyprland/hyprland.conf b/modules/programs/hyprland/hyprland.conf deleted file mode 100644 index c8ac776..0000000 --- a/modules/programs/hyprland/hyprland.conf +++ /dev/null @@ -1,160 +0,0 @@ -# -# Please note not all available settings / options are set here. -# For a full list, see the wiki -# - -# See https://wiki.hyprland.org/Configuring/Monitors/ -monitor=,preferred,auto,1 - - -# See https://wiki.hyprland.org/Configuring/Keywords/ for more - -# Execute your favorite apps at launch -# exec-once = waybar & hyprpaper & firefox - -# Source a file (multi-file configs) -# source = ~/.config/hypr/myColors.conf - -# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ -input { - kb_layout = de - kb_variant = - kb_model = - kb_options = - kb_rules = - - follow_mouse = 1 - - touchpad { - natural_scroll = yes - } - - sensitivity = 0 # -1.0 - 1.0, 0 means no modification. -} - -general { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - - gaps_in = 5 - gaps_out = 5 - border_size = 2 - col.active_border = rgba(1affffee) - col.inactive_border = rgba(595959aa) - - layout = dwindle -} - -decoration { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - - rounding = 5 - inactive_opacity = 0.98 - blur = yes - blur_size = 8 - blur_passes = 1 - blur_new_optimizations = on - - drop_shadow = yes - shadow_range = 4 - shadow_render_power = 3 - col.shadow = rgba(1a1a1aee) -} - -animations { - enabled = yes - - # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more - - bezier = myBezier, 0.45, 0, 0.55, 1 - - animation = windows, 1, 3, myBezier - animation = windowsOut, 1, 3, myBezier - animation = border, 1, 3, myBezier - animation = fade, 1, 3, myBezier - animation = workspaces, 1, 3, myBezier -} - -dwindle { - # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more - pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below - preserve_split = yes # you probably want this -} - -master { - # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more - new_is_master = true -} - -gestures { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - workspace_swipe = on -} - -# Example per-device config -# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more -device:epic mouse V1 { - sensitivity = -0.5 -} - -# Example windowrule v1 -# windowrule = float, ^(kitty)$ -# Example windowrule v2 -# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ -windowrulev2 = float,class:^(rofi)$ -# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more - - -# See https://wiki.hyprland.org/Configuring/Keywords/ for more -$mainMod = SUPER -$windowMod = ALT - -# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more -bind = $mainMod, RETURN, exec, kitty -bind = $mainMod, Q, killactive, -bind = $mainMod, M, exit, -bind = $mainMod, E, exec, emacsclient -c -a emacs -bind = $mainMod, F, togglefloating, -bind = $mainMod, D, exec, rofi -show combi -bind = $mainMod, P, pseudo, # dwindle -bind = $mainMod, T, togglesplit, # dwindle - -# Move focus with mainMod + arrow keys -bind = $mainMod, H, movefocus, l -bind = $mainMod, L, movefocus, r -bind = $mainMod, K, movefocus, u -bind = $mainMod, J, movefocus, d - -# Switch workspaces with mainMod + [0-9] -bind = $mainMod, 1, workspace, 1 -bind = $mainMod, 2, workspace, 2 -bind = $mainMod, 3, workspace, 3 -bind = $mainMod, 4, workspace, 4 -bind = $mainMod, 5, workspace, 5 -bind = $mainMod, 6, workspace, 6 -bind = $mainMod, 7, workspace, 7 -bind = $mainMod, 8, workspace, 8 -bind = $mainMod, 9, workspace, 9 -bind = $mainMod, 0, workspace, 10 - -# Move active window to a workspace with mainMod + SHIFT + [0-9] -bind = $mainMod SHIFT, 1, movetoworkspace, 1 -bind = $mainMod SHIFT, 2, movetoworkspace, 2 -bind = $mainMod SHIFT, 3, movetoworkspace, 3 -bind = $mainMod SHIFT, 4, movetoworkspace, 4 -bind = $mainMod SHIFT, 5, movetoworkspace, 5 -bind = $mainMod SHIFT, 6, movetoworkspace, 6 -bind = $mainMod SHIFT, 7, movetoworkspace, 7 -bind = $mainMod SHIFT, 8, movetoworkspace, 8 -bind = $mainMod SHIFT, 9, movetoworkspace, 9 -bind = $mainMod SHIFT, 0, movetoworkspace, 10 - -# Scroll through existing workspaces with mainMod + scroll -bind = $mainMod, mouse_down, workspace, e+1 -bind = $mainMod, mouse_up, workspace, e-1 - -# Move/resize windows with mainMod + LMB/RMB and dragging -bindm = $mainMod, mouse:272, movewindow -bindm = $mainMod, mouse:273, resizewindow - -exec-once=synology-drive -exec-once=waybar diff --git a/overlays/default.nix b/overlays/default.nix index 505736f..300887c 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -3,7 +3,7 @@ agenix = inputs.agenix.defaultPackage."${prev.system}"; waybar-hyprland = prev.waybar.overrideAttrs (old: { postPatch = old.postPatch or "" + '' - ${final.gnused}/bin/sed -i 's,zext_workspace_handle_v1_activate(workspace_handle_);,const std::string command = "${final.hyprland}/bin/hyprctl dispatch workspace " + name_;\n\tsystem(command.c_str());,g' src/modules/wlr/workspace_manager.cpp + sed -i 's,zext_workspace_handle_v1_activate(workspace_handle_);,const std::string command = "${final.hyprland}/bin/hyprctl dispatch workspace " + name_;\n\tsystem(command.c_str());,g' src/modules/wlr/workspace_manager.cpp ''; mesonFlags = old.mesonFlags or [ ] ++ [ "-Dexperimental=true" ]; }); From 6b925636cc22e33114f063aca07d9441a74318ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 23 Dec 2022 12:37:57 +0100 Subject: [PATCH 44/58] add logseq wrapped for wayland --- modules/programs/logseq.nix | 2 +- overlays/default.nix | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/programs/logseq.nix b/modules/programs/logseq.nix index 948e39c..35349b3 100644 --- a/modules/programs/logseq.nix +++ b/modules/programs/logseq.nix @@ -13,7 +13,7 @@ in config = mkIf cfg.enable { users.users.moritz.packages = with pkgs; [ - logseq + logseq-wayland ]; xdg.mime.defaultApplications."x-scheme-handler/logseq" = "logseq.desktop"; }; diff --git a/overlays/default.nix b/overlays/default.nix index 300887c..f9685ad 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,6 +1,17 @@ { inputs }: final: prev: { nixpkgs-review-checks = inputs.nixpkgs-review-checks.defaultPackage."${prev.system}"; agenix = inputs.agenix.defaultPackage."${prev.system}"; + + logseq-wayland = prev.symlinkJoin { + name = "logseq"; + paths = [ prev.logseq ]; + nativeBuildInputs = [ prev.makeWrapper ]; + postBuild = '' + wrapProgram $out/bin/logseq \ + --add-flags "--socket=wayland --enable-features=UseOzonePlatform --ozone-platform=wayland" + ''; + }; + waybar-hyprland = prev.waybar.overrideAttrs (old: { postPatch = old.postPatch or "" + '' sed -i 's,zext_workspace_handle_v1_activate(workspace_handle_);,const std::string command = "${final.hyprland}/bin/hyprctl dispatch workspace " + name_;\n\tsystem(command.c_str());,g' src/modules/wlr/workspace_manager.cpp From 8470cbe18243d8bdd0a27b9705b0785458bd60b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 23 Dec 2022 12:39:07 +0100 Subject: [PATCH 45/58] update emacs for custom emacs init --- modules/programs/emacs.nix | 67 ++++++-------------------------------- 1 file changed, 10 insertions(+), 57 deletions(-) diff --git a/modules/programs/emacs.nix b/modules/programs/emacs.nix index 0059324..c754558 100644 --- a/modules/programs/emacs.nix +++ b/modules/programs/emacs.nix @@ -8,7 +8,7 @@ with lib; let cfg = config.my.programs.emacs; - myEmacs = with pkgs; ((emacsPackagesFor emacs).emacsWithPackages + myEmacs = with pkgs; ((emacsPackagesFor emacsPgtk).emacsWithPackages (epkgs: [ epkgs.vterm ])); in { @@ -16,72 +16,25 @@ in config = mkIf cfg.enable { my.shell.aliases = { - emacs = "emacsclient -t -a 'emacs -t'"; + emacs = "emacsclient -nw -a 'emacs -nw'"; }; - fonts.fonts = [ pkgs.emacs-all-the-icons-fonts ]; - environment.systemPackages = with pkgs; [ - ### Emacs itself - binutils # native-comp needs 'as', provided by this + fonts.fonts = with pkgs; [ + emacs-all-the-icons-fonts + (iosevka-bin.override { variant = "aile"; }) + ]; + users.users.moritz.packages = with pkgs; [ myEmacs - ### Doom dependencies - git (ripgrep.override { withPCRE2 = true; }) - gnutls # for TLS connectivity - - ### Optional dependencies - fd # faster projectile indexing - imagemagick # for image-dired - zstd # for undo-fu-session/undo-tree compression - - ### Module dependencies - ## :checkers - # spell + # flyspell (hunspellWithDicts [ hunspellDicts.en_GB-ize hunspellDicts.en_US hunspellDicts.de_DE ]) - # grammar - languagetool - - ## : tools - # lookup & org +roam - sqlite - gcc # HACK to get emacsqlite binary - wordnet - graphviz - - ## :lang - # latex & org (latex previews) - texlive.combined.scheme-full - texlab - - # nix - nixfmt # for formating nix - rnix-lsp - - # markdown & org +pandoc - pandoc - - # python - nodePackages.pyright - - # sh - nodePackages.bash-language-server - - ## :email - # mu4e - mu - isync - - ## :app - # everywhere - xdotool - xorg.xwininfo - xclip - xorg.xprop + # language servers + nil ]; home-manager.users.moritz = { home.sessionPath = [ "/home/moritz/.config/emacs/bin/" ]; From a856565ac98611607cda3e5b4d04d85ccf6fe9a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 23 Dec 2022 12:39:24 +0100 Subject: [PATCH 46/58] update hyprland conf --- flake.nix | 3 ++ modules/programs/hyprland/config.nix | 44 ++++++++++++++++------- modules/programs/hyprland/default.nix | 51 +++++++++++++++++++++------ 3 files changed, 75 insertions(+), 23 deletions(-) diff --git a/flake.nix b/flake.nix index 5aff38d..8710075 100644 --- a/flake.nix +++ b/flake.nix @@ -52,6 +52,8 @@ }; hyprland.url = "github:hyprwm/Hyprland"; + + hyprpaper.url = "github:hyprwm/hyprpaper"; }; outputs = @@ -105,6 +107,7 @@ self.nixosModules.gaming ]; + hosts.nixos-desktop.modules = [ ./hosts/nixos-desktop self.nixosModules.desktop diff --git a/modules/programs/hyprland/config.nix b/modules/programs/hyprland/config.nix index 51562a3..0fcaa86 100644 --- a/modules/programs/hyprland/config.nix +++ b/modules/programs/hyprland/config.nix @@ -3,6 +3,12 @@ , pkgs , ... }: + +with lib; +let + mkRule = rule: windowRegexes: "windowrulev2 = ${rule},${concatStringsSep "," windowRegexes}"; + mkRules = rules: windowRegexes: concatStringsSep "\n" (map (flip mkRule windowRegexes) rules); +in '' # # Please note not all available settings / options are set here. @@ -26,7 +32,7 @@ kb_layout = de,us kb_variant = kb_model = - kb_options = grp:alt_shift_toggle + kb_options = grp:win_space_toggle,caps:escape kb_rules = follow_mouse = 1 @@ -47,29 +53,31 @@ col.active_border = rgba(1affffee) col.inactive_border = rgba(595959aa) + cursor_inactive_timeout = 1 + layout = dwindle } decoration { # See https://wiki.hyprland.org/Configuring/Variables/ for more - rounding = 5 - inactive_opacity = 0.98 + rounding = 3 blur = yes - blur_size = 8 - blur_passes = 1 + blur_size = 3 + blur_passes = 3 blur_new_optimizations = on drop_shadow = yes - shadow_range = 4 - shadow_render_power = 3 - col.shadow = rgba(1a1a1aee) + shadow_range = 10 + shadow_render_power = 2 + + # col.shadow = rgba(1a1a1aee) } animations { enabled = yes - # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + # Some default Lanimations, see https://wiki.hyprland.org/Configuring/Animations/ for more bezier = myBezier, 0.45, 0, 0.55, 1 @@ -90,6 +98,7 @@ master { # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more no_gaps_when_only = true + new_is_master = false } gestures { @@ -103,13 +112,21 @@ sensitivity = -0.5 } - # Example windowrule v1 - # windowrule = float, ^(kitty)$ # Example windowrule v2 # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ - windowrulev2 = float,class:^([rR]ofi)$ # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + # Firefox Sharing Indicator + ${mkRules ["float" "move 49% 40" "noborder"] ["title:^(.*Sharing Indicator)$"]} + + # Rofi + ${mkRules ["float" "opacity 0.95 0.95"] ["class:^([rR]ofi)$"]} + + windowrulev2 = opacity 0.95 0.95,floating:1 + + # Games + # ${mkRules ["opaque" "noblur" "noborder" "noshadow" "forceinput"] ["fullscreen:1"]} + # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER @@ -119,10 +136,11 @@ bind = $mainMod, D, exec, hyprctl keyword general:layout dwindle bind = $mainMod, E, exec, emacsclient -c -a emacs bind = $mainMod, F, togglefloating, + bind = $mainMod SHIFT, F, fullscreen, bind = $mainMod, M, exec, hyprctl keyword general:layout master bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, Q, killactive, - bind = $mainMod, R, exec, rofi -show combi + bind = $mainMod, R, exec, rofi -show combi -normal-window bind = $mainMod, C, exec, rofi -show calc -modi calc -no-show-match -no-sort | xclip -selection clipboard bind = $mainMod, B, exec, rofi-bluetooth bind = $mainMod, RETURN, exec, kitty diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix index 42dec13..064c538 100644 --- a/modules/programs/hyprland/default.nix +++ b/modules/programs/hyprland/default.nix @@ -79,9 +79,28 @@ in } ]; }; - # start swayidle as part of hyprland, not sway systemd.user.services.swayidle.Install.WantedBy = lib.mkForce [ "hyprland-session.target" ]; + + xdg.configFile."hypr/hyprpaper.conf" = { + text = + let + setWallpaper = wallpaper: '' + preload = ${wallpaper} + wallpaper = ,${wallpaper} + ''; + in + # setWallpaper "/home/moritz/.config/wallpapers/a_short_walk.png"; + setWallpaper "/home/moritz/.config/wallpapers/mario.gif"; + onChange = "${pkgs.systemd}/bin/systemctl restart --user hyprpaper.service"; + }; + }; + systemd.user.services.hyprpaper = { + enable = true; + path = [ pkgs.hyprpaper ]; + wantedBy = [ "display-manager.service" ]; + after = [ "display-manager.service" ]; + script = "hyprpaper"; }; users.users.moritz.packages = with pkgs; [ @@ -90,6 +109,8 @@ in pamixer playerctl brightnessctl + slurp + grim ]; security.pam.services.swaylock = { }; @@ -120,18 +141,28 @@ in __GL_VRR_ALLOWED = "0"; } else { }); - services.xserver = { - enable = true; - displayManager = { - gdm.enable = true; - autoLogin = { - enable = true; - user = "moritz"; + services = { + dbus.enable = true; + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + xserver = { + enable = true; + displayManager = { + gdm.enable = true; + autoLogin = { + enable = true; + user = "moritz"; + }; + defaultSession = "hyprland"; + sessionPackages = [ hyprland ]; }; - defaultSession = "hyprland"; - sessionPackages = [ hyprland ]; }; }; + security.rtkit.enable = true; xdg.portal = { enable = true; From 050d6d90c1ec9a31d4f8d73d6d4c1f81036f0676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 23 Dec 2022 12:40:37 +0100 Subject: [PATCH 47/58] minor changes --- modules/profiles/base.nix | 3 ++- modules/profiles/desktop.nix | 7 ++++++- modules/profiles/gaming.nix | 1 + modules/programs/bspwm/default.nix | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index 6bccdc3..08e96e6 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -93,6 +93,7 @@ with lib; hut lazygit neofetch + ripgrep tmux ttyper up @@ -102,7 +103,7 @@ with lib; fonts.fonts = with pkgs; [ (nerdfonts.override { - fonts = [ "FiraCode" "DroidSansMono" "JetBrainsMono" ]; + fonts = [ "FiraCode" ]; }) ]; diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index eaec2b7..835e14b 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -122,10 +122,15 @@ with lib; { vlc thunderbird plantuml + + jetbrains.pycharm-professional + + synology-drive-client ]; + programs.chromium.enable = true; + home-manager.users.moritz = { - services.unclutter.enable = true; services.nextcloud-client = { enable = true; startInBackground = true; diff --git a/modules/profiles/gaming.nix b/modules/profiles/gaming.nix index e5b542d..f6d6ac2 100644 --- a/modules/profiles/gaming.nix +++ b/modules/profiles/gaming.nix @@ -8,5 +8,6 @@ lutris legendary-gl heroic + mangohud ]; } diff --git a/modules/programs/bspwm/default.nix b/modules/programs/bspwm/default.nix index 4ecf68c..78c64a6 100644 --- a/modules/programs/bspwm/default.nix +++ b/modules/programs/bspwm/default.nix @@ -51,6 +51,7 @@ in extraConfig = builtins.readFile ./bspwmrc; }; services = { + unclutter.enable = true; sxhkd = { enable = true; extraConfig = builtins.readFile ./sxhkdrc; From 8e70a05d6d227f10991d906334d2b0e3a40baa04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 23 Dec 2022 12:40:47 +0100 Subject: [PATCH 48/58] update inputs --- flake.lock | 182 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 145 insertions(+), 37 deletions(-) diff --git a/flake.lock b/flake.lock index 34d141f..1820dfc 100644 --- a/flake.lock +++ b/flake.lock @@ -23,11 +23,11 @@ "arkenfox-userjs": { "flake": false, "locked": { - "lastModified": 1669146650, - "narHash": "sha256-9FCZt15lrL/aeDaUBFh+U2A4PlTj0jUKbjUbGIFUBik=", + "lastModified": 1670266131, + "narHash": "sha256-hf+fLTT67YWJPTkKgLxyP6KRAhiCaxuGY7GLltTyZvc=", "owner": "arkenfox", "repo": "user.js", - "rev": "6789dc7fefac5594d958a065463b4dc9d265c089", + "rev": "e4a85c30c129cf664cc8a39705bb070fce828d33", "type": "github" }, "original": { @@ -61,11 +61,11 @@ ] }, "locked": { - "lastModified": 1669439968, - "narHash": "sha256-VlQsxaHruFN29FOvRHUYecySRU9UzFqqpshfgoGxKes=", + "lastModified": 1670580643, + "narHash": "sha256-1D1mObqPnPJUxDZP2pOEvlYpEHq2oT2wqwwe46Jh24c=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "838bd1e55d9168d2df9dc0331565f884c3be3250", + "rev": "ff0c1ead7f28972ba4b63ffc9353a132b163386a", "type": "github" }, "original": { @@ -153,11 +153,11 @@ "forgit-git": { "flake": false, "locked": { - "lastModified": 1669300261, - "narHash": "sha256-ca7EM/F0Spsdr3MbjIVwbjLVXg6/qWGczBQHLCcpU5A=", + "lastModified": 1670576098, + "narHash": "sha256-IUM4SbJTzL5pG2gCTkGUPbz+ujv/ENC/Gt0bpJjvUNE=", "owner": "wfxr", "repo": "forgit", - "rev": "98321ef05a10fe1b536ae88e283339e769866e24", + "rev": "bfea8cf48523b3d6fa72d131e81769b68f43e3a7", "type": "github" }, "original": { @@ -195,11 +195,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1669328018, - "narHash": "sha256-aJRMobnNDEXKwoSZFS4hGjGU1WDNxkQ82BVKAEohOfY=", + "lastModified": 1670513770, + "narHash": "sha256-muL74fsbGA8K8WlZSPNWddOiuBnC54kAajncX6nXrh4=", "owner": "nix-community", "repo": "home-manager", - "rev": "62cb5bcf93896e4dd6b4507dac7ba2e2e3abc9d7", + "rev": "054d9e3187ca00479e8036dc0e92900a384f30fd", "type": "github" }, "original": { @@ -232,15 +232,17 @@ }, "hyprland": { "inputs": { + "hyprland-protocols": "hyprland-protocols", "nixpkgs": "nixpkgs", - "wlroots": "wlroots" + "wlroots": "wlroots", + "xdph": "xdph" }, "locked": { - "lastModified": 1669420836, - "narHash": "sha256-5d6hfIs3Rxs2au79yI6JED0/nkqot8NLBgrrZLX+yVk=", + "lastModified": 1670534695, + "narHash": "sha256-YNPiXsaZSQvetwsnrHuRxQnm8t9p5y9Nd3lRW6bPVxM=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "f45ec2497735851cd3d361278abaa7e58ec08b2a", + "rev": "726732244a5d51a0da54219174c13f4428017b79", "type": "github" }, "original": { @@ -249,13 +251,79 @@ "type": "github" } }, + "hyprland-protocols": { + "flake": false, + "locked": { + "lastModified": 1670258048, + "narHash": "sha256-Lm2sXnDVZNE+taHqsqVibvPmSdu65VHvXI507KVX4lg=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "0dcff94fc10df2bbb66d3e1b5a1d6cfd3ada5515", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprland-protocols_2": { + "flake": false, + "locked": { + "lastModified": 1670185345, + "narHash": "sha256-hxWGqlPecqEsE6nOHDV29KFBKePbY2Ipeac6lrChMKY=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "4623a404c091e64743ba310199bb380ec52f1936", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprpaper": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1669635788, + "narHash": "sha256-xlJ4hbUm3KULq4daqopi+eAv1u57uLlTare04HL3X/c=", + "owner": "hyprwm", + "repo": "hyprpaper", + "rev": "ab85578dce442b80aa3378fe0304e6cb6f16f593", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprpaper", + "type": "github" + } + }, + "jetbrains-plugins": { + "locked": { + "lastModified": 1670234247, + "narHash": "sha256-CepwZGno3XkePl3wBbFUcwsf+grnXTbKIujaCVaEnG0=", + "owner": "MoritzBoehme", + "repo": "nixpkgs", + "rev": "96386b1df1ad0099de5f74dea941d0191fbd3800", + "type": "github" + }, + "original": { + "owner": "MoritzBoehme", + "ref": "jetbrains-plugins", + "repo": "nixpkgs", + "type": "github" + } + }, "master": { "locked": { - "lastModified": 1669458704, - "narHash": "sha256-wpaBMBfjSDCnw4F7A1xBdqy2nW7dvjk3coISy+tTmX4=", + "lastModified": 1670583233, + "narHash": "sha256-sa0XbJmnJEmQp/Uvjh8lprAazR0UdCoVv8n6EeeG1aQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3200a569242cdc75c191fc28b6adefe60315e921", + "rev": "539954efab2b023064efd3edeb7912b71193acfd", "type": "github" }, "original": { @@ -266,11 +334,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1668765800, - "narHash": "sha256-rC40+/W6Hio7b/RsY8SvQPKNx4WqNcTgfYv8cUMAvJk=", + "lastModified": 1670064435, + "narHash": "sha256-+ELoY30UN+Pl3Yn7RWRPabykwebsVK/kYE9JsIsUMxQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "52b2ac8ae18bbad4374ff0dd5aeee0fdf1aea739", + "rev": "61a8a98e6d557e6dd7ed0cdb54c3a3e3bbc5e25c", "type": "github" }, "original": { @@ -298,11 +366,27 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1669387357, - "narHash": "sha256-z1azVj/5Em5kGhh9OgBOsjTEgMab7hXL/aRilH9tzyI=", + "lastModified": 1658826464, + "narHash": "sha256-94ZTF0uIX/iZdiD4RJ5f933ak/OM4XLl7hF+gCa4Iuk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ce49cb7792a7ffd65ef352dda1110a4e4a204eac", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1670525689, + "narHash": "sha256-YIjGzxrRQa5LYO0zlnH/ardcwXsRgsnHe3TkGkvCxbc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "55b3f68bda6d4f4dc6092eed0508063f154fa4fd", + "rev": "f21f11aa2a02cb78651c6d57546c7d7541f9240c", "type": "github" }, "original": { @@ -312,7 +396,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1668994630, "narHash": "sha256-1lqx6HLyw6fMNX/hXrrETG1vMvZRGm2XVC9O/Jt0T6c=", @@ -358,15 +442,15 @@ "flake-compat": "flake-compat", "flake-utils": "flake-utils_3", "gitignore": "gitignore", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1669152228, - "narHash": "sha256-FEDReoTLWJHXcNso7aaAlAUU7uOqIR6Hc/C/nqlfooE=", + "lastModified": 1670413394, + "narHash": "sha256-M7sWqrKtOqUv9euX1t3HCxis8cPy9MNiZxQmUf0KF1o=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "078b0dee35e2da01334af682ec347463b70a9986", + "rev": "1303a1a76e9eb074075bfe566518c413f6fc104e", "type": "github" }, "original": { @@ -385,8 +469,10 @@ "home-manager": "home-manager", "howdy": "howdy", "hyprland": "hyprland", + "hyprpaper": "hyprpaper", + "jetbrains-plugins": "jetbrains-plugins", "master": "master", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "pre-commit-hooks": "pre-commit-hooks_2", "stable": "stable", "utils": "utils_2" @@ -394,11 +480,11 @@ }, "stable": { "locked": { - "lastModified": 1669379897, - "narHash": "sha256-XM3xBfQD5tOtV4KAhQHyh53cJdqkLwotZa5JJIUjbQc=", + "lastModified": 1670543317, + "narHash": "sha256-4mMR56rtxKr+Gwz399jFr4i76SQZxsLWxxyfQlPXRm0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "8690906c4d80db5d85f52313a8487bf2e7b8d4c5", + "rev": "7a6a010c3a1d00f8470a5ca888f2f927f1860a19", "type": "github" }, "original": { @@ -445,11 +531,11 @@ "flake": false, "locked": { "host": "gitlab.freedesktop.org", - "lastModified": 1668785720, - "narHash": "sha256-CX+PYJP2PxZWL380WzyMNsrfRgIb/78brdwvDg/zj28=", + "lastModified": 1669925104, + "narHash": "sha256-xMHfW+/G9MieN/5tXHUA5/ztE8dkE093cNFTEUgcwxI=", "owner": "wlroots", "repo": "wlroots", - "rev": "4ff46e6cf9463e594605928feeb7c55cf323b5e7", + "rev": "c8eb24d30e18c165728b8788a10716611c3b633d", "type": "gitlab" }, "original": { @@ -458,6 +544,28 @@ "repo": "wlroots", "type": "gitlab" } + }, + "xdph": { + "inputs": { + "hyprland-protocols": "hyprland-protocols_2", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1670202338, + "narHash": "sha256-StTfshdAoSxO+t0wRbq1I3YESLFIQWFjGJse5ICV8rk=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "af840a9e0947a79a37a95a9f62062653721e43fa", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } } }, "root": "root", From fc1084b0caab6f4cca9ac3cce6f48e7dcd633280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 30 Dec 2022 18:58:13 +0100 Subject: [PATCH 49/58] improve code quality --- flake.nix | 20 +++++++++++++++++--- modules/profiles/desktop.nix | 1 - overlays/default.nix | 7 +++---- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index 8710075..1c93a22 100644 --- a/flake.nix +++ b/flake.nix @@ -61,20 +61,32 @@ utils.lib.mkFlake { inherit self inputs; + supportedSystems = [ "x86_64-linux" ]; + channelsConfig.allowUnfree = true; ################ ### Overlays ### ################ - overlays.default = import ./overlays { inherit inputs; }; + overlay = import ./overlays { inherit inputs; }; + channels.nixpkgs.overlaysBuilder = channels: [ - self.overlays.default - inputs.utils.overlay + self.overlay + inputs.agenix.overlay inputs.emacs-overlay.overlay inputs.howdy.overlays.default + inputs.hyprland.overlays.default + inputs.hyprpaper.overlays.default + inputs.utils.overlay ]; + # overlays = utils.lib.exportOverlays { + # inherit (self) pkgs inputs; + # }; + + overlays.default = self.overlay; + ############### ### Modules ### ############### @@ -139,6 +151,8 @@ shellcheck.enable = true; }; }; + + packages = utils.lib.exportPackages self.overlays channels; }; }; } diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index 835e14b..cc97e51 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -95,7 +95,6 @@ with lib; { mullvad.enable = true; openconnect.enable = true; openvpn.enable = true; - picom.enable = true; printing.enable = true; redshift.enable = true; }; diff --git a/overlays/default.nix b/overlays/default.nix index f9685ad..071a899 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,9 +1,6 @@ { inputs }: final: prev: { - nixpkgs-review-checks = inputs.nixpkgs-review-checks.defaultPackage."${prev.system}"; - agenix = inputs.agenix.defaultPackage."${prev.system}"; - logseq-wayland = prev.symlinkJoin { - name = "logseq"; + name = "logseq-wayland"; paths = [ prev.logseq ]; nativeBuildInputs = [ prev.makeWrapper ]; postBuild = '' @@ -13,11 +10,13 @@ }; waybar-hyprland = prev.waybar.overrideAttrs (old: { + pname = "${old.pname}-hyprland"; postPatch = old.postPatch or "" + '' sed -i 's,zext_workspace_handle_v1_activate(workspace_handle_);,const std::string command = "${final.hyprland}/bin/hyprctl dispatch workspace " + name_;\n\tsystem(command.c_str());,g' src/modules/wlr/workspace_manager.cpp ''; mesonFlags = old.mesonFlags or [ ] ++ [ "-Dexperimental=true" ]; }); + master = import inputs.master { inherit (prev) system; config.allowUnfree = true; From 7c90839817b54bb95221b3897c47e20db4b05e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 30 Dec 2022 19:01:31 +0100 Subject: [PATCH 50/58] improve hyprland module --- modules/programs/hyprland/default.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix index 064c538..b46c677 100644 --- a/modules/programs/hyprland/default.nix +++ b/modules/programs/hyprland/default.nix @@ -9,9 +9,7 @@ with lib; let cfg = config.my.programs.hyprland; - hyprland-default = inputs.hyprland.packages.${pkgs.system}.default; - hyprland-nvidia = hyprland-default.override { nvidiaPatches = true; }; - hyprland = if cfg.nvidiaSupport then hyprland-nvidia else hyprland-default; + hyprland = pkgs.hyprland.override { nvidiaPatches = cfg.nvidiaSupport; }; in { options.my.programs.hyprland = { @@ -26,7 +24,10 @@ in programs.waybar = { enable = true; package = pkgs.waybar-hyprland; - systemd.enable = true; + systemd = { + enable = true; + target = "hyprland-session.target"; + }; settings = { mainBar = { layer = "top"; @@ -90,15 +91,14 @@ in wallpaper = ,${wallpaper} ''; in - # setWallpaper "/home/moritz/.config/wallpapers/a_short_walk.png"; - setWallpaper "/home/moritz/.config/wallpapers/mario.gif"; + setWallpaper "/home/moritz/.config/wallpapers/a_short_walk.png"; onChange = "${pkgs.systemd}/bin/systemctl restart --user hyprpaper.service"; }; }; systemd.user.services.hyprpaper = { enable = true; path = [ pkgs.hyprpaper ]; - wantedBy = [ "display-manager.service" ]; + wantedBy = [ "hyprland-session.target" ]; after = [ "display-manager.service" ]; script = "hyprpaper"; }; @@ -167,6 +167,7 @@ in xdg.portal = { enable = true; wlr.enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-hyprland ]; }; }; } From 5ffc37cb3fadca366b3646eafc52d9e6f7f5ec63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 30 Dec 2022 19:01:50 +0100 Subject: [PATCH 51/58] expand private ssh conf --- secrets/ssh-home.age | Bin 888 -> 1005 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/secrets/ssh-home.age b/secrets/ssh-home.age index 29c15428e52821ca8c4ad65dafe181e97349c788..70909cfddeab92c1fee3d025be14ed22d82331be 100644 GIT binary patch delta 918 zcmWmB>uVbY003~iNhhf~n3ImWYN$e~F(#MC-KAn(FPG$+dnI>C?onDv?k<=2<(kXo zfi4|_12?v66D zHi1%pPXzNx;Vh*lfMhbA1n`J5VzCcdE0v60kzHOd;Il><0WGRlJY1@}lN_WHI7Kva zFdx)YiXW;J<1x5M1BqBub{a)a%$D<-CGFMac(#O7AmzkWs;Y}lg2EF_Rz@6TA`z5; zVN-&V{s=<8_(wMvEj3)QP#1in5-DJX0-_)p2InGJ9jW@#aFyY6zJws4!GLOkJUX9G zF}Rq}B|xA}&QAm!20>C_kWu~eL_&mJEaC)gN__h1j&80lyWIvzqZw4TWkNMlE~083 zMn^!9bcYmCvqggSCKQeoVz8ymnF!%kqktkIbuFL@q^d@INXG%6K)>xN2kN$~6H2n8SO{Mx&XQn8WE6lF zS<;blr&_#>@p>>uNg+ro$A@v#70-<13odt-)+8P!#TqA5qz340v}BPyA;Hau*zkY8 z-EJ)_Uc*^ZK|K;+=%yi=XdHEz0fTAgf(0Rk1sb$N8i73dK-{wW1GY9p?_Js0CiM-x zJor`V%bpJ8HKz5>k-1;brx$O%HBTZm2%ZKmVytLT!eD0O8eQRS&Lo@S}H$Rw7> literal 888 zcmZY4%gfsY008iVmk|XI;&)Ps%7;Sjn)Yj69wyB@&7;kud9h2Hq-ol(Ns}~>hADi9 zIS+!5Ph{d_cu+(TnX>U61{(~g!Up2So3MjB3g-Fcc>7JI6 zKG(vWD432=fk`N29wMWaQ#15RT zwdPbtlK*#ebKI~Mkn2To?VG|3M>dVW(nk(7<{U37oKWL5TbJu;=_z~ThROj^t$5Lz zLwutTGix~O)h>>%Fpn@0p(q#B*z^NgR~^}}{=2cyYaR6IXP#|`S>WaY2yH>E`(kdt zL;x8wQImC&B-nz6XX#7}7X)W!6=g^+#8=Dxd1PAoRBFP8n7bZEX;j2Y^vtS-0Yfnc z!0L>qLb;O+fOfkLDq?D-Oq32|-s`#&Q%)c@3hDx1A#{({CdkrQM@6TkU>?9f-MR7T zYvtP~PaM8{A$!X64wX=7B z|MLD1fA#O(`1Tb5+qt}RbM?gT(LZn9{p7;>x%d3&gM&->FX*Yyv#SS3_3iVgKYLfW zekE{g>Lc_ka`QdApWmT>E&qJ;n|JtgPk!e;eCA{FTy+t-#qOSe@WSqP=jg;8{kMB( Oe|qTl7niR6jQtDqh&*%v From 0e1f606a919c6301471e034e9b7a320b9eb6651f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 30 Dec 2022 19:02:02 +0100 Subject: [PATCH 52/58] update inputs --- flake.lock | 119 +++++++++++++++++++++++------------------------------ 1 file changed, 51 insertions(+), 68 deletions(-) diff --git a/flake.lock b/flake.lock index 1820dfc..2633ff2 100644 --- a/flake.lock +++ b/flake.lock @@ -23,11 +23,11 @@ "arkenfox-userjs": { "flake": false, "locked": { - "lastModified": 1670266131, - "narHash": "sha256-hf+fLTT67YWJPTkKgLxyP6KRAhiCaxuGY7GLltTyZvc=", + "lastModified": 1670682948, + "narHash": "sha256-yFg8U4D+qD9UQXhpAXrl9Ksj16zrCLOgahMtT9QS2Y8=", "owner": "arkenfox", "repo": "user.js", - "rev": "e4a85c30c129cf664cc8a39705bb070fce828d33", + "rev": "7135907b2fe13fa55eb8ebf162603037f83e353c", "type": "github" }, "original": { @@ -61,11 +61,11 @@ ] }, "locked": { - "lastModified": 1670580643, - "narHash": "sha256-1D1mObqPnPJUxDZP2pOEvlYpEHq2oT2wqwwe46Jh24c=", + "lastModified": 1672110422, + "narHash": "sha256-IYR6XGwmgORfSIZYYywZmtRBoWROBjI5rZjgYmQGPJ4=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "ff0c1ead7f28972ba4b63ffc9353a132b163386a", + "rev": "06d88ea2a783a7c563ce57e62d794313ae1e4855", "type": "github" }, "original": { @@ -153,11 +153,11 @@ "forgit-git": { "flake": false, "locked": { - "lastModified": 1670576098, - "narHash": "sha256-IUM4SbJTzL5pG2gCTkGUPbz+ujv/ENC/Gt0bpJjvUNE=", + "lastModified": 1671476278, + "narHash": "sha256-guAjxFhtybbRyRRXDELDHrM2Xzmi96wPxD2nhL9Ifmk=", "owner": "wfxr", "repo": "forgit", - "rev": "bfea8cf48523b3d6fa72d131e81769b68f43e3a7", + "rev": "ffda73bac3a435a9bbc6f29f2fd98517fbe5d9db", "type": "github" }, "original": { @@ -195,11 +195,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1670513770, - "narHash": "sha256-muL74fsbGA8K8WlZSPNWddOiuBnC54kAajncX6nXrh4=", + "lastModified": 1671966569, + "narHash": "sha256-jbLgfSnmLchARBNFRvCic63CFQ9LAyvlXnBpc2kwjQc=", "owner": "nix-community", "repo": "home-manager", - "rev": "054d9e3187ca00479e8036dc0e92900a384f30fd", + "rev": "c55fa26ce05fee8e063db22918d05a73d430b2ea", "type": "github" }, "original": { @@ -238,11 +238,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1670534695, - "narHash": "sha256-YNPiXsaZSQvetwsnrHuRxQnm8t9p5y9Nd3lRW6bPVxM=", + "lastModified": 1672057622, + "narHash": "sha256-UCA9ObYOGpZh5cZi9HO0p35RJVD1i2DT/Djgyx1dOPM=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "726732244a5d51a0da54219174c13f4428017b79", + "rev": "545e63d1dd14c76e9faad7839ad255dc9ead4cd8", "type": "github" }, "original": { @@ -254,11 +254,11 @@ "hyprland-protocols": { "flake": false, "locked": { - "lastModified": 1670258048, - "narHash": "sha256-Lm2sXnDVZNE+taHqsqVibvPmSdu65VHvXI507KVX4lg=", + "lastModified": 1670703428, + "narHash": "sha256-4KUW5SKR0Y9uaYGcYwy53YJ3B/sgiprCL4fRGO+mpOA=", "owner": "hyprwm", "repo": "hyprland-protocols", - "rev": "0dcff94fc10df2bbb66d3e1b5a1d6cfd3ada5515", + "rev": "d0d6db8cb5bef6d93ca3ad8fb2124964173396da", "type": "github" }, "original": { @@ -270,11 +270,11 @@ "hyprland-protocols_2": { "flake": false, "locked": { - "lastModified": 1670185345, - "narHash": "sha256-hxWGqlPecqEsE6nOHDV29KFBKePbY2Ipeac6lrChMKY=", + "lastModified": 1670703428, + "narHash": "sha256-4KUW5SKR0Y9uaYGcYwy53YJ3B/sgiprCL4fRGO+mpOA=", "owner": "hyprwm", "repo": "hyprland-protocols", - "rev": "4623a404c091e64743ba310199bb380ec52f1936", + "rev": "d0d6db8cb5bef6d93ca3ad8fb2124964173396da", "type": "github" }, "original": { @@ -288,11 +288,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1669635788, - "narHash": "sha256-xlJ4hbUm3KULq4daqopi+eAv1u57uLlTare04HL3X/c=", + "lastModified": 1671404096, + "narHash": "sha256-ls8i+lXweg0udqbd9XuF/ag+rqDSy/i05B6RrMW2BAI=", "owner": "hyprwm", "repo": "hyprpaper", - "rev": "ab85578dce442b80aa3378fe0304e6cb6f16f593", + "rev": "60013ee65566ec7601c367829da2560d7b8638fa", "type": "github" }, "original": { @@ -301,29 +301,13 @@ "type": "github" } }, - "jetbrains-plugins": { - "locked": { - "lastModified": 1670234247, - "narHash": "sha256-CepwZGno3XkePl3wBbFUcwsf+grnXTbKIujaCVaEnG0=", - "owner": "MoritzBoehme", - "repo": "nixpkgs", - "rev": "96386b1df1ad0099de5f74dea941d0191fbd3800", - "type": "github" - }, - "original": { - "owner": "MoritzBoehme", - "ref": "jetbrains-plugins", - "repo": "nixpkgs", - "type": "github" - } - }, "master": { "locked": { - "lastModified": 1670583233, - "narHash": "sha256-sa0XbJmnJEmQp/Uvjh8lprAazR0UdCoVv8n6EeeG1aQ=", + "lastModified": 1672128529, + "narHash": "sha256-VBMP7GZ4lUgEyFJUPu+emFn58kqDXthJRi5zwdBu+cw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "539954efab2b023064efd3edeb7912b71193acfd", + "rev": "813159a4264a1cacd2a0ebed863ac3b041f1ebb9", "type": "github" }, "original": { @@ -334,11 +318,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1670064435, - "narHash": "sha256-+ELoY30UN+Pl3Yn7RWRPabykwebsVK/kYE9JsIsUMxQ=", + "lastModified": 1671722432, + "narHash": "sha256-ojcZUekIQeOZkHHzR81st7qxX99dB1Eaaq6PU5MNeKc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "61a8a98e6d557e6dd7ed0cdb54c3a3e3bbc5e25c", + "rev": "652e92b8064949a11bc193b90b74cb727f2a1405", "type": "github" }, "original": { @@ -350,11 +334,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1668984258, - "narHash": "sha256-0gDMJ2T3qf58xgcSbYoXiRGUkPWmKyr5C3vcathWhKs=", + "lastModified": 1671271954, + "narHash": "sha256-cSvu+bnvN08sOlTBWbBrKaBHQZq8mvk8bgpt0ZJ2Snc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cf63ade6f74bbc9d2a017290f1b2e33e8fbfa70a", + "rev": "d513b448cc2a6da2c8803e3c197c9fc7e67b19e3", "type": "github" }, "original": { @@ -382,11 +366,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1670525689, - "narHash": "sha256-YIjGzxrRQa5LYO0zlnH/ardcwXsRgsnHe3TkGkvCxbc=", + "lastModified": 1672057183, + "narHash": "sha256-GN7/10DNNvs1FPj9tlZA2qgNdFuYKKuS3qlHTqAxasQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "f21f11aa2a02cb78651c6d57546c7d7541f9240c", + "rev": "b139e44d78c36c69bcbb825b20dbfa51e7738347", "type": "github" }, "original": { @@ -398,11 +382,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1668994630, - "narHash": "sha256-1lqx6HLyw6fMNX/hXrrETG1vMvZRGm2XVC9O/Jt0T6c=", + "lastModified": 1671271357, + "narHash": "sha256-xRJdLbWK4v2SewmSStYrcLa0YGJpleufl44A19XSW8k=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "af50806f7c6ab40df3e6b239099e8f8385f6c78b", + "rev": "40f79f003b6377bd2f4ed4027dde1f8f922995dd", "type": "github" }, "original": { @@ -446,11 +430,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1670413394, - "narHash": "sha256-M7sWqrKtOqUv9euX1t3HCxis8cPy9MNiZxQmUf0KF1o=", + "lastModified": 1672050129, + "narHash": "sha256-GBQMcvJUSwAVOpDjVKzB6D5mmHI7Y4nFw+04bnS9QrM=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "1303a1a76e9eb074075bfe566518c413f6fc104e", + "rev": "67d98f02443b9928bc77f1267741dcfdd3d7b65c", "type": "github" }, "original": { @@ -470,7 +454,6 @@ "howdy": "howdy", "hyprland": "hyprland", "hyprpaper": "hyprpaper", - "jetbrains-plugins": "jetbrains-plugins", "master": "master", "nixpkgs": "nixpkgs_3", "pre-commit-hooks": "pre-commit-hooks_2", @@ -480,11 +463,11 @@ }, "stable": { "locked": { - "lastModified": 1670543317, - "narHash": "sha256-4mMR56rtxKr+Gwz399jFr4i76SQZxsLWxxyfQlPXRm0=", + "lastModified": 1671883564, + "narHash": "sha256-C15oAtyupmLB3coZY7qzEHXjhtUx/+77olVdqVMruAg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "7a6a010c3a1d00f8470a5ca888f2f927f1860a19", + "rev": "dac57a4eccf1442e8bf4030df6fcbb55883cb682", "type": "github" }, "original": { @@ -531,11 +514,11 @@ "flake": false, "locked": { "host": "gitlab.freedesktop.org", - "lastModified": 1669925104, - "narHash": "sha256-xMHfW+/G9MieN/5tXHUA5/ztE8dkE093cNFTEUgcwxI=", + "lastModified": 1671723353, + "narHash": "sha256-G1jiI0SA7eiZusO+iJytErMRNbKbwqJJJGL+sNoBNoQ=", "owner": "wlroots", "repo": "wlroots", - "rev": "c8eb24d30e18c165728b8788a10716611c3b633d", + "rev": "b28a9afd4b0b86e9a66a40f6b44b69f59947b7d6", "type": "gitlab" }, "original": { @@ -554,11 +537,11 @@ ] }, "locked": { - "lastModified": 1670202338, - "narHash": "sha256-StTfshdAoSxO+t0wRbq1I3YESLFIQWFjGJse5ICV8rk=", + "lastModified": 1671837878, + "narHash": "sha256-OmFDyktTc/l+3wHboHeFpAQgPt3r7jjqZf8MrwuUGMo=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "af840a9e0947a79a37a95a9f62062653721e43fa", + "rev": "e47f4cec698080768821b271510985ab94a37e91", "type": "github" }, "original": { From afbfe9f576ecde189ece40b7f23086cb979f23e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 1 Jan 2023 15:27:31 +0100 Subject: [PATCH 53/58] hyprland improvements --- flake.nix | 7 +++++-- modules/programs/hyprland/config.nix | 11 ++--------- modules/programs/hyprland/default.nix | 4 ++-- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/flake.nix b/flake.nix index 1c93a22..e95fcb4 100644 --- a/flake.nix +++ b/flake.nix @@ -51,9 +51,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - hyprland.url = "github:hyprwm/Hyprland"; + # Hyprland + hyprland.url = "github:hyprwm/Hyprland"; hyprpaper.url = "github:hyprwm/hyprpaper"; + hypr-contrib.url = "github:hyprwm/contrib"; }; outputs = @@ -72,13 +74,14 @@ overlay = import ./overlays { inherit inputs; }; channels.nixpkgs.overlaysBuilder = channels: [ - self.overlay inputs.agenix.overlay inputs.emacs-overlay.overlay inputs.howdy.overlays.default + inputs.hypr-contrib.overlays.default inputs.hyprland.overlays.default inputs.hyprpaper.overlays.default inputs.utils.overlay + self.overlay ]; # overlays = utils.lib.exportOverlays { diff --git a/modules/programs/hyprland/config.nix b/modules/programs/hyprland/config.nix index 0fcaa86..038f962 100644 --- a/modules/programs/hyprland/config.nix +++ b/modules/programs/hyprland/config.nix @@ -18,15 +18,8 @@ in # See https://wiki.hyprland.org/Configuring/Monitors/ monitor=,preferred,auto,1 - # See https://wiki.hyprland.org/Configuring/Keywords/ for more - # Execute your favorite apps at launch - # exec-once = waybar & hyprpaper & firefox - - # Source a file (multi-file configs) - # source = ~/.config/hypr/myColors.conf - # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ input { kb_layout = de,us @@ -140,8 +133,8 @@ in bind = $mainMod, M, exec, hyprctl keyword general:layout master bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, Q, killactive, - bind = $mainMod, R, exec, rofi -show combi -normal-window - bind = $mainMod, C, exec, rofi -show calc -modi calc -no-show-match -no-sort | xclip -selection clipboard + bind = $mainMod, R, exec, rofi -x11 -show combi + bind = $mainMod, C, exec, rofi -x11 -show calc -modi calc -no-show-match -no-sort | wl-copy bind = $mainMod, B, exec, rofi-bluetooth bind = $mainMod, RETURN, exec, kitty bind = $mainMod, T, togglesplit, # dwindle diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix index b46c677..4f7b32a 100644 --- a/modules/programs/hyprland/default.nix +++ b/modules/programs/hyprland/default.nix @@ -109,8 +109,8 @@ in pamixer playerctl brightnessctl - slurp - grim + grimblast + wl-clipboard ]; security.pam.services.swaylock = { }; From ba33446b5d61730a35677ec2625ea169129d5274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 1 Jan 2023 15:27:55 +0100 Subject: [PATCH 54/58] update inputs --- flake.lock | 95 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 65 insertions(+), 30 deletions(-) diff --git a/flake.lock b/flake.lock index 2633ff2..8c67553 100644 --- a/flake.lock +++ b/flake.lock @@ -61,11 +61,11 @@ ] }, "locked": { - "lastModified": 1672110422, - "narHash": "sha256-IYR6XGwmgORfSIZYYywZmtRBoWROBjI5rZjgYmQGPJ4=", + "lastModified": 1672567750, + "narHash": "sha256-Hz1b1TUJbzuLj0eR+LTSUqoGR2gkQdrm3uxru+0rVuY=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "06d88ea2a783a7c563ce57e62d794313ae1e4855", + "rev": "524c884484c312b76cb4bc9fbf37eec66e2f8406", "type": "github" }, "original": { @@ -195,11 +195,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1671966569, - "narHash": "sha256-jbLgfSnmLchARBNFRvCic63CFQ9LAyvlXnBpc2kwjQc=", + "lastModified": 1672349765, + "narHash": "sha256-Ul3lSGglgHXhgU3YNqsNeTlRH1pqxbR64h+2hM+HtnM=", "owner": "nix-community", "repo": "home-manager", - "rev": "c55fa26ce05fee8e063db22918d05a73d430b2ea", + "rev": "dd99675ee81fef051809bc87d67eb07f5ba022e8", "type": "github" }, "original": { @@ -230,19 +230,37 @@ "type": "sourcehut" } }, + "hypr-contrib": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1672071700, + "narHash": "sha256-Z0pbBVtijv4xbL42rPzMoYFSOqALFRYDMN9iOumSEso=", + "owner": "hyprwm", + "repo": "contrib", + "rev": "37c8121f98d76f57caa00dd7106877876e0d7483", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "contrib", + "type": "github" + } + }, "hyprland": { "inputs": { "hyprland-protocols": "hyprland-protocols", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "wlroots": "wlroots", "xdph": "xdph" }, "locked": { - "lastModified": 1672057622, - "narHash": "sha256-UCA9ObYOGpZh5cZi9HO0p35RJVD1i2DT/Djgyx1dOPM=", + "lastModified": 1672510982, + "narHash": "sha256-fxpb2GM2Zi4DU119b7c1g8RN/jF7WXD5UcjXN7lxPJ8=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "545e63d1dd14c76e9faad7839ad255dc9ead4cd8", + "rev": "7525818097f92a99b2b8d02ea43bd0f8ccabd51c", "type": "github" }, "original": { @@ -285,14 +303,14 @@ }, "hyprpaper": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1671404096, - "narHash": "sha256-ls8i+lXweg0udqbd9XuF/ag+rqDSy/i05B6RrMW2BAI=", + "lastModified": 1672266418, + "narHash": "sha256-Xxooxjoymgl65dIMtcBB4/bZx0OcqPZ52G/fw4rozYE=", "owner": "hyprwm", "repo": "hyprpaper", - "rev": "60013ee65566ec7601c367829da2560d7b8638fa", + "rev": "aefd63876d0353e4b25e473708903e6c30054931", "type": "github" }, "original": { @@ -303,11 +321,11 @@ }, "master": { "locked": { - "lastModified": 1672128529, - "narHash": "sha256-VBMP7GZ4lUgEyFJUPu+emFn58kqDXthJRi5zwdBu+cw=", + "lastModified": 1672582743, + "narHash": "sha256-BcHOaoxnUL+DzjGZV+vm8rIDGOFL6DvbPxeCLvzDrN0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "813159a4264a1cacd2a0ebed863ac3b041f1ebb9", + "rev": "3d9c0b6bdb5d6ee7126b6362167550c74590d612", "type": "github" }, "original": { @@ -318,11 +336,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1671722432, - "narHash": "sha256-ojcZUekIQeOZkHHzR81st7qxX99dB1Eaaq6PU5MNeKc=", + "lastModified": 1658161305, + "narHash": "sha256-X/nhnMCa1Wx4YapsspyAs6QYz6T/85FofrI6NpdPDHg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "652e92b8064949a11bc193b90b74cb727f2a1405", + "rev": "e4d49de45a3b5dbcb881656b4e3986e666141ea9", "type": "github" }, "original": { @@ -349,6 +367,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1671722432, + "narHash": "sha256-ojcZUekIQeOZkHHzR81st7qxX99dB1Eaaq6PU5MNeKc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "652e92b8064949a11bc193b90b74cb727f2a1405", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1658826464, "narHash": "sha256-94ZTF0uIX/iZdiD4RJ5f933ak/OM4XLl7hF+gCa4Iuk=", @@ -364,13 +398,13 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { - "lastModified": 1672057183, - "narHash": "sha256-GN7/10DNNvs1FPj9tlZA2qgNdFuYKKuS3qlHTqAxasQ=", + "lastModified": 1672428209, + "narHash": "sha256-eejhqkDz2cb2vc5VeaWphJz8UXNuoNoM8/Op8eWv2tQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b139e44d78c36c69bcbb825b20dbfa51e7738347", + "rev": "293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847", "type": "github" }, "original": { @@ -380,7 +414,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1671271357, "narHash": "sha256-xRJdLbWK4v2SewmSStYrcLa0YGJpleufl44A19XSW8k=", @@ -426,7 +460,7 @@ "flake-compat": "flake-compat", "flake-utils": "flake-utils_3", "gitignore": "gitignore", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { @@ -452,10 +486,11 @@ "forgit-git": "forgit-git", "home-manager": "home-manager", "howdy": "howdy", + "hypr-contrib": "hypr-contrib", "hyprland": "hyprland", "hyprpaper": "hyprpaper", "master": "master", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "pre-commit-hooks": "pre-commit-hooks_2", "stable": "stable", "utils": "utils_2" @@ -463,11 +498,11 @@ }, "stable": { "locked": { - "lastModified": 1671883564, - "narHash": "sha256-C15oAtyupmLB3coZY7qzEHXjhtUx/+77olVdqVMruAg=", + "lastModified": 1672353432, + "narHash": "sha256-oZfgp/44/o2tWiylV30cR+DLyWTJ+5dhsdWZVpzs3e4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "dac57a4eccf1442e8bf4030df6fcbb55883cb682", + "rev": "913a47cd064cc06440ea84e5e0452039a85781f0", "type": "github" }, "original": { From 0b0fda1dd4a98589163e62b049fc0cee5410b3e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 1 Jan 2023 15:28:13 +0100 Subject: [PATCH 55/58] rename aliases --- modules/profiles/base.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index 08e96e6..e8b9533 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -39,9 +39,9 @@ with lib; rm = "rm -i"; mv = "mv -i"; - nix-switch = "sudo nixos-rebuild switch --flake ~/.dotfiles"; - nix-boot = "sudo nixos-rebuild boot --flake ~/.dotfiles"; - nix-lock = "pushd ~/.dotfiles && nix flake update && popd"; + nixos-switch = "sudo nixos-rebuild switch --flake ~/.dotfiles"; + nixos-boot = "sudo nixos-rebuild boot --flake ~/.dotfiles"; + nixos-update = "pushd ~/.dotfiles && nix flake update && popd"; latexwatch = ''find -type f -name "*.tex" | entr -c latexmk -pdf -silent''; }; From e8229815424d84b6c532d5bb25f2c70c2534d786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 1 Jan 2023 15:28:38 +0100 Subject: [PATCH 56/58] fix private ssh config --- secrets/ssh-home.age | Bin 1005 -> 884 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/secrets/ssh-home.age b/secrets/ssh-home.age index 70909cfddeab92c1fee3d025be14ed22d82331be..0922fb521452a41b52668a71a6e7e1f1bf850a1f 100644 GIT binary patch delta 796 zcmWmB-HY1<003~#$tH32!9CpM9i!%SSK0=DTT< zrV0fGWl!6v6UE`j#_oK*G4W|K9O52yIzgBoW5-@Z*(QQt6L*Nef8lp`&+ofWK0EC+ zu_A1E5e^c(j&Y^FO@vYx(Vb;i)6F;^=xzfEnmxmi0n6dr%vw$x&^p8Ak@}D!28kYY za&B%d4|83<%2c2j?jmsu$h?>if_|o_=TH>J)2+6=WE<&HrAnz(Sfk~(7gs4LtoF)+ z1`Z4X>l+^DCsAb}ITNkSatJ_Wm4lpBIrtnnfzDpG!_ ziO6W9iK;kNjp!jo{y#t;IyPEM=!`M!DM2rdsCD*$E&{};s4>o%g?JY8rnKBJP`nFd zGMRLr910UG@}y-Iruwm^;jm&0qEu;hXt=<)Muka|L!4@}M*~;nqmMnay6rxG{Mg2W z@B?t;@}=+%bnEc*VTxQoLHT#D{j`g}`S6`T7f*5zy^eDS>6;6CPaIl-5A*Nry2d4Y z3*WwZ<a&kin-_1GJNEfUr&f3KKJnG< z=Y$_lPyd~}c&>ZrmHK_){dec>_kO-5>|9Q^QU{E;f9&mB{EImI&%tp0>E`0vIV@m!-eMl_M|w KapuDLh5rCx-Y8Z8 delta 918 zcmWmB>uVbY003~iNhhf~n3ImWYN$e~XG|{F+$9z3dbwP#x!fhWJnm6iN$xI}*X44} z<#GwSbO;XI*s7iAI&p%t7MW9ge2`IDLEWqloU1sxmHC9Vb5^I!PKs0if!~+kpY7MS zOg_@$i#0d_#{!9dOKtiPvyn9YI!DP^tR5c<$wmSjmw1XT!9>x9v7FlUvqmf)GCcJx zF{EkZ813(m5fXuy5I`aWQxg4sFO;i za1k6bMI`NyqSW)hce1f^!|mlQ-Y3Y>5>YClGMZyZHcD7%&6oAo7_Q(;@jQkH6dTg7 zbHxlp3MpL#`H0E-!vUuerf3*v6u&f{61?s>>H+~dIrU^)Cu>O%WWW(Dhe<##Sf?Zv zQ!Fnw48s%@lm!il;#Lz0MN0{MW6HQ$a~D ziZ>#D4iQX%Csl&?R1zhTG6H486W2^OuEzc!2>0~@PdG8ip^VGvs%#7Ua>+Oa=LALu zBSM^V=AcZAlL$`76SNpa#7c6AG~LPEaIxfu@)1qsFiNPi5>08K9*>o6VtFV{l!4iw(>o(Ivv@&ys=H} z={q#=W%-M)HuPnt_4X^Xznsf1+e$JR zqhpuH=2p0UcfT5vrcT}evGc&+OAFPm_1BNxYCmr6dd?bHzZcvzFnxOS&QoXp_-2in zS$gTgjb1bO>xGZb{8%)0bgT|eY#BXq{=UOEFL&>q$UJuV^Y|q@c%pT6c@Z77tuN=l zotwP^{Pnm+{C0=@{u{>EuMMnT@7{FMd|)zl?Zc66yH~syI@XTtfAhWU?yvOuJ)hk+ z-y=0I{#4$-etPum$gzzVdY3xi>bdiW@2*}ta?j?)g|24{FOKe89bFupo}0Mw$;{f$ pbn)lOo`>7tiA-(9yRUTIc;@=9r|&wreg4+L5#!?dNB4N2`WL&7V>18% From 1ed4c8295b8ebce4bcfa6fa2fbc9a34fd51c160a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 2 Jan 2023 16:17:38 +0100 Subject: [PATCH 57/58] use hyprland by default --- modules/programs/hyprland/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix index 4f7b32a..f869398 100644 --- a/modules/programs/hyprland/default.nix +++ b/modules/programs/hyprland/default.nix @@ -152,7 +152,7 @@ in xserver = { enable = true; displayManager = { - gdm.enable = true; + lightdm.enable = true; autoLogin = { enable = true; user = "moritz"; From c3e6687ded298342a36d3a435215ea92b7be4f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 3 Jan 2023 17:56:02 +0100 Subject: [PATCH 58/58] tune opacity settings --- modules/programs/hyprland/config.nix | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/modules/programs/hyprland/config.nix b/modules/programs/hyprland/config.nix index 038f962..0ffe5d1 100644 --- a/modules/programs/hyprland/config.nix +++ b/modules/programs/hyprland/config.nix @@ -109,18 +109,24 @@ in # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + # Kitty + windowrulev2 = opacity 0.95 0.95, class:^kitty$ + + windowrulev2 = opacity 0.85 0.85, floating:1 + # Firefox Sharing Indicator ${mkRules ["float" "move 49% 40" "noborder"] ["title:^(.*Sharing Indicator)$"]} # Rofi - ${mkRules ["float" "opacity 0.95 0.95"] ["class:^([rR]ofi)$"]} + ${mkRules ["float" "opacity 0.85 0.85" "noborder"] ["class:^([rR]ofi)$"]} - windowrulev2 = opacity 0.95 0.95,floating:1 + # Emacs + windowrulev2 = opaque, class:^emacs$ - # Games + + # Fullscreen Applications # ${mkRules ["opaque" "noblur" "noborder" "noshadow" "forceinput"] ["fullscreen:1"]} - # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER $windowMod = ALT @@ -153,6 +159,12 @@ in bind = $mainMod, K, movefocus, u bind = $mainMod, J, movefocus, d + # Change current active window size with mainMod + hjkl + bind = $mainMod SHIFT, H, resizeactive, -10 0 + bind = $mainMod SHIFT, L, resizeactive, 10 0 + bind = $mainMod SHIFT, K, resizeactive, 0 -10 + bind = $mainMod SHIFT, J, resizeactive, 0 10 + # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2