diff --git a/flake.nix b/flake.nix index 93d11f0..bd2344c 100644 --- a/flake.nix +++ b/flake.nix @@ -117,6 +117,8 @@ permittedInsecurePackages = [ ]; }; + systems.modules.nixos = with inputs; [ nix-topology.nixosModules.default ]; + topology = with inputs; let diff --git a/homes/x86_64-linux/julian@aspi/default.nix b/homes/x86_64-linux/julian@aspi/default.nix index 5502da8..dfbeaf7 100644 --- a/homes/x86_64-linux/julian@aspi/default.nix +++ b/homes/x86_64-linux/julian@aspi/default.nix @@ -34,10 +34,13 @@ neovim.enable = true; alacritty.enable = true; emacs.enable = true; + # i3.enable = true; # rofi.enable = true; hyprland.enable = true; nix-helper.enable = true; + + desktop.enable = true; }; home.packages = @@ -61,7 +64,7 @@ # Further tools cntr # nix debugger - (lib.frajul.my-helper-function lazygit) + lazygit languagetool # wireguard-tools diff --git a/lib/default.nix b/lib/default.nix deleted file mode 100644 index 77fc4c7..0000000 --- a/lib/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ -# This is the merged library containing your namespaced library as well as all libraries from -# your flake's inputs. -lib, - -# Your flake inputs are also available. -inputs, - -# Additionally, Snowfall Lib's own inputs are passed. You probably don't need to use this! -snowfall-inputs, }: { - # This will be available as `lib.my-namespace.my-helper-function`. - my-helper-function = x: x; - - my-scope = { - # This will be available as `lib.my-namespace.my-scope.my-scoped-helper-function`. - my-scoped-helper-function = x: x; - }; -} diff --git a/lib/module/default.nix b/lib/module/default.nix new file mode 100644 index 0000000..8e0a537 --- /dev/null +++ b/lib/module/default.nix @@ -0,0 +1,15 @@ +{ lib, ... }: +with lib; +rec { + mkOpt = + type: default: description: + mkOption { inherit type default description; }; + + mkOpt' = type: default: mkOpt type default null; + + mkBoolOpt = mkOpt types.bool; + + mkBoolOpt' = mkOpt' types.bool; + + mkEnableOpt = mkBoolOpt' false; +} diff --git a/modules/home/desktop/default.nix b/modules/home/desktop/default.nix new file mode 100644 index 0000000..85ab90c --- /dev/null +++ b/modules/home/desktop/default.nix @@ -0,0 +1,47 @@ +{ + options, + config, + lib, + pkgs, + inputs, + ... +}: +let + inherit (inputs.nix-colors.lib-contrib { inherit pkgs; }) gtkThemeFromScheme; + cfg = config.modules.desktop; +in +{ + options.modules.desktop = + with lib.frajul; + with lib.types; + { + colorscheme = mkOpt str "catppuccin-mocha" "Theme to use for the desktop"; + enable = mkBoolOpt false "Enable desktop"; + }; + + # Do not make conditional, just toggle things on and off + imports = [ + inputs.prism.homeModules.prism + inputs.nix-colors.homeManagerModules.default + ]; + + config = lib.mkIf cfg.enable { + prism = { + enable = true; + wallpapers = ./wallpapers; + colorscheme = inputs.nix-colors.colorschemes.${cfg.colorscheme}; + }; + + gtk = { + enable = true; + theme = { + name = inputs.nix-colors.colorschemes.${cfg.colorscheme}.slug; + package = gtkThemeFromScheme { scheme = inputs.nix-colors.colorschemes.${cfg.colorscheme}; }; + }; + iconTheme = { + name = "Papirus-Dark"; + package = pkgs.papirus-icon-theme; + }; + }; + }; +} diff --git a/modules/home/desktop/wallpapers/32j4hjkl4j4hkl.png b/modules/home/desktop/wallpapers/32j4hjkl4j4hkl.png new file mode 100644 index 0000000..00b9901 Binary files /dev/null and b/modules/home/desktop/wallpapers/32j4hjkl4j4hkl.png differ diff --git a/modules/home/desktop/wallpapers/Bridge.jpg b/modules/home/desktop/wallpapers/Bridge.jpg new file mode 100644 index 0000000..947a2ce Binary files /dev/null and b/modules/home/desktop/wallpapers/Bridge.jpg differ diff --git a/modules/home/desktop/wallpapers/astronaut.png b/modules/home/desktop/wallpapers/astronaut.png new file mode 100644 index 0000000..add3369 Binary files /dev/null and b/modules/home/desktop/wallpapers/astronaut.png differ diff --git a/modules/home/desktop/wallpapers/astronaut_ultra.png b/modules/home/desktop/wallpapers/astronaut_ultra.png new file mode 100644 index 0000000..80f1a71 Binary files /dev/null and b/modules/home/desktop/wallpapers/astronaut_ultra.png differ diff --git a/modules/home/desktop/wallpapers/babel.png b/modules/home/desktop/wallpapers/babel.png new file mode 100644 index 0000000..ab9d75b Binary files /dev/null and b/modules/home/desktop/wallpapers/babel.png differ diff --git a/modules/home/desktop/wallpapers/blockwavemoon.png b/modules/home/desktop/wallpapers/blockwavemoon.png new file mode 100644 index 0000000..ec28555 Binary files /dev/null and b/modules/home/desktop/wallpapers/blockwavemoon.png differ diff --git a/modules/home/desktop/wallpapers/cat_Japanese_Neon.png b/modules/home/desktop/wallpapers/cat_Japanese_Neon.png new file mode 100644 index 0000000..3ac3ced Binary files /dev/null and b/modules/home/desktop/wallpapers/cat_Japanese_Neon.png differ diff --git a/modules/home/desktop/wallpapers/cat_leaves.png b/modules/home/desktop/wallpapers/cat_leaves.png new file mode 100644 index 0000000..ace8c2c Binary files /dev/null and b/modules/home/desktop/wallpapers/cat_leaves.png differ diff --git a/modules/home/desktop/wallpapers/colorful-planets.jpg b/modules/home/desktop/wallpapers/colorful-planets.jpg new file mode 100644 index 0000000..3881e56 Binary files /dev/null and b/modules/home/desktop/wallpapers/colorful-planets.jpg differ diff --git a/modules/home/desktop/wallpapers/finalizer.png b/modules/home/desktop/wallpapers/finalizer.png new file mode 100644 index 0000000..661b35b Binary files /dev/null and b/modules/home/desktop/wallpapers/finalizer.png differ diff --git a/modules/home/desktop/wallpapers/gruv-material.png b/modules/home/desktop/wallpapers/gruv-material.png new file mode 100644 index 0000000..6d4ce32 Binary files /dev/null and b/modules/home/desktop/wallpapers/gruv-material.png differ diff --git a/modules/home/desktop/wallpapers/ign-0002.png b/modules/home/desktop/wallpapers/ign-0002.png new file mode 100644 index 0000000..cc2b74c Binary files /dev/null and b/modules/home/desktop/wallpapers/ign-0002.png differ diff --git a/modules/home/desktop/wallpapers/ign-0008.png b/modules/home/desktop/wallpapers/ign-0008.png new file mode 100644 index 0000000..cb9ee96 Binary files /dev/null and b/modules/home/desktop/wallpapers/ign-0008.png differ diff --git a/modules/home/desktop/wallpapers/ign-0011.png b/modules/home/desktop/wallpapers/ign-0011.png new file mode 100644 index 0000000..64f5ef2 Binary files /dev/null and b/modules/home/desktop/wallpapers/ign-0011.png differ diff --git a/modules/home/desktop/wallpapers/ign_car.png b/modules/home/desktop/wallpapers/ign_car.png new file mode 100644 index 0000000..8a6ba2a Binary files /dev/null and b/modules/home/desktop/wallpapers/ign_car.png differ diff --git a/modules/home/desktop/wallpapers/ign_city.png b/modules/home/desktop/wallpapers/ign_city.png new file mode 100644 index 0000000..aa651d5 Binary files /dev/null and b/modules/home/desktop/wallpapers/ign_city.png differ diff --git a/modules/home/desktop/wallpapers/ign_cityRainOther.png b/modules/home/desktop/wallpapers/ign_cityRainOther.png new file mode 100644 index 0000000..c80358a Binary files /dev/null and b/modules/home/desktop/wallpapers/ign_cityRainOther.png differ diff --git a/modules/home/desktop/wallpapers/ign_herakles.png b/modules/home/desktop/wallpapers/ign_herakles.png new file mode 100644 index 0000000..130fd67 Binary files /dev/null and b/modules/home/desktop/wallpapers/ign_herakles.png differ diff --git a/modules/home/desktop/wallpapers/ign_stuff.png b/modules/home/desktop/wallpapers/ign_stuff.png new file mode 100644 index 0000000..abe5ff8 Binary files /dev/null and b/modules/home/desktop/wallpapers/ign_stuff.png differ diff --git a/modules/home/desktop/wallpapers/ign_unsplash16.png b/modules/home/desktop/wallpapers/ign_unsplash16.png new file mode 100644 index 0000000..8d833b0 Binary files /dev/null and b/modules/home/desktop/wallpapers/ign_unsplash16.png differ diff --git a/modules/home/desktop/wallpapers/koi2.png b/modules/home/desktop/wallpapers/koi2.png new file mode 100644 index 0000000..f621c5e Binary files /dev/null and b/modules/home/desktop/wallpapers/koi2.png differ diff --git a/modules/home/desktop/wallpapers/nix-wallpaper-nineish-catppuccin-mocha.png b/modules/home/desktop/wallpapers/nix-wallpaper-nineish-catppuccin-mocha.png new file mode 100644 index 0000000..aa0e2ab Binary files /dev/null and b/modules/home/desktop/wallpapers/nix-wallpaper-nineish-catppuccin-mocha.png differ diff --git a/modules/home/desktop/wallpapers/nord_buildings.png b/modules/home/desktop/wallpapers/nord_buildings.png new file mode 100644 index 0000000..823e15d Binary files /dev/null and b/modules/home/desktop/wallpapers/nord_buildings.png differ diff --git a/modules/home/desktop/wallpapers/outer-space.png b/modules/home/desktop/wallpapers/outer-space.png new file mode 100644 index 0000000..1397ef9 Binary files /dev/null and b/modules/home/desktop/wallpapers/outer-space.png differ diff --git a/modules/home/desktop/wallpapers/platform.jpg b/modules/home/desktop/wallpapers/platform.jpg new file mode 100644 index 0000000..7f25bcf Binary files /dev/null and b/modules/home/desktop/wallpapers/platform.jpg differ diff --git a/modules/home/desktop/wallpapers/result2.png b/modules/home/desktop/wallpapers/result2.png new file mode 100644 index 0000000..b04d98a Binary files /dev/null and b/modules/home/desktop/wallpapers/result2.png differ diff --git a/modules/home/desktop/wallpapers/result5.png b/modules/home/desktop/wallpapers/result5.png new file mode 100644 index 0000000..4585d77 Binary files /dev/null and b/modules/home/desktop/wallpapers/result5.png differ diff --git a/modules/home/desktop/wallpapers/rolly.png b/modules/home/desktop/wallpapers/rolly.png new file mode 100644 index 0000000..98da241 Binary files /dev/null and b/modules/home/desktop/wallpapers/rolly.png differ diff --git a/modules/home/desktop/wallpapers/rose_pine_contourline.png b/modules/home/desktop/wallpapers/rose_pine_contourline.png new file mode 100644 index 0000000..76dfe3c Binary files /dev/null and b/modules/home/desktop/wallpapers/rose_pine_contourline.png differ diff --git a/modules/home/desktop/wallpapers/rose_pine_shape.png b/modules/home/desktop/wallpapers/rose_pine_shape.png new file mode 100644 index 0000000..f826fd5 Binary files /dev/null and b/modules/home/desktop/wallpapers/rose_pine_shape.png differ diff --git a/modules/home/desktop/wallpapers/shiny-colors.png b/modules/home/desktop/wallpapers/shiny-colors.png new file mode 100644 index 0000000..0d9b1dc Binary files /dev/null and b/modules/home/desktop/wallpapers/shiny-colors.png differ diff --git a/modules/home/desktop/wallpapers/skullcat.png b/modules/home/desktop/wallpapers/skullcat.png new file mode 100644 index 0000000..2c6eace Binary files /dev/null and b/modules/home/desktop/wallpapers/skullcat.png differ diff --git a/modules/home/desktop/wallpapers/space324dhsj.png b/modules/home/desktop/wallpapers/space324dhsj.png new file mode 100644 index 0000000..dd869d1 Binary files /dev/null and b/modules/home/desktop/wallpapers/space324dhsj.png differ diff --git a/modules/home/desktop/wallpapers/spiral.jpg b/modules/home/desktop/wallpapers/spiral.jpg new file mode 100644 index 0000000..e63e6c3 Binary files /dev/null and b/modules/home/desktop/wallpapers/spiral.jpg differ diff --git a/modules/home/desktop/wallpapers/spooky_spill.jpg b/modules/home/desktop/wallpapers/spooky_spill.jpg new file mode 100644 index 0000000..9d50882 Binary files /dev/null and b/modules/home/desktop/wallpapers/spooky_spill.jpg differ diff --git a/modules/home/desktop/wallpapers/wallpaper.jpg b/modules/home/desktop/wallpapers/wallpaper.jpg new file mode 100644 index 0000000..6c97d3b Binary files /dev/null and b/modules/home/desktop/wallpapers/wallpaper.jpg differ diff --git a/modules/home/hyprland/default.nix b/modules/home/hyprland/default.nix index ee02f79..9477553 100644 --- a/modules/home/hyprland/default.nix +++ b/modules/home/hyprland/default.nix @@ -22,20 +22,30 @@ let cfg = config.modules.hyprland; + inherit (inputs.nix-colors.colorschemes.${builtins.toString config.modules.desktop.colorscheme}) + palette + ; in { - options.modules.hyprland = { - enable = lib.mkOption { default = false; }; + options.modules.hyprland = with lib.frajul; { + enable = mkBoolOpt false "Enable or disable the hyprland window manager."; }; # imports = [ (ib.mkIf inputs.hyprland.homeManagerModules.default) ]; config = lib.mkIf cfg.enable { + modules.desktop.addons = { + waybar.enable = true; + wofi.enable = true; + mako.enable = true; + gtklock.enable = true; + wlogout.enable = true; + }; - services.dunst.enable = true; + # services.dunst.enable = true; home.packages = with pkgs; [ - wofi + # wofi xfce.thunar # hyprpicker # TODO # hyprcursor # TODO @@ -43,116 +53,129 @@ in grimblast ]; - services.copyq.enable = true; - - programs.hyprlock.enable = true; - programs.hyprlock.settings = { - general = { - disable_loading_bar = true; - hide_cursor = true; - ignore_empty_input = true; - }; - - background = [ - { - path = "screenshot"; - blur_passes = 3; - blur_size = 8; - } - ]; - - input-field = [ - { - size = "200, 50"; - position = "0, -80"; - monitor = ""; - dots_center = true; - fade_on_empty = false; - font_color = "rgb(202, 211, 245)"; - inner_color = "rgb(91, 96, 120)"; - outer_color = "rgb(24, 25, 38)"; - outline_thickness = 5; - placeholder_text = "Password..."; - shadow_passes = 2; - } - ]; - }; - - services.hypridle = { - enable = true; - settings = { - general = { - after_sleep_cmd = "hyprctl dispatch dpms on"; - ignore_dbus_inhibit = false; - lock_cmd = "hyprlock"; - }; - - listener = [ - { - timeout = 300; # 5min - on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor. - on-resume = "brightnessctl -r"; # monitor backlight restore. + xdg.configFile = { + "hypr/launch".source = ./launch; + # "hypr/hyprland.conf".source = ./hyprland.conf; + "hypr/colors.conf" = { + text = '' + general { + col.active_border = 0xff${palette.base0C} 0xff${palette.base0D} 270deg + col.inactive_border = 0xff${palette.base00} } - - { - timeout = 360; # 6min - on-timeout = "hyprlock"; # lock screen when timeout has passed - } - - { - timeout = 600; # 10min - on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed - on-resume = "hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired. - } - ]; + ''; }; }; - programs.waybar = { - enable = true; - systemd.enable = true; - style = builtins.readFile ./style.css; - settings.mainBar = builtins.fromJSON (builtins.readFile ./waybar-config.json); - # settings = { - # mainBar = { - # layer = "top"; - # position = "bottom"; - # height = 30; - # output = [ - # "eDP-1" - # "HDMI-A-1" - # ]; - # modules-left = [ - # "hyprland/workspaces" - # "hyprland/submap" - # ]; - # modules-center = [ "hyprland/window" ]; - # modules-right = [ - # # "mpd" - # # "idle_inhibitor" - # "pulseaudio" - # # "network" - # "power-profiles-daemon" - # "cpu" - # "memory" - # # "temperature" - # # "backlight" - # # "keyboard-state" - # "battery" - # # "battery#bat2" - # "clock" - # "tray" - # ]; + # services.copyq.enable = true; - # # "sway/workspaces" = { - # # disable-scroll = true; - # # all-outputs = true; - # # }; - # }; - # }; - }; + # programs.hyprlock.enable = true; + # programs.hyprlock.settings = { + # general = { + # disable_loading_bar = true; + # hide_cursor = true; + # ignore_empty_input = true; + # }; - programs.wlogout.enable = true; # can be configured + # background = [ + # { + # path = "screenshot"; + # blur_passes = 3; + # blur_size = 8; + # } + # ]; + + # input-field = [ + # { + # size = "200, 50"; + # position = "0, -80"; + # monitor = ""; + # dots_center = true; + # fade_on_empty = false; + # font_color = "rgb(202, 211, 245)"; + # inner_color = "rgb(91, 96, 120)"; + # outer_color = "rgb(24, 25, 38)"; + # outline_thickness = 5; + # placeholder_text = "Password..."; + # shadow_passes = 2; + # } + # ]; + # }; + + # services.hypridle = { + # enable = true; + # settings = { + # general = { + # after_sleep_cmd = "hyprctl dispatch dpms on"; + # ignore_dbus_inhibit = false; + # lock_cmd = "hyprlock"; + # }; + + # listener = [ + # { + # timeout = 300; # 5min + # on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor. + # on-resume = "brightnessctl -r"; # monitor backlight restore. + # } + + # { + # timeout = 360; # 6min + # on-timeout = "hyprlock"; # lock screen when timeout has passed + # } + + # { + # timeout = 600; # 10min + # on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed + # on-resume = "hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired. + # } + # ]; + # }; + # }; + + # programs.waybar = { + # enable = true; + # systemd.enable = true; + # style = builtins.readFile ./style.css; + # settings.mainBar = builtins.fromJSON (builtins.readFile ./waybar-config.json); + # # settings = { + # # mainBar = { + # # layer = "top"; + # # position = "bottom"; + # # height = 30; + # # output = [ + # # "eDP-1" + # # "HDMI-A-1" + # # ]; + # # modules-left = [ + # # "hyprland/workspaces" + # # "hyprland/submap" + # # ]; + # # modules-center = [ "hyprland/window" ]; + # # modules-right = [ + # # # "mpd" + # # # "idle_inhibitor" + # # "pulseaudio" + # # # "network" + # # "power-profiles-daemon" + # # "cpu" + # # "memory" + # # # "temperature" + # # # "backlight" + # # # "keyboard-state" + # # "battery" + # # # "battery#bat2" + # # "clock" + # # "tray" + # # ]; + + # # # "sway/workspaces" = { + # # # disable-scroll = true; + # # # all-outputs = true; + # # # }; + # # }; + # # }; + # }; + + # programs.wlogout.enable = true; # can be configured # services.hypridle.enable = true; # can be configured services.network-manager-applet.enable = true; @@ -161,7 +184,7 @@ in # Whether to enable Hyprland wayland compositor enable = true; # The hyprland package to use (simplifies use of plugins) - package = inputs.hyprland.packages.${pkgs.system}.hyprland; + # package = inputs.hyprland.packages.${pkgs.system}.hyprland; # Whether to enable XWayland xwayland.enable = true; @@ -294,7 +317,7 @@ in # other commands "$mod, Escape, exec, wlogout -p layer-shell" - "$mod, TAB, exec, hyprlock" + "$mod, TAB, exec, gtklock" "$mod SHIFT, R, exec, hyprctl reload" ", Print, exec, grimblast --notify copysave area" diff --git a/modules/home/hyprland/gtklock/default.nix b/modules/home/hyprland/gtklock/default.nix new file mode 100644 index 0000000..9c4020e --- /dev/null +++ b/modules/home/hyprland/gtklock/default.nix @@ -0,0 +1,39 @@ +{ + options, + config, + lib, + pkgs, + inputs, + ... +}: +let + cfg = config.modules.desktop.addons.gtklock; + inherit (inputs.nix-colors.colorschemes.${builtins.toString config.modules.desktop.colorscheme}) + palette + ; +in +{ + options.modules.desktop.addons.gtklock = + with lib.frajul; + with lib.types; + { + enable = mkBoolOpt false "Enable or disable the gtklock screen locker."; + }; + + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ gtklock ]; + + xdg.configFile."gtklock/style.css".text = '' + window { + background-size: cover; + background-repeat: no-repeat; + background-position: center; + background-color: #${palette.base00}; + } + + clock-label { + color: #${palette.base05}; + } + ''; + }; +} diff --git a/modules/home/hyprland/hyprland.conf b/modules/home/hyprland/hyprland.conf new file mode 100644 index 0000000..c676b4f --- /dev/null +++ b/modules/home/hyprland/hyprland.conf @@ -0,0 +1,140 @@ +source = ~/.config/hypr/colors.conf + +monitor=,preferred,auto,auto +monitor=Unknown-1,disable # Freaking ghost monitor after update +exec-once = exec ~/.config/hypr/launch + +input { + kb_layout = us + + follow_mouse = 1 + + touchpad { + natural_scroll = yes + } + + kb_options = caps:escape + + sensitivity = -0.5 # -1.0 - 1.0, 0 means no modification. +} + +general { + gaps_in = 5 + gaps_out = 20 + border_size = 3 + layout = dwindle +} + +decoration { + rounding = 10 + + drop_shadow = yes + shadow_range = 4 + shadow_render_power = 3 + col.shadow = rgba(1a1a1aee) +} + +animations { + enabled=1 + # bezier=overshot,0.05,0.9,0.1,1.1 + bezier=overshot,0.13,0.99,0.29,1.1 + animation=windows,1,4,overshot,slide + animation=fade,1,10,default + animation=workspaces,1,6,overshot,slide + + bezier = linear, 0.0, 0.0, 1.0, 1.iii0 + animation = borderangle, 1, 100, linear, loop +} +dwindle { + 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 { + new_is_master = true +} + +gestures { + workspace_swipe = on +} + +$mainMod = SUPER +bind = $mainMod, RETURN, exec, foot +bind = $mainMod, Q, killactive, +bind = $mainMod, SPACE, togglefloating, +bind = $mainMod, P, exec, wofi --show drun +bind = $mainMod, F, fullscreen +bind = $mainMod, TAB, pseudo + +bind = $mainMod_SHIFT, E, exec, wlogout -b 1 -p layer-shell +bind = $mainMod_SHIFT, Q, exec, gtklock +bind = $mainMod_SHIFT, C, exec, wallpaper + +bind = , code:107, exec, screenshot +bind = $mainMod, code:107, exec, screenshot-edit + +bindl = , code:127, exec, wpctl set-volume @DEFAULT_SOURCE@ 100% +bindrl = , code:127, exec, wpctl set-volume @DEFAULT_SOURCE@ 0% + +# 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 + +# Move window with mainMod_SHIFT + arrow keys +bind = $mainMod_SHIFT, h, movewindow, l +bind = $mainMod_SHIFT, l, movewindow, r +bind = $mainMod_SHIFT, k, movewindow, u +bind = $mainMod_SHIFT, j, movewindow, 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 + +# Audio binds +binde=, XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +5% +binde=, XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -5% + +# Per device settings +# device:elan-touchpad { +# accel_profile = adaptive +# sensitivity = -0.3 +# } + +# Extra window rules + +# Allow hiding xwaylandvideobridge window correctly +windowrulev2 = opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$ +windowrulev2 = noanim,class:^(xwaylandvideobridge)$ +windowrulev2 = noinitialfocus,class:^(xwaylandvideobridge)$ +windowrulev2 = maxsize 1 1,class:^(xwaylandvideobridge)$ +windowrulev2 = noblur,class:^(xwaylandvideobridge)$ diff --git a/modules/home/hyprland/launch b/modules/home/hyprland/launch new file mode 100755 index 0000000..79d6764 --- /dev/null +++ b/modules/home/hyprland/launch @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +rm -rf $XDG_RUNTIME_DIR/swww.socket + +swww init & waybar & mako & xwaylandvideobridge diff --git a/modules/home/hyprland/mako/default.nix b/modules/home/hyprland/mako/default.nix new file mode 100644 index 0000000..3b5e61e --- /dev/null +++ b/modules/home/hyprland/mako/default.nix @@ -0,0 +1,44 @@ +{ + options, + config, + lib, + pkgs, + inputs, + ... +}: +let + cfg = config.modules.desktop.addons.mako; + inherit (inputs.nix-colors.colorschemes.${builtins.toString config.modules.desktop.colorscheme}) + palette + ; +in +{ + options.modules.desktop.addons.mako = + with lib.frajul; + with lib.types; + { + enable = mkBoolOpt false "Enable or disable mako"; + }; + + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ + mako + libnotify + ]; + + xdg.configFile."mako/config" = { + text = '' + background-color=#${palette.base00} + text-color=#${palette.base05} + border-color=#${palette.base0D} + progress-color=over #${palette.base02} + + [urgency=high] + border-color=#${palette.base09} + ''; + onChange = '' + ${pkgs.busybox}/bin/pkill -SIGUSR2 mako + ''; + }; + }; +} diff --git a/modules/home/hyprland/waybar/config.jsonc b/modules/home/hyprland/waybar/config.jsonc new file mode 100644 index 0000000..e018a75 --- /dev/null +++ b/modules/home/hyprland/waybar/config.jsonc @@ -0,0 +1,80 @@ +{ + "layer": "top", + "position": "top", + "mod": "dock", + "exclusive": true, + "passtrough": false, + "gtk-layer-shell": true, + "height": 32, + + "modules-left": [ + "hyprland/workspaces" + ], + + "modules-center": [], + + "modules-right": [ + "tray", + "network", + "battery", + "clock" + ], + + "hyprland/window": { + "format": "{}" + }, + + "hyprland/workspaces": { + "on-scroll-up": "hyprctl dispatch workspace e+1", + "on-scroll-down": "hyprctl dispatch workspace e-1", + "all-outputs": true, + "on-click": "activate", + "format": "{icon}", + "format-icons": { + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "8", + "9": "9", + "10": "10" + } + }, + + "tray": { + "icon-size": 12, + "tooltip": false, + "spacing": 10 + }, + + "clock": { + "format": "{:%H:%M}", + }, + + "pulseaudio": { + "format": " {volume}%", + "tooltip": false, + "format-muted": " N/A", + "on-click": "pavucontrol &", + "scroll-step": 5 + }, + + "network": { + "format-wifi": " {essid} {signalStrength}%", + "format-ethernet": "󰈀", + "format-disconnected": "󰈂" + }, + + "battery": { + "states": { + "warning": 20, + "critical": 15 + }, + "format": "󰁹 {capacity}%", + "format-charging": "󰂄 {capacity}%", + "format-plugged": "󰂄 {capacity}%" + } +} diff --git a/modules/home/hyprland/waybar/default.nix b/modules/home/hyprland/waybar/default.nix new file mode 100644 index 0000000..53fda50 --- /dev/null +++ b/modules/home/hyprland/waybar/default.nix @@ -0,0 +1,228 @@ +{ + options, + config, + pkgs, + lib, + inputs, + ... +}: +with lib; +with lib.frajul; +let + cfg = config.modules.desktop.addons.waybar; + inherit (inputs.nix-colors.colorschemes.${builtins.toString config.modules.desktop.colorscheme}) + palette + ; +in +{ + options.modules.desktop.addons.waybar = with types; { + enable = mkBoolOpt false "Enable or disable waybar"; + }; + + config = mkIf cfg.enable { + programs.waybar = { + enable = true; + systemd.enable = true; + }; + + xdg.configFile."waybar/config.jsonc" = { + source = ./config.jsonc; + onChange = '' + ${pkgs.busybox}/bin/pkill -SIGUSR2 waybar + ''; + }; + xdg.configFile."waybar/style.css" = { + text = '' + * { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: JetBrainsMono Nerd Font; + font-size: 13px; + border-radius: 17px; + } + + #clock, + #custom-notification, + #custom-launcher, + #custom-power-menu, + /*#custom-colorpicker,*/ + #custom-window, + #memory, + #disk, + #network, + #battery, + #custom-spotify, + #pulseaudio, + #window, + #tray { + padding: 5 15px; + border-radius: 12px; + background: #${palette.base00}; + color: #${palette.base07}; + margin-top: 8px; + margin-bottom: 8px; + margin-right: 2px; + margin-left: 2px; + transition: all 0.3s ease; + } + + #window { + background-color: transparent; + box-shadow: none; + } + + window#waybar { + background-color: rgba(0, 0, 0, 0.096); + border-radius: 17px; + } + + window * { + background-color: transparent; + border-radius: 0px; + } + + #workspaces button label { + color: #${palette.base07}; + } + + #workspaces button.active label { + color: #${palette.base00}; + font-weight: bolder; + } + + #workspaces button:hover { + box-shadow: #${palette.base07} 0 0 0 1.5px; + background-color: #${palette.base00}; + min-width: 50px; + } + + #workspaces { + background-color: transparent; + border-radius: 17px; + padding: 5 0px; + margin-top: 3px; + margin-bottom: 3px; + } + + #workspaces button { + background-color: #${palette.base00}; + border-radius: 12px; + margin-left: 10px; + + transition: all 0.3s ease; + } + + #workspaces button.active { + min-width: 50px; + box-shadow: rgba(0, 0, 0, 0.288) 2 2 5 2px; + background-color: #${palette.base0F}; + background-size: 400% 400%; + transition: all 0.3s ease; + background: linear-gradient( + 58deg, + #${palette.base0E}, + #${palette.base0E}, + #${palette.base0E}, + #${palette.base0D}, + #${palette.base0D}, + #${palette.base0E}, + #${palette.base08} + ); + background-size: 300% 300%; + animation: colored-gradient 20s ease infinite; + } + + @keyframes colored-gradient { + 0% { + background-position: 71% 0%; + } + 50% { + background-position: 30% 100%; + } + 100% { + background-position: 71% 0%; + } + } + + #custom-power-menu { + margin-right: 10px; + padding-left: 12px; + padding-right: 15px; + padding-top: 3px; + } + + #custom-spotify { + margin-left: 5px; + padding-left: 15px; + padding-right: 15px; + padding-top: 3px; + color: #${palette.base07}; + background-color: #${palette.base00}; + transition: all 0.3s ease; + } + + #custom-spotify.playing { + color: rgb(180, 190, 254); + background: rgba(30, 30, 46, 0.6); + background: linear-gradient( + 90deg, + #${palette.base02}, + #${palette.base00}, + #${palette.base00}, + #${palette.base00}, + #${palette.base00}, + #${palette.base02} + ); + background-size: 400% 100%; + animation: grey-gradient 3s linear infinite; + transition: all 0.3s ease; + } + + @keyframes grey-gradient { + 0% { + background-position: 100% 50%; + } + 100% { + background-position: -33% 50%; + } + } + + #tray menu { + background-color: #${palette.base00}; + opacity: 0.8; + } + + #pulseaudio.muted { + color: #${palette.base08}; + padding-right: 16px; + } + + #custom-notification.collapsed, + #custom-notification.waiting_done { + min-width: 12px; + padding-right: 17px; + } + + #custom-notification.waiting_start, + #custom-notification.expanded { + background-color: transparent; + background: linear-gradient( + 90deg, + #${palette.base02}, + #${palette.base00}, + #${palette.base00}, + #${palette.base00}, + #${palette.base00}, + #${palette.base02} + ); + background-size: 400% 100%; + animation: grey-gradient 3s linear infinite; + min-width: 500px; + border-radius: 17px; + } + ''; + onChange = '' + ${pkgs.busybox}/bin/pkill -SIGUSR2 waybar + ''; + }; + }; +} diff --git a/modules/home/hyprland/wlogout/default.nix b/modules/home/hyprland/wlogout/default.nix new file mode 100644 index 0000000..5bc3391 --- /dev/null +++ b/modules/home/hyprland/wlogout/default.nix @@ -0,0 +1,77 @@ +{ + options, + config, + lib, + pkgs, + inputs, + ... +}: +let + cfg = config.modules.desktop.addons.wlogout; + inherit (inputs.nix-colors.colorschemes.${builtins.toString config.modules.desktop.colorscheme}) + palette + ; +in +{ + options.modules.desktop.addons.wlogout = + with lib.frajul; + with lib.types; + { + enable = mkBoolOpt false "Enable or disable wlogout."; + }; + + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ wlogout ]; + + xdg.configFile."wlogout/style.css".text = '' + * { + all: unset; + font-family: JetBrains Mono Nerd Font; + } + + window { + background-color: #${palette.base00}; + } + + button { + color: #${palette.base01}; + font-size: 64px; + background-color: rgba(0,0,0,0); + outline-style: none; + margin: 5px; + } + + button:focus, button:active, button:hover { + color: #${palette.base0D}; + transition: ease 0.4s; + } + ''; + + xdg.configFile."wlogout/layout".text = '' + { + "label" : "lock", + "action" : "gtklock", + "text" : "󰌾", + "keybind" : "" + } + { + "label" : "logout", + "action" : "loginctl terminate-user $USER", + "text" : "󰗽", + "keybind" : "" + } + { + "label" : "shutdown", + "action" : "systemctl poweroff", + "text" : "󰐥", + "keybind" : "" + } + { + "label" : "reboot", + "action" : "systemctl reboot", + "text" : "󰑓", + "keybind" : "" + } + ''; + }; +} diff --git a/modules/home/hyprland/wofi/config b/modules/home/hyprland/wofi/config new file mode 100644 index 0000000..7d7484c --- /dev/null +++ b/modules/home/hyprland/wofi/config @@ -0,0 +1,15 @@ +width=900 +height=600 +location=center +show=drun +prompt=Search... +filter_rate=100 +allow_markup=true +no_actions=true +halign=fill +orientation=vertical +content_halign=fill +insensitive=true +allow_images=true +image_size=35 +gtk_dark=true diff --git a/modules/home/hyprland/wofi/default.nix b/modules/home/hyprland/wofi/default.nix new file mode 100644 index 0000000..e0fe6d4 --- /dev/null +++ b/modules/home/hyprland/wofi/default.nix @@ -0,0 +1,97 @@ +{ + options, + config, + lib, + pkgs, + inputs, + ... +}: +let + cfg = config.modules.desktop.addons.wofi; + inherit (inputs.nix-colors.colorschemes.${builtins.toString config.modules.desktop.colorscheme}) + palette + ; +in +{ + options.modules.desktop.addons.wofi = + with lib.frajul; + with lib.types; + { + enable = mkBoolOpt false "Enable or disable the wofi run launcher."; + }; + + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ wofi ]; + + xdg.configFile."wofi/config".source = ./config; + xdg.configFile."wofi/style.css".text = '' + window { + margin: 5px; + border: 5px solid #181926; + background-color: #${palette.base00}; + border-radius: 15px; + font-family: "JetBrainsMono"; + font-size: 14px; + } + + #input { + all: unset; + min-height: 36px; + padding: 4px 10px; + margin: 4px; + border: none; + color: #${palette.base05}; + font-weight: bold; + background-color: #${palette.base01}; + outline: none; + border-radius: 15px; + margin: 10px; + margin-bottom: 2px; + } + + #inner-box { + margin: 4px; + padding: 10px; + font-weight: bold; + border-radius: 15px; + } + + #outer-box { + margin: 0px; + padding: 3px; + border: none; + border-radius: 15px; + border: 5px solid #${palette.base01}; + } + + #scroll { + margin-top: 5px; + border: none; + border-radius: 15px; + margin-bottom: 5px; + } + + #text:selected { + color: #${palette.base01}; + margin: 0px 0px; + border: none; + border-radius: 15px; + } + + #entry { + margin: 0px 0px; + border: none; + border-radius: 15px; + background-color: transparent; + } + + #entry:selected { + margin: 0px 0px; + border: none; + border-radius: 15px; + background: #${palette.base0D}; + background-size: 400% 400%; + } + ''; + }; +} diff --git a/modules/nixos/boot-efi/default.nix b/modules/nixos/boot-efi/default.nix new file mode 100644 index 0000000..706b7fb --- /dev/null +++ b/modules/nixos/boot-efi/default.nix @@ -0,0 +1,25 @@ +{ + options, + config, + lib, + ... +}: +with lib; +with lib.frajul; +let + cfg = config.modules.system.boot-efi; +in +{ + options.modules.system.boot-efi = with types; { + enable = mkBoolOpt false "Whether or not to enable efi booting."; + }; + + config = mkIf cfg.enable { + boot.loader.systemd-boot.enable = true; + boot.loader.systemd-boot.configurationLimit = 5; + boot.loader.efi.canTouchEfiVariables = true; + + # https://github.com/NixOS/nixpkgs/blob/c32c39d6f3b1fe6514598fa40ad2cf9ce22c3fb7/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix#L66 + boot.loader.systemd-boot.editor = false; + }; +} diff --git a/systems/x86_64-linux/aspi/default.nix b/systems/x86_64-linux/aspi/default.nix index b465a58..e989765 100644 --- a/systems/x86_64-linux/aspi/default.nix +++ b/systems/x86_64-linux/aspi/default.nix @@ -22,33 +22,31 @@ { imports = [ ./hardware-configuration.nix ]; - nix.buildMachines = [ - { - hostName = "192.168.3.118"; - system = "x86_64-linux"; - protocol = "ssh"; - # if the builder supports building for multiple architectures, - # replace the previous line by, e.g. - # systems = ["x86_64-linux" "aarch64-linux"]; - maxJobs = 4; - speedFactor = 3; - supportedFeatures = [ - "nixos-test" - "benchmark" - "big-parallel" - "kvm" - ]; - mandatoryFeatures = [ ]; - } - ]; - nix.distributedBuilds = true; - # optional, useful when the builder has a faster internet connection than yours - nix.extraOptions = " builders-use-substitutes = true\n"; + # nix.buildMachines = [ + # { + # hostName = "192.168.3.118"; + # system = "x86_64-linux"; + # protocol = "ssh"; + # # if the builder supports building for multiple architectures, + # # replace the previous line by, e.g. + # # systems = ["x86_64-linux" "aarch64-linux"]; + # maxJobs = 4; + # speedFactor = 3; + # supportedFeatures = [ + # "nixos-test" + # "benchmark" + # "big-parallel" + # "kvm" + # ]; + # mandatoryFeatures = [ ]; + # } + # ]; + # nix.distributedBuilds = true; + # # optional, useful when the builder has a faster internet connection than yours + # nix.extraOptions = " builders-use-substitutes = true\n"; # Bootloader - # Use this for simple nix boot menu, if no dual boot required - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; + modules.system.boot-efi.enable = true; boot.supportedFilesystems = [ "btrfs" @@ -61,6 +59,10 @@ # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. networking.networkmanager.enable = true; + topology.self = { + hardware.info = "ThinkPad L430, 8GB RAM"; + }; + # Set your time zone. time.timeZone = "Europe/Berlin"; @@ -105,6 +107,7 @@ # Enable the XFCE Desktop Environment. services.xserver.displayManager.gdm.enable = true; security.pam.services.gdm.enableGnomeKeyring = true; + security.pam.services.gtklock = { }; # services.displayManager.sddm.wayland.enable = true; # services.xserver.desktopManager = { @@ -248,6 +251,13 @@ services.flatpak.enable = true; + environment.sessionVariables.NIXOS_OZONE_WL = "1"; # Hint electron apps to use wayland + + # TODO: connect with desktop home manager module + environment.variables = { + GTK_THEME = "Catppuccin-Mocha-Compact-Blue-dark"; + }; + xdg.portal.enable = true; xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk