From fba993c589920fbe68d9f7918e52903c476adad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=A9tan=20Lepage?= Date: Wed, 15 Oct 2025 22:09:51 +0200 Subject: [PATCH] Format project with official nixfmt formatter (#21) * Set nix official formatter for the flake * format the entire project --- config.nix | 8 +- flake.nix | 90 +++++----- lib/selected-wallpaper.nix | 22 ++- modules/home-manager/btop.nix | 6 +- modules/home-manager/default.nix | 48 ++++-- modules/home-manager/direnv.nix | 3 +- modules/home-manager/fonts.nix | 9 +- modules/home-manager/ghostty.nix | 6 +- modules/home-manager/git.nix | 6 +- modules/home-manager/hypridle.nix | 3 +- modules/home-manager/hyprland.nix | 8 +- modules/home-manager/hyprland/autostart.nix | 3 +- modules/home-manager/hyprland/bindings.nix | 162 +++++++++--------- .../home-manager/hyprland/configuration.nix | 6 +- modules/home-manager/hyprland/envs.nix | 68 ++++---- modules/home-manager/hyprland/input.nix | 3 +- modules/home-manager/hyprland/looknfeel.nix | 13 +- modules/home-manager/hyprland/windows.nix | 3 +- modules/home-manager/hyprlock.nix | 9 +- modules/home-manager/hyprpaper.nix | 6 +- modules/home-manager/mako.nix | 6 +- modules/home-manager/starship.nix | 3 +- modules/home-manager/vscode.nix | 25 +-- modules/home-manager/waybar.nix | 31 ++-- modules/home-manager/wofi.nix | 3 +- modules/home-manager/zoxide.nix | 3 +- modules/home-manager/zsh.nix | 7 +- modules/nixos/1password.nix | 5 +- modules/nixos/containers.nix | 3 +- modules/nixos/default.nix | 11 +- modules/nixos/hyprland.nix | 6 +- modules/nixos/system.nix | 11 +- modules/packages.nix | 58 ++++--- modules/themes.nix | 2 +- 34 files changed, 375 insertions(+), 281 deletions(-) diff --git a/config.nix b/config.nix index 48098fd..5f21b4e 100644 --- a/config.nix +++ b/config.nix @@ -33,7 +33,7 @@ lib: { }; }; }; - default = {}; + default = { }; description = "Theme overrides including wallpaper path for generated themes"; }; primary_font = lib.mkOption { @@ -42,11 +42,11 @@ lib: { }; vscode_settings = lib.mkOption { type = lib.types.attrs; - default = {}; + default = { }; }; monitors = lib.mkOption { type = lib.types.listOf lib.types.str; - default = []; + default = [ ]; }; scale = lib.mkOption { type = lib.types.int; @@ -80,7 +80,7 @@ lib: { }; exclude_packages = lib.mkOption { type = lib.types.listOf lib.types.package; - default = []; + default = [ ]; description = "Packages to exclude from the default system packages"; }; }; diff --git a/flake.nix b/flake.nix index 9f0074c..c601163 100644 --- a/flake.nix +++ b/flake.nix @@ -9,48 +9,56 @@ inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = inputs @ { - self, - nixpkgs, - hyprland, - nix-colors, - home-manager, - }: { - nixosModules = { - default = { - config, - lib, - pkgs, - ... - }: { - imports = [ - (import ./modules/nixos/default.nix inputs) - ]; + outputs = + inputs@{ + self, + nixpkgs, + hyprland, + nix-colors, + home-manager, + }: + { + formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-tree; - options.omarchy = (import ./config.nix lib).omarchyOptions; - config = { - nixpkgs.config.allowUnfree = true; - }; + nixosModules = { + default = + { + config, + lib, + pkgs, + ... + }: + { + imports = [ + (import ./modules/nixos/default.nix inputs) + ]; + + options.omarchy = (import ./config.nix lib).omarchyOptions; + config = { + nixpkgs.config.allowUnfree = true; + }; + }; + }; + + homeManagerModules = { + default = + { + config, + lib, + pkgs, + osConfig ? { }, + ... + }: + { + imports = [ + nix-colors.homeManagerModules.default + (import ./modules/home-manager/default.nix inputs) + ]; + options.omarchy = (import ./config.nix lib).omarchyOptions; + config = lib.mkIf (osConfig ? omarchy) { + omarchy = osConfig.omarchy; + }; + }; }; }; - - homeManagerModules = { - default = { - config, - lib, - pkgs, - osConfig ? {}, - ... - }: { - imports = [ - nix-colors.homeManagerModules.default - (import ./modules/home-manager/default.nix inputs) - ]; - options.omarchy = (import ./config.nix lib).omarchyOptions; - config = lib.mkIf (osConfig ? omarchy) { - omarchy = osConfig.omarchy; - }; - }; - }; - }; } diff --git a/lib/selected-wallpaper.nix b/lib/selected-wallpaper.nix index dd3d634..0801279 100644 --- a/lib/selected-wallpaper.nix +++ b/lib/selected-wallpaper.nix @@ -1,4 +1,5 @@ -config: let +config: +let cfg = config.omarchy; wallpapers = { "tokyo-night" = [ @@ -22,11 +23,18 @@ config: let }; # Handle wallpaper path for generated themes and overrides - wallpaper_path = if (cfg.theme == "generated_light" || cfg.theme == "generated_dark") || (cfg.theme_overrides.wallpaper_path != null) - then toString cfg.theme_overrides.wallpaper_path - else let - selected_wallpaper = builtins.elemAt (wallpapers.${cfg.theme}) 0; - in "~/Pictures/Wallpapers/${selected_wallpaper}"; -in { + wallpaper_path = + if + (cfg.theme == "generated_light" || cfg.theme == "generated_dark") + || (cfg.theme_overrides.wallpaper_path != null) + then + toString cfg.theme_overrides.wallpaper_path + else + let + selected_wallpaper = builtins.elemAt (wallpapers.${cfg.theme}) 0; + in + "~/Pictures/Wallpapers/${selected_wallpaper}"; +in +{ inherit wallpaper_path; } diff --git a/modules/home-manager/btop.nix b/modules/home-manager/btop.nix index 704c205..f22cc76 100644 --- a/modules/home-manager/btop.nix +++ b/modules/home-manager/btop.nix @@ -2,10 +2,12 @@ config, pkgs, ... -}: let +}: +let cfg = config.omarchy; palette = config.colorScheme.palette; -in { +in +{ home.file = { ".config/btop/themes/${cfg.theme}.theme" = { text = '' diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 2846775..78bbe69 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -1,26 +1,36 @@ -inputs: { +inputs: +{ config, pkgs, lib, ... -}: let - packages = import ../packages.nix {inherit pkgs lib; exclude_packages = config.omarchy.exclude_packages;}; +}: +let + packages = import ../packages.nix { + inherit pkgs lib; + exclude_packages = config.omarchy.exclude_packages; + }; themes = import ../themes.nix; - + # Handle theme selection - either predefined or generated - selectedTheme = if (config.omarchy.theme == "generated_light" || config.omarchy.theme == "generated_dark") - then null - else themes.${config.omarchy.theme}; - + selectedTheme = + if (config.omarchy.theme == "generated_light" || config.omarchy.theme == "generated_dark") then + null + else + themes.${config.omarchy.theme}; + # Generate color scheme from wallpaper for generated themes - generatedColorScheme = if (config.omarchy.theme == "generated_light" || config.omarchy.theme == "generated_dark") - then (inputs.nix-colors.lib.contrib { inherit pkgs; }).colorSchemeFromPicture { - path = config.omarchy.theme_overrides.wallpaper_path; - variant = if config.omarchy.theme == "generated_light" then "light" else "dark"; - } - else null; -in { + generatedColorScheme = + if (config.omarchy.theme == "generated_light" || config.omarchy.theme == "generated_dark") then + (inputs.nix-colors.lib.contrib { inherit pkgs; }).colorSchemeFromPicture { + path = config.omarchy.theme_overrides.wallpaper_path; + variant = if config.omarchy.theme == "generated_light" then "light" else "dark"; + } + else + null; +in +{ imports = [ (import ./hyprland.nix inputs) (import ./hyprlock.nix inputs) @@ -47,9 +57,11 @@ in { }; home.packages = packages.homePackages; - colorScheme = if (config.omarchy.theme == "generated_light" || config.omarchy.theme == "generated_dark") - then generatedColorScheme - else inputs.nix-colors.colorSchemes.${selectedTheme.base16-theme}; + colorScheme = + if (config.omarchy.theme == "generated_light" || config.omarchy.theme == "generated_dark") then + generatedColorScheme + else + inputs.nix-colors.colorSchemes.${selectedTheme.base16-theme}; gtk = { enable = true; diff --git a/modules/home-manager/direnv.nix b/modules/home-manager/direnv.nix index 30c5f0d..0f7a873 100644 --- a/modules/home-manager/direnv.nix +++ b/modules/home-manager/direnv.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ programs.direnv = { enable = true; enableZshIntegration = true; diff --git a/modules/home-manager/fonts.nix b/modules/home-manager/fonts.nix index 5e2d6a8..8d32925 100644 --- a/modules/home-manager/fonts.nix +++ b/modules/home-manager/fonts.nix @@ -1,10 +1,11 @@ -{...}: { +{ ... }: +{ fonts.fontconfig = { enable = true; defaultFonts = { - serif = ["Noto Serif"]; - sansSerif = ["Noto Sans"]; - monospace = ["Caskaydia Mono Nerd Font"]; + serif = [ "Noto Serif" ]; + sansSerif = [ "Noto Sans" ]; + monospace = [ "Caskaydia Mono Nerd Font" ]; }; }; } diff --git a/modules/home-manager/ghostty.nix b/modules/home-manager/ghostty.nix index b435894..e1a4bbc 100644 --- a/modules/home-manager/ghostty.nix +++ b/modules/home-manager/ghostty.nix @@ -2,10 +2,12 @@ config, pkgs, ... -}: let +}: +let cfg = config.omarchy; palette = config.colorScheme.palette; -in { +in +{ programs.ghostty = { enable = true; settings = { diff --git a/modules/home-manager/git.nix b/modules/home-manager/git.nix index 62c6b87..2a8b21b 100644 --- a/modules/home-manager/git.nix +++ b/modules/home-manager/git.nix @@ -1,6 +1,8 @@ -{config, ...}: let +{ config, ... }: +let cfg = config.omarchy; -in { +in +{ programs.git = { enable = true; userName = cfg.full_name; diff --git a/modules/home-manager/hypridle.nix b/modules/home-manager/hypridle.nix index 0721547..8189af8 100644 --- a/modules/home-manager/hypridle.nix +++ b/modules/home-manager/hypridle.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ services.hypridle = { enable = true; settings = { diff --git a/modules/home-manager/hyprland.nix b/modules/home-manager/hyprland.nix index e8f038e..5ab6593 100644 --- a/modules/home-manager/hyprland.nix +++ b/modules/home-manager/hyprland.nix @@ -1,9 +1,11 @@ -inputs: { +inputs: +{ config, pkgs, ... -}: { - imports = [./hyprland/configuration.nix]; +}: +{ + imports = [ ./hyprland/configuration.nix ]; wayland.windowManager.hyprland = { enable = true; package = inputs.hyprland.packages.${pkgs.system}.hyprland; diff --git a/modules/home-manager/hyprland/autostart.nix b/modules/home-manager/hyprland/autostart.nix index b39fe44..57b2ce2 100644 --- a/modules/home-manager/hyprland/autostart.nix +++ b/modules/home-manager/hyprland/autostart.nix @@ -2,7 +2,8 @@ config, pkgs, ... -}: { +}: +{ wayland.windowManager.hyprland.settings = { exec-once = [ # "hypridle & mako & waybar & fcitx5" diff --git a/modules/home-manager/hyprland/bindings.nix b/modules/home-manager/hyprland/bindings.nix index bd5e390..cfafd77 100644 --- a/modules/home-manager/hyprland/bindings.nix +++ b/modules/home-manager/hyprland/bindings.nix @@ -2,103 +2,103 @@ config, pkgs, ... -}: let +}: +let cfg = config.omarchy; -in { +in +{ wayland.windowManager.hyprland.settings = { - bind = - cfg.quick_app_bindings - ++ [ - "SUPER, space, exec, wofi --show drun --sort-order=alphabetical" - "SUPER SHIFT, SPACE, exec, pkill -SIGUSR1 waybar" - # "SUPER CTRL, SPACE, exec, ~/.local/share/omarchy/bin/swaybg-next" - # "SUPER SHIFT CTRL, SPACE, exec, ~/.local/share/omarchy/bin/omarchy-theme-next" + bind = cfg.quick_app_bindings ++ [ + "SUPER, space, exec, wofi --show drun --sort-order=alphabetical" + "SUPER SHIFT, SPACE, exec, pkill -SIGUSR1 waybar" + # "SUPER CTRL, SPACE, exec, ~/.local/share/omarchy/bin/swaybg-next" + # "SUPER SHIFT CTRL, SPACE, exec, ~/.local/share/omarchy/bin/omarchy-theme-next" - "SUPER, W, killactive," - "SUPER, Backspace, killactive," + "SUPER, W, killactive," + "SUPER, Backspace, killactive," - # End active session - "SUPER, ESCAPE, exec, hyprlock" - "SUPER SHIFT, ESCAPE, exit," - "SUPER CTRL, ESCAPE, exec, reboot" - "SUPER SHIFT CTRL, ESCAPE, exec, systemctl poweroff" - "SUPER, K, exec, ~/.local/share/omarchy/bin/omarchy-show-keybindings" + # End active session + "SUPER, ESCAPE, exec, hyprlock" + "SUPER SHIFT, ESCAPE, exit," + "SUPER CTRL, ESCAPE, exec, reboot" + "SUPER SHIFT CTRL, ESCAPE, exec, systemctl poweroff" + "SUPER, K, exec, ~/.local/share/omarchy/bin/omarchy-show-keybindings" - # Control tiling - "SUPER, J, togglesplit, # dwindle" - "SUPER, P, pseudo, # dwindle" - "SUPER, V, togglefloating," - "SUPER SHIFT, Plus, fullscreen," + # Control tiling + "SUPER, J, togglesplit, # dwindle" + "SUPER, P, pseudo, # dwindle" + "SUPER, V, togglefloating," + "SUPER SHIFT, Plus, fullscreen," - # Move focus with mainMod + arrow keys - "SUPER, left, movefocus, l" - "SUPER, right, movefocus, r" - "SUPER, up, movefocus, u" - "SUPER, down, movefocus, d" + # Move focus with mainMod + arrow keys + "SUPER, left, movefocus, l" + "SUPER, right, movefocus, r" + "SUPER, up, movefocus, u" + "SUPER, down, movefocus, d" - # Switch workspaces with mainMod + [0-9] - "SUPER, 1, workspace, 1" - "SUPER, 2, workspace, 2" - "SUPER, 3, workspace, 3" - "SUPER, 4, workspace, 4" - "SUPER, 5, workspace, 5" - "SUPER, 6, workspace, 6" - "SUPER, 7, workspace, 7" - "SUPER, 8, workspace, 8" - "SUPER, 9, workspace, 9" - "SUPER, 0, workspace, 10" - - "SUPER, comma, workspace, -1" - "SUPER, period, workspace, +1" + # Switch workspaces with mainMod + [0-9] + "SUPER, 1, workspace, 1" + "SUPER, 2, workspace, 2" + "SUPER, 3, workspace, 3" + "SUPER, 4, workspace, 4" + "SUPER, 5, workspace, 5" + "SUPER, 6, workspace, 6" + "SUPER, 7, workspace, 7" + "SUPER, 8, workspace, 8" + "SUPER, 9, workspace, 9" + "SUPER, 0, workspace, 10" - # Move active window to a workspace with mainMod + SHIFT + [0-9] - "SUPER SHIFT, 1, movetoworkspace, 1" - "SUPER SHIFT, 2, movetoworkspace, 2" - "SUPER SHIFT, 3, movetoworkspace, 3" - "SUPER SHIFT, 4, movetoworkspace, 4" - "SUPER SHIFT, 5, movetoworkspace, 5" - "SUPER SHIFT, 6, movetoworkspace, 6" - "SUPER SHIFT, 7, movetoworkspace, 7" - "SUPER SHIFT, 8, movetoworkspace, 8" - "SUPER SHIFT, 9, movetoworkspace, 9" - "SUPER SHIFT, 0, movetoworkspace, 10" + "SUPER, comma, workspace, -1" + "SUPER, period, workspace, +1" - # Swap active window with the one next to it with mainMod + SHIFT + arrow keys - "SUPER SHIFT, left, swapwindow, l" - "SUPER SHIFT, right, swapwindow, r" - "SUPER SHIFT, up, swapwindow, u" - "SUPER SHIFT, down, swapwindow, d" + # Move active window to a workspace with mainMod + SHIFT + [0-9] + "SUPER SHIFT, 1, movetoworkspace, 1" + "SUPER SHIFT, 2, movetoworkspace, 2" + "SUPER SHIFT, 3, movetoworkspace, 3" + "SUPER SHIFT, 4, movetoworkspace, 4" + "SUPER SHIFT, 5, movetoworkspace, 5" + "SUPER SHIFT, 6, movetoworkspace, 6" + "SUPER SHIFT, 7, movetoworkspace, 7" + "SUPER SHIFT, 8, movetoworkspace, 8" + "SUPER SHIFT, 9, movetoworkspace, 9" + "SUPER SHIFT, 0, movetoworkspace, 10" - # Resize active window - "SUPER, minus, resizeactive, -100 0" - "SUPER, equal, resizeactive, 100 0" - "SUPER SHIFT, minus, resizeactive, 0 -100" - "SUPER SHIFT, equal, resizeactive, 0 100" + # Swap active window with the one next to it with mainMod + SHIFT + arrow keys + "SUPER SHIFT, left, swapwindow, l" + "SUPER SHIFT, right, swapwindow, r" + "SUPER SHIFT, up, swapwindow, u" + "SUPER SHIFT, down, swapwindow, d" - # Scroll through existing workspaces with mainMod + scroll - "SUPER, mouse_down, workspace, e+1" - "SUPER, mouse_up, workspace, e-1" + # Resize active window + "SUPER, minus, resizeactive, -100 0" + "SUPER, equal, resizeactive, 100 0" + "SUPER SHIFT, minus, resizeactive, 0 -100" + "SUPER SHIFT, equal, resizeactive, 0 100" - # Control Apple Display brightness - "CTRL, F1, exec, ~/.local/share/omarchy/bin/apple-display-brightness -5000" - "CTRL, F2, exec, ~/.local/share/omarchy/bin/apple-display-brightness +5000" - "SHIFT CTRL, F2, exec, ~/.local/share/omarchy/bin/apple-display-brightness +60000" + # Scroll through existing workspaces with mainMod + scroll + "SUPER, mouse_down, workspace, e+1" + "SUPER, mouse_up, workspace, e-1" - # Super workspace floating layer - "SUPER, S, togglespecialworkspace, magic" - "SUPER SHIFT, S, movetoworkspace, special:magic" + # Control Apple Display brightness + "CTRL, F1, exec, ~/.local/share/omarchy/bin/apple-display-brightness -5000" + "CTRL, F2, exec, ~/.local/share/omarchy/bin/apple-display-brightness +5000" + "SHIFT CTRL, F2, exec, ~/.local/share/omarchy/bin/apple-display-brightness +60000" - # Screenshots - ", PRINT, exec, hyprshot -m region" - "SHIFT, PRINT, exec, hyprshot -m window" - "CTRL, PRINT, exec, hyprshot -m output" + # Super workspace floating layer + "SUPER, S, togglespecialworkspace, magic" + "SUPER SHIFT, S, movetoworkspace, special:magic" - # Color picker - "SUPER, PRINT, exec, hyprpicker -a" + # Screenshots + ", PRINT, exec, hyprshot -m region" + "SHIFT, PRINT, exec, hyprshot -m window" + "CTRL, PRINT, exec, hyprshot -m output" - # Clipse - "CTRL SUPER, V, exec, ghostty --class clipse -e clipse" - ]; + # Color picker + "SUPER, PRINT, exec, hyprpicker -a" + + # Clipse + "CTRL SUPER, V, exec, ghostty --class clipse -e clipse" + ]; bindm = [ # Move/resize windows with mainMod + LMB/RMB and dragging diff --git a/modules/home-manager/hyprland/configuration.nix b/modules/home-manager/hyprland/configuration.nix index 084d697..b61a1bc 100644 --- a/modules/home-manager/hyprland/configuration.nix +++ b/modules/home-manager/hyprland/configuration.nix @@ -3,9 +3,11 @@ pkgs, lib, ... -}: let +}: +let cfg = config.omarchy; -in { +in +{ imports = [ ./autostart.nix ./bindings.nix diff --git a/modules/home-manager/hyprland/envs.nix b/modules/home-manager/hyprland/envs.nix index accbe06..234833c 100644 --- a/modules/home-manager/hyprland/envs.nix +++ b/modules/home-manager/hyprland/envs.nix @@ -2,9 +2,10 @@ config, lib, pkgs, - osConfig ? {}, + osConfig ? { }, ... -}: let +}: +let cfg = config.omarchy; hasNvidiaDrivers = builtins.elem "nvidia" osConfig.services.xserver.videoDrivers; nvidiaEnv = [ @@ -12,47 +13,46 @@ "LIBVA_DRIVER_NAME,nvidia" "__GLX_VENDOR_LIBRARY_NAME,nvidia" ]; -in { +in +{ wayland.windowManager.hyprland.settings = { # Environment variables - env = - (lib.optionals hasNvidiaDrivers nvidiaEnv) - ++ [ - "GDK_SCALE,${toString cfg.scale}" + env = (lib.optionals hasNvidiaDrivers nvidiaEnv) ++ [ + "GDK_SCALE,${toString cfg.scale}" - # Cursor size - "XCURSOR_SIZE,24" - "HYPRCURSOR_SIZE,24" + # Cursor size + "XCURSOR_SIZE,24" + "HYPRCURSOR_SIZE,24" - # Cursor theme - "XCURSOR_THEME,Adwaita" - "HYPRCURSOR_THEME,Adwaita" + # Cursor theme + "XCURSOR_THEME,Adwaita" + "HYPRCURSOR_THEME,Adwaita" - # Force all apps to use Wayland - "GDK_BACKEND,wayland" - "QT_QPA_PLATFORM,wayland" - "QT_STYLE_OVERRIDE,kvantum" - "SDL_VIDEODRIVER,wayland" - "MOZ_ENABLE_WAYLAND,1" - "ELECTRON_OZONE_PLATFORM_HINT,wayland" - "OZONE_PLATFORM,wayland" + # Force all apps to use Wayland + "GDK_BACKEND,wayland" + "QT_QPA_PLATFORM,wayland" + "QT_STYLE_OVERRIDE,kvantum" + "SDL_VIDEODRIVER,wayland" + "MOZ_ENABLE_WAYLAND,1" + "ELECTRON_OZONE_PLATFORM_HINT,wayland" + "OZONE_PLATFORM,wayland" - # Make Chromium use XCompose and all Wayland - "CHROMIUM_FLAGS,\"--enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4\"" + # Make Chromium use XCompose and all Wayland + "CHROMIUM_FLAGS,\"--enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4\"" - # Make .desktop files available for wofi - "XDG_DATA_DIRS,$XDG_DATA_DIRS:$HOME/.nix-profile/share:/nix/var/nix/profiles/default/share" + # Make .desktop files available for wofi + "XDG_DATA_DIRS,$XDG_DATA_DIRS:$HOME/.nix-profile/share:/nix/var/nix/profiles/default/share" - # Use XCompose file - "XCOMPOSEFILE,~/.XCompose" - "EDITOR,nvim" - - # GTK theme - "GTK_THEME,${if cfg.theme == "generated_light" then "Adwaita" else "Adwaita:dark"}" + # Use XCompose file + "XCOMPOSEFILE,~/.XCompose" + "EDITOR,nvim" - # Podman compatibility. Probably need to add cfg.env? - # "DOCKER_HOST,unix://$XDG_RUNTIME_DIR/podman/podman.sock" - ]; + # GTK theme + "GTK_THEME,${if cfg.theme == "generated_light" then "Adwaita" else "Adwaita:dark"}" + + # Podman compatibility. Probably need to add cfg.env? + # "DOCKER_HOST,unix://$XDG_RUNTIME_DIR/podman/podman.sock" + ]; xwayland = { force_zero_scaling = true; diff --git a/modules/home-manager/hyprland/input.nix b/modules/home-manager/hyprland/input.nix index b045860..367d65b 100644 --- a/modules/home-manager/hyprland/input.nix +++ b/modules/home-manager/hyprland/input.nix @@ -3,7 +3,8 @@ lib, pkgs, ... -}: { +}: +{ wayland.windowManager.hyprland.settings = { # Environment variables # https://wiki.hyprland.org/Configuring/Variables/#input diff --git a/modules/home-manager/hyprland/looknfeel.nix b/modules/home-manager/hyprland/looknfeel.nix index 3f828ba..a60bcfc 100644 --- a/modules/home-manager/hyprland/looknfeel.nix +++ b/modules/home-manager/hyprland/looknfeel.nix @@ -2,13 +2,18 @@ config, pkgs, ... -}: let - hexToRgba = hex: alpha: let - in "rgba(${hex}${alpha})"; +}: +let + hexToRgba = + hex: alpha: + let + in + "rgba(${hex}${alpha})"; inactiveBorder = hexToRgba config.colorScheme.palette.base09 "aa"; activeBorder = hexToRgba config.colorScheme.palette.base0D "aa"; -in { +in +{ wayland.windowManager.hyprland.settings = { general = { gaps_in = 5; diff --git a/modules/home-manager/hyprland/windows.nix b/modules/home-manager/hyprland/windows.nix index 67a5f8a..de6d909 100644 --- a/modules/home-manager/hyprland/windows.nix +++ b/modules/home-manager/hyprland/windows.nix @@ -2,7 +2,8 @@ config, pkgs, ... -}: { +}: +{ wayland.windowManager.hyprland.settings = { windowrule = [ # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more diff --git a/modules/home-manager/hyprlock.nix b/modules/home-manager/hyprlock.nix index ab40d00..68be0fd 100644 --- a/modules/home-manager/hyprlock.nix +++ b/modules/home-manager/hyprlock.nix @@ -1,9 +1,11 @@ -inputs: { +inputs: +{ config, pkgs, lib, ... -}: let +}: +let palette = config.colorScheme.palette; convert = inputs.nix-colors.lib.conversions.hexToRGBString; selected_wallpaper_path = (import ../../lib/selected-wallpaper.nix config).wallpaper_path; @@ -12,7 +14,8 @@ inputs: { surfaceRgb = "rgb(${convert ", " palette.base02})"; foregroundRgb = "rgb(${convert ", " palette.base05})"; foregroundMutedRgb = "rgb(${convert ", " palette.base04})"; -in { +in +{ programs.hyprlock = { enable = true; settings = { diff --git a/modules/home-manager/hyprpaper.nix b/modules/home-manager/hyprpaper.nix index 6bc55c8..8ea18aa 100644 --- a/modules/home-manager/hyprpaper.nix +++ b/modules/home-manager/hyprpaper.nix @@ -2,9 +2,11 @@ config, pkgs, ... -}: let +}: +let selected_wallpaper_path = (import ../../lib/selected-wallpaper.nix config).wallpaper_path; -in { +in +{ home.file = { "Pictures/Wallpapers" = { source = ../../config/themes/wallpapers; diff --git a/modules/home-manager/mako.nix b/modules/home-manager/mako.nix index 0eda4ce..caadffe 100644 --- a/modules/home-manager/mako.nix +++ b/modules/home-manager/mako.nix @@ -2,9 +2,11 @@ config, pkgs, ... -}: let +}: +let cfg = config.omarchy; -in { +in +{ services.mako = { enable = true; diff --git a/modules/home-manager/starship.nix b/modules/home-manager/starship.nix index bd7d594..a761b6c 100644 --- a/modules/home-manager/starship.nix +++ b/modules/home-manager/starship.nix @@ -1,3 +1,4 @@ -{...}: { +{ ... }: +{ programs.starship.enable = true; } diff --git a/modules/home-manager/vscode.nix b/modules/home-manager/vscode.nix index 0a439ba..eb039ed 100644 --- a/modules/home-manager/vscode.nix +++ b/modules/home-manager/vscode.nix @@ -2,28 +2,31 @@ config, pkgs, ... -}: let +}: +let cfg = config.omarchy; themes = import ../themes.nix; theme = themes.${cfg.theme}; -in { +in +{ programs.vscode = { enable = true; profiles.default = { - # This is actually turning out to be super annoying whenever I need + # This is actually turning out to be super annoying whenever I need # to change settings on the fly. Disabling until I have time to research. # In the meantime themes are broken # userSettings = - # { - # "workbench.colorTheme" = theme.vscode-theme; - # "vim.useCtrlKeys" = false; - # "editor.minimap.enabled" = false; - # } - - # // cfg.vscode_settings; + # { + # "workbench.colorTheme" = theme.vscode-theme; + # "vim.useCtrlKeys" = false; + # "editor.minimap.enabled" = false; + # } - extensions = with pkgs.vscode-extensions; + # // cfg.vscode_settings; + + extensions = + with pkgs.vscode-extensions; [ bbenoist.nix vscodevim.vim diff --git a/modules/home-manager/waybar.nix b/modules/home-manager/waybar.nix index ee4141c..c18f862 100644 --- a/modules/home-manager/waybar.nix +++ b/modules/home-manager/waybar.nix @@ -1,13 +1,16 @@ -inputs: { +inputs: +{ config, pkgs, ... -}: let +}: +let palette = config.colorScheme.palette; convert = inputs.nix-colors.lib.conversions.hexToRGBString; backgroundRgb = "rgb(${convert ", " palette.base00})"; foregroundRgb = "rgb(${convert ", " palette.base05})"; -in { +in +{ home.file = { ".config/waybar/" = { source = ../../config/waybar; @@ -68,11 +71,11 @@ in { active = "󱓻"; }; persistent-workspaces = { - "1" = []; - "2" = []; - "3" = []; - "4" = []; - "5" = []; + "1" = [ ]; + "2" = [ ]; + "3" = [ ]; + "4" = [ ]; + "5" = [ ]; }; }; cpu = { @@ -86,7 +89,13 @@ in { tooltip = false; }; network = { - format-icons = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"]; + format-icons = [ + "󰤯" + "󰤟" + "󰤢" + "󰤥" + "󰤨" + ]; format = "{icon}"; format-wifi = "{icon}"; format-ethernet = "󰀂"; @@ -155,7 +164,9 @@ in { on-click-right = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; # Updated command max-volume = 150; # Optional: allow volume over 100% }; - tray = {spacing = 13;}; + tray = { + spacing = 13; + }; power-profiles-daemon = { format = "{icon}"; tooltip-format = "Power profile: {profile}"; diff --git a/modules/home-manager/wofi.nix b/modules/home-manager/wofi.nix index 2d10f66..0d7317a 100644 --- a/modules/home-manager/wofi.nix +++ b/modules/home-manager/wofi.nix @@ -2,7 +2,8 @@ config, pkgs, ... -}: { +}: +{ home.file = { ".config/wofi/style.css" = { text = '' diff --git a/modules/home-manager/zoxide.nix b/modules/home-manager/zoxide.nix index f59d5d6..6c395cd 100644 --- a/modules/home-manager/zoxide.nix +++ b/modules/home-manager/zoxide.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ programs.zoxide = { enable = true; enableZshIntegration = true; diff --git a/modules/home-manager/zsh.nix b/modules/home-manager/zsh.nix index cf00090..3e7d1ac 100644 --- a/modules/home-manager/zsh.nix +++ b/modules/home-manager/zsh.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ programs.zsh = { enable = true; autosuggestion.enable = true; @@ -7,11 +8,11 @@ plugins = [ { name = "plugins/git"; - tags = [from:oh-my-zsh]; + tags = [ "from:oh-my-zsh" ]; } { name = "fdellwing/zsh-bat"; - tags = [as:command]; + tags = [ "as:command" ]; } ]; }; diff --git a/modules/nixos/1password.nix b/modules/nixos/1password.nix index 3203acd..54cc2ed 100644 --- a/modules/nixos/1password.nix +++ b/modules/nixos/1password.nix @@ -1,9 +1,10 @@ -{...}: { +{ ... }: +{ programs = { _1password.enable = true; _1password-gui.enable = true; # TODO: Dynamically get user names - _1password-gui.polkitPolicyOwners = ["henry"]; + _1password-gui.polkitPolicyOwners = [ "henry" ]; }; } diff --git a/modules/nixos/containers.nix b/modules/nixos/containers.nix index 45bc1de..dc93622 100644 --- a/modules/nixos/containers.nix +++ b/modules/nixos/containers.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ virtualisation.containers.enable = true; virtualisation = { docker.enable = true; diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index e18960d..45c8184 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -1,11 +1,14 @@ -inputs: { +inputs: +{ config, pkgs, ... -}: let +}: +let cfg = config.omarchy; - packages = import ../packages.nix {inherit pkgs;}; -in { + packages = import ../packages.nix { inherit pkgs; }; +in +{ imports = [ (import ./hyprland.nix inputs) (import ./system.nix) diff --git a/modules/nixos/hyprland.nix b/modules/nixos/hyprland.nix index 55347f5..b2f2db7 100644 --- a/modules/nixos/hyprland.nix +++ b/modules/nixos/hyprland.nix @@ -1,8 +1,10 @@ -inputs: { +inputs: +{ config, pkgs, ... -}: { +}: +{ programs.hyprland = { enable = true; # package = inputs.hyprland.packages.${pkgs.system}.hyprland; diff --git a/modules/nixos/system.nix b/modules/nixos/system.nix index 09b0cd0..58b2280 100644 --- a/modules/nixos/system.nix +++ b/modules/nixos/system.nix @@ -3,10 +3,15 @@ pkgs, lib, ... -}: let +}: +let cfg = config.omarchy; - packages = import ../packages.nix {inherit pkgs lib; exclude_packages = cfg.exclude_packages;}; -in { + packages = import ../packages.nix { + inherit pkgs lib; + exclude_packages = cfg.exclude_packages; + }; +in +{ security.rtkit.enable = true; services.pulseaudio.enable = false; services.pipewire = { diff --git a/modules/packages.nix b/modules/packages.nix index 17bb09d..81a210a 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -1,4 +1,8 @@ -{pkgs, lib, exclude_packages ? []}: +{ + pkgs, + lib, + exclude_packages ? [ ], +}: let # Essential Hyprland packages - cannot be excluded hyprlandPackages = with pkgs; [ @@ -33,37 +37,41 @@ let ]; # Discretionary packages - can be excluded by user - discretionaryPackages = with pkgs; [ - # TUIs - lazygit - lazydocker - btop - powertop - fastfetch + discretionaryPackages = + with pkgs; + [ + # TUIs + lazygit + lazydocker + btop + powertop + fastfetch - # GUIs - chromium - obsidian - vlc - signal-desktop + # GUIs + chromium + obsidian + vlc + signal-desktop - # Development tools - github-desktop - gh + # Development tools + github-desktop + gh - # Containers - docker-compose - ffmpeg - ] ++ lib.optionals (pkgs.system == "x86_64-linux") [ - typora - dropbox - spotify - ]; + # Containers + docker-compose + ffmpeg + ] + ++ lib.optionals (pkgs.system == "x86_64-linux") [ + typora + dropbox + spotify + ]; # Only allow excluding discretionary packages to prevent breaking the system filteredDiscretionaryPackages = lib.lists.subtractLists exclude_packages discretionaryPackages; allSystemPackages = hyprlandPackages ++ systemPackages ++ filteredDiscretionaryPackages; -in { +in +{ # Regular packages systemPackages = allSystemPackages; diff --git a/modules/themes.nix b/modules/themes.nix index acb797b..dcf163e 100644 --- a/modules/themes.nix +++ b/modules/themes.nix @@ -29,7 +29,7 @@ base16-theme = "gruvbox-light-medium"; vscode-theme = "Gruvbox Light Medium"; }; - + "custom" = { # Custom themes don't have predefined base16 schemes (generated dynamically) # VSCode theme fallback for custom color schemes