Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: treewide nixfmt-plus, disable global flake registry, hyprland improvements #301

Merged
merged 12 commits into from
Aug 30, 2024
4 changes: 1 addition & 3 deletions darwin/_mixins/desktop/apps/utilities/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ lib.mkIf (lib.elem username installFor) {
];

homebrew = {
casks = [
"balenaetcher"
];
casks = [ "balenaetcher" ];
};
}
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -206,5 +206,7 @@
overlays = import ./overlays { inherit inputs; };
# Custom packages; acessible via 'nix build', 'nix shell', etc
packages = helper.forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
# Formatter for .nix files, available via 'nix fmt'
formatter = helper.forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
};
}
6 changes: 1 addition & 5 deletions home-manager/_mixins/desktop/apps/joplin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ in
lib.mkIf (lib.elem username installFor) {
# Jopin CLI fails to build on x86_64-darwin
home = {
packages = with pkgs; [
font-awesome_5
] ++ lib.optionals (platform != "x86_64-darwin") [
joplin
];
packages = with pkgs; [ font-awesome_5 ] ++ lib.optionals (platform != "x86_64-darwin") [ joplin ];
};

programs.joplin-desktop = {
Expand Down
3 changes: 2 additions & 1 deletion home-manager/_mixins/desktop/features/gtk/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
}:
let
inherit (pkgs.stdenv) isLinux;
buttonLayout = if config.wayland.windowManager.hyprland.enable then "appmenu" else "close,minimize,maximize";
buttonLayout =
if config.wayland.windowManager.hyprland.enable then "appmenu" else "close,minimize,maximize";
in
lib.mkIf isLinux {
# TODO: Migrate to Colloid-gtk-theme 2024-06-18 or newer; now has catppuccin colors
Expand Down
9 changes: 2 additions & 7 deletions home-manager/_mixins/desktop/hyprland/avizo/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
lib,
pkgs,
...
}:
{
_: {
# avizo is an osd notification daemon for audio and backlight
# avizo provides volumectl and lightctl for controlling audio and backlight
services = {
Expand All @@ -23,7 +18,7 @@
image-opacity = 0.9;
padding = 32;
time = 2;
fade-in = 0.50;
fade-in = 0.5;
fade-out = 0.75;
width = 480;
height = 240;
Expand Down
104 changes: 57 additions & 47 deletions home-manager/_mixins/desktop/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
...
}:
let
isLaptop = hostname != "vader" && hostname != "phasma" && hostname != "revan";
monitors = (import ./monitors.nix { }).${hostname};
in
{
Expand Down Expand Up @@ -46,9 +45,7 @@ in
wayland.windowManager.hyprland = {
enable = true;
catppuccin.enable = true;
plugins = with pkgs; [
hyprlandPlugins.hyprtrails
];
plugins = with pkgs; [ hyprlandPlugins.hyprtrails ];
settings = {
inherit (monitors) monitor;
"$mod" = "SUPER";
Expand All @@ -62,48 +59,54 @@ in
# Move windows with $mod + LMB and dragging
"$mod, mouse:272, movewindow"
];
bind = [
# Process management
"$mod, Q, killactive"
# Launch applications
"$mod, E, exec, nautilus --new-window"
"$mod, T, exec, alacritty"
# Move focus
"ALT, Tab, cyclenext"
"ALT, Tab, bringactivetotop"
"ALT SHIFT, Tab, cyclenext, prev"
"ALT SHIFT, Tab, bringactivetotop"
# Move focus with SHIFT + arrow keys
"SHIFT, left, movefocus, l"
"SHIFT, right, movefocus, r"
"SHIFT, up, movefocus, u"
"SHIFT, down, movefocus, d"
"$mod, left, swapwindow, l"
"$mod, right, swapwindow, r"
"$mod, up, fullscreen, 1"
"$mod, down, swapwindow, d"
"$mod, F, togglefloating"
"$mod, P, pseudo"
# Switch workspace
"CTRL ALT, left, workspace, e-1"
"CTRL ALT, right, workspace, e+1"
] ++ (
# workspaces
# binds ctrl + alt + {1..8} to switch to workspace {1..8}
# binds $mod + alt + {1..8} to move window to workspace {1..8}
builtins.concatLists (builtins.genList (
x: let
ws = let
c = (x + 1) / 9;
bind =
[
# Process management
"$mod, Q, killactive"
# Launch applications
"$mod, E, exec, nautilus --new-window"
"$mod, T, exec, alacritty"
# Move focus
"ALT, Tab, cyclenext"
"ALT, Tab, bringactivetotop"
"ALT SHIFT, Tab, cyclenext, prev"
"ALT SHIFT, Tab, bringactivetotop"
# Move focus with SHIFT + arrow keys
"SHIFT, left, movefocus, l"
"SHIFT, right, movefocus, r"
"SHIFT, up, movefocus, u"
"SHIFT, down, movefocus, d"
"$mod, left, swapwindow, l"
"$mod, right, swapwindow, r"
"$mod, up, fullscreen, 1"
"$mod, down, swapwindow, d"
"$mod, F, togglefloating"
"$mod, P, pseudo"
# Switch workspace
"CTRL ALT, left, workspace, e-1"
"CTRL ALT, right, workspace, e+1"
]
++ (
# workspaces
# binds ctrl + alt + {1..8} to switch to workspace {1..8}
# binds $mod + alt + {1..8} to move window to workspace {1..8}
builtins.concatLists (
builtins.genList (
x:
let
ws =
let
c = (x + 1) / 9;
in
builtins.toString (x + 1 - (c * 9));
in
builtins.toString (x + 1 - (c * 9));
in [
"CTRL ALT, ${ws}, workspace, ${toString (x + 1)}"
"$mod ALT, ${ws}, movetoworkspace, ${toString (x + 1)}"
]
[
"CTRL ALT, ${ws}, workspace, ${toString (x + 1)}"
"$mod ALT, ${ws}, movetoworkspace, ${toString (x + 1)}"
]
) 9
)
9)
);
);
# https://wiki.hyprland.org/Configuring/Variables/#animations
animations = {
enabled = true;
Expand Down Expand Up @@ -140,7 +143,7 @@ in
shadow_range = 304;
shadow_render_power = 4;
shadow_offset = "0, 42";
shadow_scale = 0.90;
shadow_scale = 0.9;
};
#https://wiki.hyprland.org/Configuring/Master-Layout/
master = {
Expand All @@ -155,6 +158,8 @@ in
pseudotile = true;
};
exec-once = [
"sleep 0.25 && hyprctl dispatch workspace 1"
"sleep 1 && trayscale --gapplication-service --hide-window"
#"sleep 1 && hyprctl dispatch exec [workspace 1 silent] brave"
#"sleep 2 && hyprctl dispatch exec [workspace 2 silent] wavebox"
#"sleep 2 && hyprctl dispatch exec [workspace 2 silent] discord"
Expand All @@ -163,7 +168,6 @@ in
#"sleep 4 && hyprctl dispatch exec [workspace 4 silent] code"
#"sleep 4 && hyprctl dispatch exec [workspace 4 silent] gitkraken"
#"sleep 5 && hyprctl dispatch exec [workspace 5 silent] alacritty"
"sleep 5 && trayscale --gapplication-service --hide-window"
];
general = {
gaps_in = 5;
Expand Down Expand Up @@ -219,7 +223,7 @@ in
};
windowrulev2 = [
# only allow shadows for floating windows
#"noshadow, floating:0"
"noshadow, floating:0"

# make pop-up file dialogs floating, centred, and pinned
"float, title:(Open|Progress|Save File)"
Expand All @@ -228,6 +232,12 @@ in
"float, class:^(code)$"
"center, class:^(code)$"
"pin, class:^(code)$"

# Apps that should be floating
"float, title:(overskride|Pipewire Volume Control|Trayscale)"
"center, title:(overskride|Pipewire Volume Control|Trayscale)"
"float, class:(nm-connection-editor)"
"center, class:(nm-connection-editor)"
];
# Simulate static workspaces
workspace = [
Expand Down
11 changes: 2 additions & 9 deletions home-manager/_mixins/desktop/hyprland/fuzzel/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
config,
lib,
pkgs,
...
}:
{ lib, pkgs, ... }:
{
# Fuzzel powered app launcher, emoji picker and clipboard manager for Hyprland
home = {
Expand All @@ -29,9 +24,7 @@
};
wayland.windowManager.hyprland = {
settings = {
bindr = [
"$mod, SUPER_L, exec, fuzzel --prompt '󰵆 > '"
];
bindr = [ "$mod, SUPER_L, exec, fuzzel --prompt '󰵆 > '" ];
bind = [
"$mod, SPACE, exec, fuzzel --prompt '󰌧 > ' --show-actions"
"CTRL ALT, C, exec, cliphist list | fuzzel --dmenu --prompt '󰅌 > ' | cliphist decode | wl-copy --primary --regular --trim-newline"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"SHIFT, Print, exec, ${lib.getExe pkgs.grimblast} save area - | ${lib.getExe pkgs.swappy} -f -"
"CTRL ALT, Print, exec, ${lib.getExe pkgs.grimblast} save active - | ${lib.getExe pkgs.swappy} -f -"
"CTRL, Print, exec, ${lib.getExe pkgs.grimblast} save output - | ${lib.getExe pkgs.swappy} -f -"
];
];
};
};
}
Loading
Loading