diff --git a/flake.nix b/flake.nix index 1ab631f..f05e8d4 100644 --- a/flake.nix +++ b/flake.nix @@ -23,6 +23,12 @@ url = "github:wez/wezterm/main?dir=nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; + hyprpaper.url = "github:hyprwm/hyprpaper"; + hyprland-contrib = { + url = "github:hyprwm/contrib"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nixos-hardware.url = "github:NixOS/nixos-hardware"; }; @@ -30,7 +36,6 @@ let username = "nezia"; system = "x86_64-linux"; - commonModules = hostname: [ ./modules ./hosts/common @@ -47,7 +52,7 @@ ]; home-manager.extraSpecialArgs = { inherit inputs; }; } - { _module.args = { inherit hostname username; }; } + { _module.args = { inherit hostname username inputs; }; } ]; configureSystem = hostname: homeConfig: nixpkgs.lib.nixosSystem { diff --git a/home/laptop/default.nix b/home/laptop/default.nix index ba12cd3..3192cbc 100644 --- a/home/laptop/default.nix +++ b/home/laptop/default.nix @@ -2,5 +2,6 @@ _: { imports = [ ../common + ./hyprland ]; } diff --git a/home/laptop/hyprland/default.nix b/home/laptop/hyprland/default.nix new file mode 100644 index 0000000..f554c69 --- /dev/null +++ b/home/laptop/hyprland/default.nix @@ -0,0 +1,56 @@ +{ inputs, pkgs, ... }: +{ + wayland.windowManager.hyprland = { + enable = true; + package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; + settings = { + "$mod" = "SUPER"; + "$terminal" = "wezterm"; + "$menu" = "fuzzel"; + "monitor" = "eDP-1, 2256x1504@60, 0x0, 1.5"; + input.touchpad.natural_scroll = true; + gestures.workspace_swipe = true; + xwayland.force_zero_scaling = true; + bind = + [ + "$mod, Return, exec, $terminal" + "$mod, R, exec, $menu" + "$mod, F, exec, firefox" + "$mod, Q, killactive" + "$mod, M, exit" + "$mod, H, movefocus, l" + "$mod, L, movefocus, r" + "$mod, K, movefocus, u" + "$mod, J, movefocus, d" + ", Print, exec, grimblast copy area" + ] + ++ ( + # workspaces + # binds $mod + [shift +] {1..9} to [move to] workspace {1..9} + builtins.concatLists (builtins.genList (i: + let ws = i + 1; + in [ + "$mod, code:1${toString i}, workspace, ${toString ws}" + "$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}" + ] + ) + 9) + ); + }; + }; + + services.hyprpaper = { + enable = true; + package = inputs.hyprpaper.packages.${pkgs.stdenv.hostPlatform.system}.hyprpaper; + settings = { + wallpaper = [ + ",${../../../wallpapers/nix-wallpaper-nineish-catppuccin-frappe-alt.svg}" + ]; + }; + }; + + programs.fuzzel.enable = true; + home.packages = with inputs.hyprland-contrib.packages.${pkgs.system}; [ + grimblast + ]; +} diff --git a/hosts/common/hyprland.nix b/hosts/common/hyprland.nix new file mode 100644 index 0000000..fdc6fee --- /dev/null +++ b/hosts/common/hyprland.nix @@ -0,0 +1,11 @@ +{ inputs, pkgs, ... }: +{ + + wayland.windowManager.hyprland = { + enable = true; + # set the flake package + package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; + # make sure to also set the portal package, so that they are in sync + portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; + }; +} diff --git a/hosts/common/system/cachix.nix b/hosts/common/system/cachix.nix new file mode 100644 index 0000000..11cee14 --- /dev/null +++ b/hosts/common/system/cachix.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + nix.settings = { + substituters = ["https://hyprland.cachix.org"]; + trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; + }; +} diff --git a/hosts/common/system/default.nix b/hosts/common/system/default.nix index 643e19e..f5b06f7 100644 --- a/hosts/common/system/default.nix +++ b/hosts/common/system/default.nix @@ -8,6 +8,7 @@ _: ./packages.nix ./printing.nix ./misc.nix + ./cachix.nix ./nh.nix ]; } diff --git a/hosts/vamos/default.nix b/hosts/vamos/default.nix index 91cdd77..e918f43 100644 --- a/hosts/vamos/default.nix +++ b/hosts/vamos/default.nix @@ -1,5 +1,4 @@ -{ inputs, ... }: - +{ inputs, pkgs, ... }: { imports = [ ./hardware-configuration.nix @@ -22,5 +21,12 @@ }; }; }; + programs.hyprland = { + enable = true; + # set the flake package + package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; + # make sure to also set the portal package, so that they are in sync + portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; + }; }