start working on hyprland config

This commit is contained in:
Anthony Rodriguez 2024-09-04 23:40:24 +02:00
parent da7921ebed
commit 022e09af05
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
7 changed files with 91 additions and 4 deletions

View file

@ -23,6 +23,12 @@
url = "github:wez/wezterm/main?dir=nix"; url = "github:wez/wezterm/main?dir=nix";
inputs.nixpkgs.follows = "nixpkgs"; 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"; nixos-hardware.url = "github:NixOS/nixos-hardware";
}; };
@ -30,7 +36,6 @@
let let
username = "nezia"; username = "nezia";
system = "x86_64-linux"; system = "x86_64-linux";
commonModules = hostname: [ commonModules = hostname: [
./modules ./modules
./hosts/common ./hosts/common
@ -47,7 +52,7 @@
]; ];
home-manager.extraSpecialArgs = { inherit inputs; }; home-manager.extraSpecialArgs = { inherit inputs; };
} }
{ _module.args = { inherit hostname username; }; } { _module.args = { inherit hostname username inputs; }; }
]; ];
configureSystem = hostname: homeConfig: nixpkgs.lib.nixosSystem { configureSystem = hostname: homeConfig: nixpkgs.lib.nixosSystem {

View file

@ -2,5 +2,6 @@ _:
{ {
imports = [ imports = [
../common ../common
./hyprland
]; ];
} }

View file

@ -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
];
}

11
hosts/common/hyprland.nix Normal file
View file

@ -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;
};
}

View file

@ -0,0 +1,7 @@
{ ... }:
{
nix.settings = {
substituters = ["https://hyprland.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
};
}

View file

@ -8,6 +8,7 @@ _:
./packages.nix ./packages.nix
./printing.nix ./printing.nix
./misc.nix ./misc.nix
./cachix.nix
./nh.nix ./nh.nix
]; ];
} }

View file

@ -1,5 +1,4 @@
{ inputs, ... }: { inputs, pkgs, ... }:
{ {
imports = [ imports = [
./hardware-configuration.nix ./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;
};
} }