Add hyprland

This commit is contained in:
langedev 2023-11-20 01:31:41 -08:00
parent ed3d2e8ef8
commit f10217bbae
6 changed files with 248 additions and 3 deletions

129
flake.lock generated
View file

@ -20,7 +20,70 @@
"type": "github" "type": "github"
} }
}, },
"hyprland": {
"inputs": {
"hyprland-protocols": "hyprland-protocols",
"nixpkgs": "nixpkgs",
"systems": "systems",
"wlroots": "wlroots",
"xdph": "xdph"
},
"locked": {
"lastModified": 1700397206,
"narHash": "sha256-ityVJcy3I/E8soXctwWveg58+cXOSQXhDIcU6YR2gjI=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "646f4bc63861e03b01fed3833bb65d1d014e1bf3",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "Hyprland",
"type": "github"
}
},
"hyprland-protocols": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1691753796,
"narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-protocols",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": {
"lastModified": 1698134075,
"narHash": "sha256-foCD+nuKzfh49bIoiCBur4+Fx1nozo+4C/6k8BYk4sg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8efd5d1e283604f75a808a20e6cde0ef313d07d4",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1699825797, "lastModified": 1699825797,
"narHash": "sha256-W2m42mVt4/O6CJFbECPfLApmi8bO+qscbmSeEKrSHEg=", "narHash": "sha256-W2m42mVt4/O6CJFbECPfLApmi8bO+qscbmSeEKrSHEg=",
@ -39,7 +102,71 @@
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs" "hyprland": "hyprland",
"nixpkgs": "nixpkgs_2"
}
},
"systems": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"wlroots": {
"flake": false,
"locked": {
"host": "gitlab.freedesktop.org",
"lastModified": 1699292815,
"narHash": "sha256-HXu98PyBMKEWLqiTb8viuLDznud/SdkdJsx5A5CWx7I=",
"owner": "wlroots",
"repo": "wlroots",
"rev": "5de9e1a99d6642c2d09d589aa37ff0a8945dcee1",
"type": "gitlab"
},
"original": {
"host": "gitlab.freedesktop.org",
"owner": "wlroots",
"repo": "wlroots",
"rev": "5de9e1a99d6642c2d09d589aa37ff0a8945dcee1",
"type": "gitlab"
}
},
"xdph": {
"inputs": {
"hyprland-protocols": [
"hyprland",
"hyprland-protocols"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1697981233,
"narHash": "sha256-y8q4XUwx+gVK7i2eLjfR32lVo7TYvEslyzrmzYEaPZU=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "22e7a65ff9633e1dedfa5317fdffc49f68de2ff2",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
} }
} }
}, },

View file

@ -4,20 +4,26 @@
inputs = { inputs = {
# Specify the source of Home Manager and Nixpkgs. # Specify the source of Home Manager and Nixpkgs.
nixpkgs.url = "github:langedev/nixpkgs/nixos-unstable"; nixpkgs.url = "github:langedev/nixpkgs/nixos-unstable";
home-manager = { home-manager = {
url = "github:langedev/home-manager"; url = "github:langedev/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
hyprland.url = "github:hyprwm/Hyprland";
}; };
outputs = { nixpkgs, home-manager, ... }: outputs = { nixpkgs, home-manager, hyprland, ... }:
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
in { in {
homeConfigurations."pan" = home-manager.lib.homeManagerConfiguration { homeConfigurations."pan" = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = [ ./home.nix ]; modules = [
hyprland.homeManagerModules.default
./home.nix
];
}; };
}; };
} }

View file

@ -8,6 +8,7 @@
xdg.enable = true; xdg.enable = true;
imports = [ imports = [
./programs/hypr
./programs/alacritty ./programs/alacritty
./programs/pywal ./programs/pywal
./programs/fish ./programs/fish

View file

@ -0,0 +1,52 @@
monitor=,preferred,auto,1
monitor=HDMI-A-1,disable
exec-once = swww init
exec-once = swww img $HOME/med/pix/bg.png
input {
kb_layout = us
follow_mouse = 1
accel_profile = flat
sensitivity = 0.2 # -1.0 - 1.0, 0 means no modification.
}
general {
gaps_in = 3
gaps_out = 3
border_size = 2
col.active_border = rgb(F5C2E7)
col.inactive_border = rgb(1E1D2F)
layout = master
}
decoration {
rounding = 2
blur {
size = 12
}
}
animations {
enabled = yes
animation = windows, 1, 4, default, popin 50%
animation = windowsOut, 1, 4, default, popin 50%
animation = windowsMove, 1, 3, default
animation = border, 1, 3, default
animation = fade, 1, 3, default
animation = workspaces, 1, 3, default
}
master {
no_gaps_when_only = true
new_is_master = false
}
Binds {
workspace_back_and_forth = true
}
windowrule = opacity 0.9 0.9,^(Alacritty)$
windowrule = opacity 0.94 0.94,^(discord)$

View file

@ -0,0 +1,9 @@
{ config, pkgs, ... }:
{
wayland.windowManager.hyprland.enable = true;
wayland.windowManager.hyprland.extraConfig = ''
${builtins.readFile ./default.conf}
${builtins.readFile ./keybinds.conf}
'';
}

View file

@ -0,0 +1,50 @@
$mainMod = SUPER
# Exec programs
bind = $mainMod, return, exec, alacritty
bind = $mainMod SHIFT, return, exec, rofi -show run
# bind = $mainMod SHIFT, P, exec, screenshot
# Hyprland Management
bind = $mainMod SHIFT, Q, exit,
# Bars stuff
bind = $mainMod, TAB, exec, eww open --toggle
# Workspace / Monitor Management
bind = $mainMod, h, focusmonitor, l
bind = $mainMod, l, focusmonitor, r
bind = $mainMod, j, cyclenext,
bind = $mainMod, k, cyclenext, prev
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# Window Management
bind = $mainMod, C, killactive,
bind = $mainMod, F, togglefloating,
bind = $mainMod SHIFT, F, fullscreen,
bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1
bind = $mainMod SHIFT, 2, movetoworkspacesilent, 2
bind = $mainMod SHIFT, 3, movetoworkspacesilent, 3
bind = $mainMod SHIFT, 4, movetoworkspacesilent, 4
bind = $mainMod SHIFT, 5, movetoworkspacesilent, 5
bind = $mainMod SHIFT, 6, movetoworkspacesilent, 6
bind = $mainMod SHIFT, 7, movetoworkspacesilent, 7
bind = $mainMod SHIFT, 8, movetoworkspacesilent, 8
bind = $mainMod SHIFT, 9, movetoworkspacesilent, 9
bind = $mainMod SHIFT, 0, movetoworkspacesilent, 10
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow