diff --git a/common/_home_manager/default.nix b/common/_home_manager/default.nix index 5b76221..de3d9b7 100644 --- a/common/_home_manager/default.nix +++ b/common/_home_manager/default.nix @@ -1,6 +1,8 @@ { config, lib, + hyprland, + hyprlandPkgs, ... }: let @@ -33,6 +35,10 @@ in home-manager.useGlobalPkgs = true; home-manager.backupFileExtension = "bak"; + home-manager.extraSpecialArgs = { + inherit hyprland hyprlandPkgs; + }; + home-manager.users = lib.mapAttrs' (name: userConfig: { inherit name; value = userConfig // { diff --git a/common/_home_manager/mods/foot.nix b/common/_home_manager/mods/foot.nix new file mode 100644 index 0000000..c62f515 --- /dev/null +++ b/common/_home_manager/mods/foot.nix @@ -0,0 +1,56 @@ +{ config, lib, ... }: +{ + options.components.foot = { + font_size = lib.mkOption { + type = lib.types.float; + default = 12.0; + description = "Font size for Foot terminal"; + }; + }; + config = { + programs.foot = { + enable = true; + + # This renders to ~/.config/foot/foot.ini + settings = { + main = { + # Use the same font and size as your Kitty config + font = "JetBrainsMonoNL Nerd Font:size=${toString config.components.kitty.font_size}"; + + # Initial window size in character cells (Kitty used 160c x 55c) + "initial-window-size-chars" = "160x55"; + }; + + colors = { + # Background opacity (1.0 = opaque) + alpha = "1.0"; + + # Foreground/background + foreground = "e0e0e0"; + background = "262626"; + + # 16-color palette + # normal (0–7) + regular0 = "1f1f1f"; # black + regular1 = "f38ba8"; # red + regular2 = "a6e3a1"; # green + regular3 = "f9e2af"; # yellow + regular4 = "89b4fa"; # blue + regular5 = "cba6f7"; # magenta + regular6 = "89dceb"; # cyan + regular7 = "e0e0e0"; # white + + # bright (8–15) + bright0 = "565656"; # bright black + bright1 = "f38ba8"; # bright red + bright2 = "a6e3a1"; # bright green + bright3 = "f9e2af"; # bright yellow + bright4 = "89b4fa"; # bright blue + bright5 = "cba6f7"; # bright magenta + bright6 = "89dceb"; # bright cyan + bright7 = "ffffff"; # bright white + }; + }; + }; + }; +} diff --git a/common/desktop_environment/gnome/default.nix b/common/desktop_environment/gnome/default.nix index c963672..0f62964 100644 --- a/common/desktop_environment/gnome/default.nix +++ b/common/desktop_environment/gnome/default.nix @@ -59,7 +59,7 @@ with lib; gnome-tweaks wayland wayland-utils - xwayland + # xwayland wl-clipboard numix-cursor-theme gnomeExtensions.vertical-workspaces diff --git a/common/desktop_environment/hyprland/default.nix b/common/desktop_environment/hyprland/default.nix index d82290c..7a60391 100644 --- a/common/desktop_environment/hyprland/default.nix +++ b/common/desktop_environment/hyprland/default.nix @@ -2,6 +2,8 @@ config, lib, pkgs, + hyprland, + hyprlandPkgs, ... }: let @@ -21,7 +23,7 @@ with lib; enable = lib.mkEnableOption "hyprland desktop environment"; terminalCommand = mkOption { type = lib.types.str; - default = "kitty"; + default = "foot"; description = "The terminal command to use."; }; extraOptions = mkOption { @@ -41,16 +43,18 @@ with lib; # Enable for all users home-manager = { sharedModules = [ + hyprland.homeManagerModules.default ./home_manager ]; }; - # Display Manager - services = { - displayManager = { - sddm = { - enable = true; - wayland.enable = true; + services.greetd = { + enable = true; + vt = 2; + settings = { + default_session = { + command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --remember --remember-session --cmd '${pkgs.dbus}/bin/dbus-run-session ${hyprlandPkgs.hyprland}/bin/Hyprland'"; + user = "greeter"; }; }; }; @@ -61,7 +65,6 @@ with lib; layout = "us"; options = "caps:escape"; }; - hardware.graphics.enable = true; environment.systemPackages = with pkgs; [ wl-clipboard @@ -76,6 +79,9 @@ with lib; libgtop # system monitor library bluez # Bluetooth support power-profiles-daemon # power profiles + grim + slurp + hyprpicker grimblast # screenshot tool wf-recorder # screen recording tool btop # system monitor @@ -85,8 +91,21 @@ with lib; programs.hyprland = { enable = true; - xwayland.enable = true; + # xwayland.enable = true; withUWSM = true; + + # set the flake package + package = hyprlandPkgs.hyprland; + # make sure to also set the portal package, so that they are in sync + portalPackage = hyprlandPkgs.xdg-desktop-portal-hyprland; + }; + + hardware.graphics = { + enable = true; + package = hyprlandPkgs.mesa; + # if you also want 32-bit support (e.g for Steam) + # enable32Bit = true; + package32 = hyprlandPkgs.pkgsi686Linux.mesa; }; # Environment variables @@ -97,6 +116,8 @@ with lib; XDG_CURRENT_DESKTOP = "Hyprland"; XDG_SESSION_DESKTOP = "Hyprland"; ELECTRON_OZONE_PLATFORM_HINT = "wayland"; + CLUTTER_BACKEND = "wayland"; + WLR_RENDERER = "vulkan"; }; # Qt theming diff --git a/common/desktop_environment/hyprland/home_manager/hyprland.nix b/common/desktop_environment/hyprland/home_manager/hyprland.nix index 118b1a3..13929e6 100644 --- a/common/desktop_environment/hyprland/home_manager/hyprland.nix +++ b/common/desktop_environment/hyprland/home_manager/hyprland.nix @@ -1,7 +1,7 @@ { osConfig, lib, - pkgs, + hyprlandPkgs, ... }: let @@ -16,22 +16,19 @@ in { wayland.windowManager.hyprland = { enable = true; - # set the Hyprland and XDPH packages to null to use the ones from the NixOS module - package = null; - portalPackage = null; - - plugins = with pkgs.hyprlandPlugins; [ + plugins = with hyprlandPkgs.hyprlandPlugins; [ hyprspace ]; settings = lib.attrsets.recursiveUpdate { - # TODO determine if need to keep - env = [ "XWAYLAND_NO_GLAMOR,1" ]; + # Debug logs enabled when this is uncommented + "debug:disable_logs" = false; # Default monitor configuration monitor = "monitor = , preferred, auto, 1"; windowrulev2 = [ + # Bitwarden password manager popup for chrome, always float it "float, class:^(?i)chrome-nngceckbapebfimnlniiiahkandclblb-Default$, initialtitle:^_crx_nngceckbapebfimnlniiiahkandclblb$" "center, class:^(?i)chrome-nngceckbapebfimnlniiiahkandclblb-Default$, initialtitle:^_crx_nngceckbapebfimnlniiiahkandclblb$" "size 720 600, class:^(?i)chrome-nngceckbapebfimnlniiiahkandclblb-Default$, initialtitle:^_crx_nngceckbapebfimnlniiiahkandclblb$" @@ -91,6 +88,7 @@ in "$mainMod, Return, exec, ${cfg.terminalCommand}" "$mainMod, Space, exec, pkill wofi || wofi --show drun" "$mainMod, q, killactive" + "$mainMod SHIFT, escape, exit" "$mainMod SHIFT, q, exec, swaylock" "$mainMod, f, togglefloating" "$mainMod, g, pseudo" diff --git a/common/flake.lock b/common/flake.lock index a1d6c11..77b5f3c 100644 --- a/common/flake.lock +++ b/common/flake.lock @@ -8,7 +8,7 @@ "ragenix", "nixpkgs" ], - "systems": "systems" + "systems": "systems_2" }, "locked": { "lastModified": 1736955230, @@ -24,6 +24,39 @@ "type": "github" } }, + "aquamarine": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1755946532, + "narHash": "sha256-POePremlUY5GyA1zfbtic6XLxDaQcqHN6l+bIxdT5gc=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "81584dae2df6ac79f6b6dae0ecb7705e95129ada", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, "crane": { "locked": { "lastModified": 1741481578, @@ -62,9 +95,25 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1731533236, @@ -80,16 +129,38 @@ "type": "github" } }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "hyprland", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1755928099, - "narHash": "sha256-OILVkfhRCm8u18IZ2DKR8gz8CVZM2ZcJmQBXmjFLIfk=", + "lastModified": 1756245065, + "narHash": "sha256-aAZNbGcWrVRZgWgkQbkabSGcDVRDMgON4BipMy69gvI=", "owner": "rycee", "repo": "home-manager", - "rev": "4a44fb9f7555da362af9d499817084f4288a957f", + "rev": "54b2879ce622d44415e727905925e21b8f833a98", "type": "github" }, "original": { @@ -121,6 +192,265 @@ "type": "github" } }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1753964049, + "narHash": "sha256-lIqabfBY7z/OANxHoPeIrDJrFyYy9jAM4GQLzZ2feCM=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "44e91d467bdad8dcf8bbd2ac7cf49972540980a5", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprgraphics": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1755678602, + "narHash": "sha256-uEC5O/NIUNs1zmc1aH1+G3GRACbODjk2iS0ET5hXtuk=", + "owner": "hyprwm", + "repo": "hyprgraphics", + "rev": "157cc52065a104fc3b8fa542ae648b992421d1c7", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprgraphics", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "aquamarine": "aquamarine", + "hyprcursor": "hyprcursor", + "hyprgraphics": "hyprgraphics", + "hyprland-protocols": "hyprland-protocols", + "hyprland-qtutils": "hyprland-qtutils", + "hyprlang": "hyprlang", + "hyprutils": "hyprutils", + "hyprwayland-scanner": "hyprwayland-scanner", + "nixpkgs": "nixpkgs_2", + "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1756498600, + "narHash": "sha256-09FSU9GTVyDlTcXjsjzumfUkIJUwht1DESNh41kufdc=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "ea42041f936d5810c5cfa45d6bece12dde2fd9b6", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1749046714, + "narHash": "sha256-kymV5FMnddYGI+UjwIw8ceDjdeg7ToDVjbHCvUlhn14=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "613878cb6f459c5e323aaafe1e6f388ac8a36330", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprland-qt-support": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprland-qtutils", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "hyprland-qtutils", + "nixpkgs" + ], + "systems": [ + "hyprland", + "hyprland-qtutils", + "systems" + ] + }, + "locked": { + "lastModified": 1749154592, + "narHash": "sha256-DO7z5CeT/ddSGDEnK9mAXm1qlGL47L3VAHLlLXoCjhE=", + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "rev": "4c8053c3c888138a30c3a6c45c2e45f5484f2074", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "type": "github" + } + }, + "hyprland-qtutils": { + "inputs": { + "hyprland-qt-support": "hyprland-qt-support", + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprland", + "hyprland-qtutils", + "hyprlang", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1753819801, + "narHash": "sha256-tHe6XeNeVeKapkNM3tcjW4RuD+tB2iwwoogWJOtsqTI=", + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "rev": "b308a818b9dcaa7ab8ccab891c1b84ebde2152bc", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1753622892, + "narHash": "sha256-0K+A+gmOI8IklSg5It1nyRNv0kCNL51duwnhUO/B8JA=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "23f0debd2003f17bd65f851cd3f930cff8a8c809", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprutils": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1756117388, + "narHash": "sha256-oRDel6pNl/T2tI+nc/USU9ZP9w08dxtl7hiZxa0C/Wc=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "b2ae3204845f5f2f79b4703b441252d8ad2ecfd0", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1755184602, + "narHash": "sha256-RCBQN8xuADB0LEgaKbfRqwm6CdyopE1xIEhNc67FAbw=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "b3b0f1f40ae09d4447c20608e5a4faf8bf3c492d", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, "nix-flatpak": { "locked": { "lastModified": 1739444422, @@ -153,7 +483,39 @@ "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1756542300, + "narHash": "sha256-tlOn88coG5fzdyqz6R93SQL5Gpq+m/DsWpekNFhqPQk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d7600c775f877cd87b4f5a831c28aa94137377aa", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { + "locked": { + "lastModified": 1756266583, + "narHash": "sha256-cr748nSmpfvnhqSXPiCfUPxRz2FJnvf/RjJGvFfaCsM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8a6d5427d99ec71c64f0b93d45778c889005d9c2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1741379970, "narHash": "sha256-Wh7esNh7G24qYleLvgOSY/7HlDUzWaL/n4qzlBePpiw=", @@ -169,12 +531,35 @@ "type": "github" } }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1755960406, + "narHash": "sha256-RF7j6C1TmSTK9tYWO6CdEMtg6XZaUKcvZwOCD2SICZs=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "e891a93b193fcaf2fc8012d890dc7f0befe86ec2", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "ragenix": { "inputs": { "agenix": "agenix", "crane": "crane", "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "rust-overlay": "rust-overlay" }, "locked": { @@ -194,7 +579,9 @@ "root": { "inputs": { "home-manager": "home-manager", + "hyprland": "hyprland", "nix-flatpak": "nix-flatpak", + "nixpkgs-unstable": "nixpkgs-unstable", "ragenix": "ragenix" } }, @@ -221,16 +608,16 @@ }, "systems": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default", + "repo": "default-linux", "type": "github" } }, @@ -248,6 +635,62 @@ "repo": "default", "type": "github" } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1755354946, + "narHash": "sha256-zdov5f/GcoLQc9qYIS1dUTqtJMeDqmBmo59PAxze6e4=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "a10726d6a8d0ef1a0c645378f983b6278c42eaa0", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } } }, "root": "root", diff --git a/common/flake.nix b/common/flake.nix index 03352ab..c0e87e8 100644 --- a/common/flake.nix +++ b/common/flake.nix @@ -4,6 +4,8 @@ home-manager.url = "github:rycee/home-manager/release-25.05"; ragenix.url = "github:yaxitech/ragenix"; nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=latest"; + + hyprland.url = "github:hyprwm/Hyprland"; }; outputs = @@ -11,6 +13,7 @@ home-manager, ragenix, nix-flatpak, + hyprland, ... }: { @@ -19,13 +22,15 @@ { config, lib, + pkgs, ... }: { imports = [ - home-manager.nixosModules.home-manager + home-manager.nixosModules.default ragenix.nixosModules.age nix-flatpak.nixosModules.nix-flatpak + hyprland.nixosModules.default ./_home_manager ./options.nix ./general @@ -36,17 +41,28 @@ ./secrets ]; config = { + nixpkgs.overlays = [ + # (final: prev: { + # wayland-protocols = + # nixpkgs-unstable.legacyPackages.${prev.stdenv.hostPlatform.system}.wayland-protocols; + # }) + ]; _module.args = { - inherit ragenix; + inherit ragenix hyprland; + hyprlandPkgs = import hyprland.inputs.nixpkgs { + system = pkgs.stdenv.hostPlatform.system; + config = config.nixpkgs.config or { }; + }; }; }; }; containers = { forgejo = import ./_containers/forgejo.nix; - # obsidian_sync = import ./_containers/obsidian_sync.nix; }; }; homeManagerModules = { + hyprland = hyprland.homeManagerModules.default; + zsh = import ./_home_manager/mods/zsh.nix; tmux = import ./_home_manager/mods/tmux/tmux.nix; atuin = import ./_home_manager/mods/atuin.nix; @@ -57,6 +73,8 @@ git = import ./_home_manager/mods/git.nix; nix_deprecations = import ./_home_manager/mods/nix_deprecations.nix; + alacritty = import ./_home_manager/mods/alacritty.nix; + foot = import ./_home_manager/mods/foot.nix; kitty = import ./_home_manager/mods/kitty.nix; launcher_rofi = import ./_home_manager/mods/launcher_rofi.nix; @@ -64,7 +82,6 @@ postgres = import ./_home_manager/mods/postgres.nix; slicer = import ./_home_manager/mods/slicer.nix; - alacritty = import ./_home_manager/mods/alacritty.nix; }; }; } diff --git a/common/general/default.nix b/common/general/default.nix index 7e35e0b..49e8900 100644 --- a/common/general/default.nix +++ b/common/general/default.nix @@ -52,6 +52,7 @@ in description = "Fast shutdown"; }; enableSleep = lib.mkEnableOption (lib.mdDoc "Enable auto sleeping"); + hideBootLogs = lib.mkEnableOption (lib.mdDoc "Hide boot logs on startup"); }; imports = [ ./shell/common.nix @@ -111,11 +112,14 @@ in "https://cache.nixos.org/" "https://hyprland.cachix.org" "https://cosmic.cachix.org/" + "https://nix-community.cachix.org" ]; + trusted-substituters = config.nix.settings.substituters; trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; }; nix.extraOptions = '' @@ -194,5 +198,14 @@ in AllowSuspendThenHibernate=no AllowHybridSleep=no ''; + + # Hide boot logs + boot.initrd.verbose = cfg.hideBootLogs; + boot.consoleLogLevel = lib.mkIf cfg.hideBootLogs 3; + boot.kernelParams = lib.mkIf cfg.hideBootLogs [ + "quiet" + "loglevel=3" + "systemd.show_status=false" + ]; }; } diff --git a/hosts/lio/configuration.nix b/hosts/lio/configuration.nix index 2d3d8ad..98c9408 100644 --- a/hosts/lio/configuration.nix +++ b/hosts/lio/configuration.nix @@ -2,20 +2,11 @@ ... }: { - # opening this port for dev purposes - networking.firewall.allowedTCPPorts = [ - 5173 # Vite - ]; - - # machine specific configuration - # ============================== hardware.enableAllFirmware = true; + # Connectivity networking.networkmanager.enable = true; hardware.bluetooth.enable = true; - environment.shellAliases = { - wifi = "nmtui"; - }; # System76 hardware.system76.enableAll = true; diff --git a/hosts/lio/flake.lock b/hosts/lio/flake.lock index 21036a3..c264cea 100644 --- a/hosts/lio/flake.lock +++ b/hosts/lio/flake.lock @@ -9,7 +9,7 @@ "ragenix", "nixpkgs" ], - "systems": "systems" + "systems": "systems_2" }, "locked": { "lastModified": 1736955230, @@ -25,10 +25,51 @@ "type": "github" } }, + "aquamarine": { + "inputs": { + "hyprutils": [ + "common", + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "common", + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1755946532, + "narHash": "sha256-POePremlUY5GyA1zfbtic6XLxDaQcqHN6l+bIxdT5gc=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "81584dae2df6ac79f6b6dae0ecb7705e95129ada", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, "common": { "inputs": { "home-manager": "home-manager", + "hyprland": "hyprland", "nix-flatpak": "nix-flatpak", + "nixpkgs-unstable": [ + "nixpkgs-unstable" + ], "ragenix": "ragenix" }, "locked": { @@ -80,9 +121,25 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1731533236, @@ -98,16 +155,39 @@ "type": "github" } }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "common", + "hyprland", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1753592768, - "narHash": "sha256-oV695RvbAE4+R9pcsT9shmp6zE/+IZe6evHWX63f2Qg=", + "lastModified": 1756245065, + "narHash": "sha256-aAZNbGcWrVRZgWgkQbkabSGcDVRDMgON4BipMy69gvI=", "owner": "rycee", "repo": "home-manager", - "rev": "fc3add429f21450359369af74c2375cb34a2d204", + "rev": "54b2879ce622d44415e727905925e21b8f833a98", "type": "github" }, "original": { @@ -140,6 +220,287 @@ "type": "github" } }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "common", + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1753964049, + "narHash": "sha256-lIqabfBY7z/OANxHoPeIrDJrFyYy9jAM4GQLzZ2feCM=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "44e91d467bdad8dcf8bbd2ac7cf49972540980a5", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprgraphics": { + "inputs": { + "hyprutils": [ + "common", + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1755678602, + "narHash": "sha256-uEC5O/NIUNs1zmc1aH1+G3GRACbODjk2iS0ET5hXtuk=", + "owner": "hyprwm", + "repo": "hyprgraphics", + "rev": "157cc52065a104fc3b8fa542ae648b992421d1c7", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprgraphics", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "aquamarine": "aquamarine", + "hyprcursor": "hyprcursor", + "hyprgraphics": "hyprgraphics", + "hyprland-protocols": "hyprland-protocols", + "hyprland-qtutils": "hyprland-qtutils", + "hyprlang": "hyprlang", + "hyprutils": "hyprutils", + "hyprwayland-scanner": "hyprwayland-scanner", + "nixpkgs": "nixpkgs_2", + "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1756498600, + "narHash": "sha256-09FSU9GTVyDlTcXjsjzumfUkIJUwht1DESNh41kufdc=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "ea42041f936d5810c5cfa45d6bece12dde2fd9b6", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1749046714, + "narHash": "sha256-kymV5FMnddYGI+UjwIw8ceDjdeg7ToDVjbHCvUlhn14=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "613878cb6f459c5e323aaafe1e6f388ac8a36330", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprland-qt-support": { + "inputs": { + "hyprlang": [ + "common", + "hyprland", + "hyprland-qtutils", + "hyprlang" + ], + "nixpkgs": [ + "common", + "hyprland", + "hyprland-qtutils", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "hyprland-qtutils", + "systems" + ] + }, + "locked": { + "lastModified": 1749154592, + "narHash": "sha256-DO7z5CeT/ddSGDEnK9mAXm1qlGL47L3VAHLlLXoCjhE=", + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "rev": "4c8053c3c888138a30c3a6c45c2e45f5484f2074", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "type": "github" + } + }, + "hyprland-qtutils": { + "inputs": { + "hyprland-qt-support": "hyprland-qt-support", + "hyprlang": [ + "common", + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "common", + "hyprland", + "hyprland-qtutils", + "hyprlang", + "hyprutils" + ], + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1753819801, + "narHash": "sha256-tHe6XeNeVeKapkNM3tcjW4RuD+tB2iwwoogWJOtsqTI=", + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "rev": "b308a818b9dcaa7ab8ccab891c1b84ebde2152bc", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": [ + "common", + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1753622892, + "narHash": "sha256-0K+A+gmOI8IklSg5It1nyRNv0kCNL51duwnhUO/B8JA=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "23f0debd2003f17bd65f851cd3f930cff8a8c809", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprutils": { + "inputs": { + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1756117388, + "narHash": "sha256-oRDel6pNl/T2tI+nc/USU9ZP9w08dxtl7hiZxa0C/Wc=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "b2ae3204845f5f2f79b4703b441252d8ad2ecfd0", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1755184602, + "narHash": "sha256-RCBQN8xuADB0LEgaKbfRqwm6CdyopE1xIEhNc67FAbw=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "b3b0f1f40ae09d4447c20608e5a4faf8bf3c492d", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, "nix-flatpak": { "locked": { "lastModified": 1739444422, @@ -189,6 +550,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1756266583, + "narHash": "sha256-cr748nSmpfvnhqSXPiCfUPxRz2FJnvf/RjJGvFfaCsM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8a6d5427d99ec71c64f0b93d45778c889005d9c2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1741379970, "narHash": "sha256-Wh7esNh7G24qYleLvgOSY/7HlDUzWaL/n4qzlBePpiw=", @@ -204,7 +581,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1755471983, "narHash": "sha256-axUoWcm4cNQ36jOlnkD9D40LTfSQgk8ExfHSRm3rTtg=", @@ -220,7 +597,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1755648324, "narHash": "sha256-+2TxwJEXWXGC7JBsRGUHtmQ66lRGPcDI2kFKTTU5e2s=", @@ -1115,12 +1492,36 @@ "type": "github" } }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1755960406, + "narHash": "sha256-RF7j6C1TmSTK9tYWO6CdEMtg6XZaUKcvZwOCD2SICZs=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "e891a93b193fcaf2fc8012d890dc7f0befe86ec2", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "ragenix": { "inputs": { "agenix": "agenix", "crane": "crane", "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "rust-overlay": "rust-overlay" }, "locked": { @@ -1140,14 +1541,14 @@ "root": { "inputs": { "common": "common", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "nixpkgs-unstable": "nixpkgs-unstable", "ros_neovim": "ros_neovim" } }, "ros_neovim": { "inputs": { - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "nvim_plugin-Almo7aya/openingh.nvim": "nvim_plugin-Almo7aya/openingh.nvim", "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim": "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim", "nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring": "nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring", @@ -1264,16 +1665,16 @@ }, "systems": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default", + "repo": "default-linux", "type": "github" } }, @@ -1291,6 +1692,68 @@ "repo": "default", "type": "github" } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "common", + "hyprland", + "hyprland-protocols" + ], + "hyprlang": [ + "common", + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "common", + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "common", + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1755354946, + "narHash": "sha256-zdov5f/GcoLQc9qYIS1dUTqtJMeDqmBmo59PAxze6e4=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "a10726d6a8d0ef1a0c645378f983b6278c42eaa0", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } } }, "root": "root", diff --git a/hosts/lio/flake.nix b/hosts/lio/flake.nix index da4c900..42da64a 100644 --- a/hosts/lio/flake.nix +++ b/hosts/lio/flake.nix @@ -6,6 +6,7 @@ # Use relative to get current version for testing common.url = "path:../../common"; # common.url = "git+https://git.joshuabell.xyz/ringofstorms/dotfiles"; + common.inputs.nixpkgs-unstable.follows = "nixpkgs-unstable"; ros_neovim.url = "git+https://git.joshuabell.xyz/ringofstorms/nvim"; }; @@ -73,6 +74,7 @@ ffmpeg-full appimage-run nodejs_24 + foot ]; # Also allow this key to work for root user, this will let us use this as a remote builder easier users.users.root.openssh.authorizedKeys.keys = [ @@ -106,7 +108,7 @@ tailnet.enable = true; tailnet.enableExitNode = true; ssh.enable = true; - # docker.enable = true; + # docker.enable = true; # TODO use podman instead virt-manager.enable = true; flatpaks = { enable = true; @@ -152,6 +154,7 @@ tmux atuin kitty + foot direnv git nix_deprecations diff --git a/hosts/lio/hyprland_customizations.nix b/hosts/lio/hyprland_customizations.nix index f0d5d8b..5af2228 100644 --- a/hosts/lio/hyprland_customizations.nix +++ b/hosts/lio/hyprland_customizations.nix @@ -8,17 +8,22 @@ let secondaryMonitor = "desc:${secondaryDesc}"; hyprlandExtraOptions = { + exec-once = [ + # Wait a moment for monitors/workspaces to settle, then "prime" 6 and return to 1 + "sh -lc 'sleep 0.2; hyprctl dispatch workspace 7; sleep 0.02; hyprctl dispatch workspace 1'" + + ]; monitor = [ "${mainMonitor},3840x2160@97.98,0x0,1,transform,0" "${secondaryMonitor},3440x1440@99.98,-1440x-640,1,transform,1" ]; - # workspace = - # let - # inherit (builtins) map toString; - # inherit (lib) range; - # mkWs = monitor: i: "${toString i},persistent:true"; - # in - # (map (mkWs mainMonitor) (range 1 6)) ++ (map (mkWs secondaryMonitor) (range 7 10)); + workspace = + let + inherit (builtins) map toString; + inherit (lib) range; + mkWs = monitor: i: "${toString i},monitor:${monitor},persistent:true"; + in + (map (mkWs mainMonitor) (range 1 6)) ++ (map (mkWs secondaryMonitor) (range 7 10)); }; moveScript = pkgs.writeShellScriptBin "hyprland-move-workspaces" '' @@ -120,9 +125,14 @@ in # User-level systemd service that follows your Hyprland session and watches for monitor changes systemd.user.services.hyprland-move-workspaces = { description = "Keep workspaces 1–6 on main and 7–10 on secondary; react to monitor changes"; - wants = [ "graphical-session.target" ]; - after = [ "graphical-session.target" ]; - partOf = [ "graphical-session.target" ]; + + # Start/stop with Hyprland specifically + wantedBy = [ "hyprland-session.target" ]; + after = [ "hyprland-session.target" ]; + partOf = [ "hyprland-session.target" ]; + bindsTo = [ "hyprland-session.target" ]; + # Only start once Hyprland's event socket exists + unitConfig.ConditionPathExistsGlob = "%t/hypr/*/.socket2.sock"; serviceConfig = { Type = "simple";