feat: add hyprland

This commit is contained in:
winston 2023-02-12 08:05:51 +01:00
parent c17fa971e9
commit 59cdfdde06
Signed by: winston
GPG key ID: 3786770EDBC2B481
11 changed files with 299 additions and 81 deletions

View file

@ -108,18 +108,60 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "hyprland": {
"inputs": {
"hyprland-protocols": "hyprland-protocols",
"nixpkgs": "nixpkgs",
"wlroots": "wlroots",
"xdph": "xdph"
},
"locked": { "locked": {
"lastModified": 1675918889, "lastModified": 1676066608,
"narHash": "sha256-hy7re4F9AEQqwZxubct7jBRos6md26bmxnCjxf5utJA=", "narHash": "sha256-wUfFD5kZ4+MSX92Zruy/W64m7E5CzORfiVdLOuyJ15o=",
"owner": "nixos", "owner": "hyprwm",
"repo": "nixpkgs", "repo": "Hyprland",
"rev": "49efda9011e8cdcd6c1aad30384cb1dc230c82fe", "rev": "bda8208aaa3d7eb9f14d49691b919f8f2e9f5594",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "hyprwm",
"ref": "nixos-22.11", "repo": "Hyprland",
"type": "github"
}
},
"hyprland-protocols": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
]
},
"locked": {
"lastModified": 1671839510,
"narHash": "sha256-+PY1qqJfmZzzROgcIY4I7AkCwpnC+qBIYk2eFoA9RWc=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "b8f55e02a328c47ed373133c52483bbfa20a1b75",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-protocols",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1675273418,
"narHash": "sha256-tpYc4TEGvDzh9uRf44QemyQ4TpVuUbxb07b2P99XDbM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4d7c2644dbac9cf8282c0afe68fca8f0f3e7b2db",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -173,6 +215,22 @@
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1675918889,
"narHash": "sha256-hy7re4F9AEQqwZxubct7jBRos6md26bmxnCjxf5utJA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "49efda9011e8cdcd6c1aad30384cb1dc230c82fe",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-22.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1671271357, "lastModified": 1671271357,
"narHash": "sha256-xRJdLbWK4v2SewmSStYrcLa0YGJpleufl44A19XSW8k=", "narHash": "sha256-xRJdLbWK4v2SewmSStYrcLa0YGJpleufl44A19XSW8k=",
@ -188,7 +246,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_3": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1675523619, "lastModified": 1675523619,
"narHash": "sha256-jHvkAwkbAj1s0O5riHMghSDHh9iz8AwLTbXQuVQKQcg=", "narHash": "sha256-jHvkAwkbAj1s0O5riHMghSDHh9iz8AwLTbXQuVQKQcg=",
@ -224,7 +282,7 @@
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
"gitignore": "gitignore", "gitignore": "gitignore",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_3",
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
@ -246,7 +304,8 @@
"darwin": "darwin", "darwin": "darwin",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs", "hyprland": "hyprland",
"nixpkgs": "nixpkgs_2",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"nur": "nur", "nur": "nur",
"pre-commit-hooks": "pre-commit-hooks", "pre-commit-hooks": "pre-commit-hooks",
@ -255,7 +314,7 @@
}, },
"sops": { "sops": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_4",
"nixpkgs-stable": "nixpkgs-stable_2" "nixpkgs-stable": "nixpkgs-stable_2"
}, },
"locked": { "locked": {
@ -286,6 +345,49 @@
"repo": "flake-utils", "repo": "flake-utils",
"type": "github" "type": "github"
} }
},
"wlroots": {
"flake": false,
"locked": {
"host": "gitlab.freedesktop.org",
"lastModified": 1675374853,
"narHash": "sha256-BSrjNcddYWhFUMtjGwxiEXw67MYRaIHGvLn19Mvm1NE=",
"owner": "wlroots",
"repo": "wlroots",
"rev": "677a3f2f8847ed2de49dd60868f9d9487a546f58",
"type": "gitlab"
},
"original": {
"host": "gitlab.freedesktop.org",
"owner": "wlroots",
"repo": "wlroots",
"type": "gitlab"
}
},
"xdph": {
"inputs": {
"hyprland-protocols": [
"hyprland",
"hyprland-protocols"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
]
},
"locked": {
"lastModified": 1673116118,
"narHash": "sha256-eR0yDSkR2XYMesfdRWJs25kAdXET2mbNNHu5t+KUcKA=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "d479c846531fd0e1d2357c9588b8310a2b859ef2",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -20,17 +20,20 @@
# dev # dev
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
hyprland.url = "github:hyprwm/Hyprland";
}; };
outputs = { outputs = {
self, self,
darwin, darwin,
home-manager,
flake-utils, flake-utils,
pre-commit-hooks, home-manager,
hyprland,
nixpkgs, nixpkgs,
nixpkgs-unstable, nixpkgs-unstable,
nur, nur,
pre-commit-hooks,
sops, sops,
... ...
}: let }: let
@ -62,6 +65,7 @@
extraSpecialArgs = { extraSpecialArgs = {
nur = nur.nixosModules.nur; nur = nur.nixosModules.nur;
sops = sops.homeManagerModules.sops; sops = sops.homeManagerModules.sops;
hyprland = hyprland.homeManagerModules.default;
flakePath = "/home/winston/.config/nixpkgs"; flakePath = "/home/winston/.config/nixpkgs";
machine.personal = true; machine.personal = true;
}; };

View file

@ -5,6 +5,7 @@
pkgs, pkgs,
sops, sops,
machine, machine,
hyprland,
... ...
}: let }: let
inherit (pkgs.stdenv.hostPlatform) isLinux; inherit (pkgs.stdenv.hostPlatform) isLinux;
@ -12,30 +13,30 @@
in { in {
imports = imports =
[ [
hyprland
nur nur
sops sops
./catppuccin ./catppuccin
./modules/firefox.nix ./modules/firefox.nix
./modules/git.nix ./modules/git.nix
./modules/gpg.nix ./modules/gpg.nix
./modules/hyprland.nix
./modules/i3.nix ./modules/i3.nix
./modules/kubernetes.nix ./modules/kubernetes.nix
./modules/mail.nix ./modules/mail.nix
./modules/music.nix ./modules/music.nix
./modules/neovim.nix ./modules/neovim.nix
./modules/newsboat.nix ./modules/newsboat.nix
./modules/rice.nix
./modules/sops.nix ./modules/sops.nix
./modules/vscode.nix ./modules/vscode.nix
./modules/wezterm.nix ./modules/wezterm.nix
./modules/zsh.nix ./modules/zsh.nix
] ]
++ lib.optionals (builtins.pathExists ./modules/secrets.nix) [ ++ lib.optionals (builtins.pathExists ./modules/secrets.nix) [./modules/secrets.nix];
# hotfix: use fucking git-secret, this is atrocious beyond belief
./modules/secrets.nix
];
catppuccin = { catppuccin = {
defaultTheme = "frappe"; defaultTheme = "mocha";
bat.enable = true; bat.enable = true;
btop.enable = true; btop.enable = true;
dircolors.enable = true; dircolors.enable = true;
@ -75,7 +76,7 @@ in {
] ]
++ lib.optionals (isLinux && machine.personal) [ ++ lib.optionals (isLinux && machine.personal) [
discover-overlay discover-overlay
unstable.discord (unstable.discord.override {withOpenASAR = true;})
lutris lutris
]); ]);

View file

@ -64,15 +64,17 @@ in {
time.timeZone = "Europe/Vienna"; time.timeZone = "Europe/Vienna";
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
programs.dconf.enable = true; programs = {
programs.steam.enable = true; dconf.enable = true;
programs.thunar = { steam.enable = true;
thunar = {
enable = true; enable = true;
plugins = with pkgs.xfce; [ plugins = with pkgs.xfce; [
thunar-archive-plugin thunar-archive-plugin
thunar-volman thunar-volman
]; ];
}; };
};
security.polkit.enable = true; security.polkit.enable = true;
systemd = { systemd = {

28
modules/hyprland.nix Normal file
View file

@ -0,0 +1,28 @@
{
config,
flakePath,
lib,
pkgs,
...
}: let
inherit (pkgs.stdenv.hostPlatform) isLinux;
nvidiaPrefix = "GDM_BACKEND=nvidia-drm LIBVA_DRIVER_NAME=nvidia __GLX_VENDOR_LIBRARY_NAME=nvidia WLR_NO_HARDWARE_CURSORS=1";
waylandPrefix = "XDG_SESSION_TYPE=wayland NIXOS_OZONE_WL=1";
in {
home.shellAliases = lib.mkIf isLinux {
"Hyprland" = "${nvidiaPrefix} ${waylandPrefix} Hyprland";
};
wayland = lib.mkIf isLinux {
windowManager.hyprland = {
enable = true;
nvidiaPatches = true;
xwayland = {
enable = true;
hidpi = true;
};
};
};
xdg = lib.mkIf isLinux {
configFile."hypr/hyprland.conf".source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/modules/hyprland/hyprland.conf";
};
}

View file

@ -0,0 +1,72 @@
monitor = ,5120x2160@72,0x0,1.5
input:follow_mouse = 1
general {
sensitivity = 1.0 # for mouse cursor
gaps_in = 5
gaps_out = 10
border_size = 2
no_cursor_warps = true
col.active_border = 0xfff5c2e7
col.inactive_border = 0x80cba6f7
apply_sens_to_raw = 0 # whether to apply the sensitivity to raw input (e.g. used by games where you aim using your mouse)
}
decoration {
rounding = 10
blur = 0
}
animations {
enabled = 1
animation = workspaces,1,1,default,slide
}
misc {
disable_hyprland_logo = true
disable_splash_rendering = true
}
# example binds
bind = SUPER_SHIFT,return,exec,wezterm
bind = SUPER_SHIFT,q,killactive,
bind = SUPER_SHIFT,M,exit,
bind = SUPER_SHIFT,d,togglefloating,
bind = SUPER,space,exec,rofi -show drun
bind = SUPER_CTRL,l,movefocus,l
bind = SUPER_CTRL,h,movefocus,r
bind = SUPER_CTRL,k,movefocus,u
bind = SUPER_CTRL,j,movefocus,d
bind = SUPER_SHIFT,h,movewindow,l
bind = SUPER_SHIFT,l,movewindow,r
bind = SUPER_SHIFT,j,movewindow,u
bind = SUPER_SHIFT,k,movewindow,d
bind = SUPER_CTRL,1,workspace,1
bind = SUPER_CTRL,2,workspace,2
bind = SUPER_CTRL,3,workspace,3
bind = SUPER_CTRL,4,workspace,4
bind = SUPER_CTRL,5,workspace,5
bind = SUPER_CTRL,6,workspace,6
bind = SUPER_CTRL,7,workspace,7
bind = SUPER_CTRL,8,workspace,8
bind = SUPER_CTRL,9,workspace,9
bind = SUPER_CTRL,0,workspace,10
bind = SUPER_SHIFT,1,movetoworkspace,1
bind = SUPER_SHIFT,2,movetoworkspace,2
bind = SUPER_SHIFT,3,movetoworkspace,3
bind = SUPER_SHIFT,4,movetoworkspace,4
bind = SUPER_SHIFT,5,movetoworkspace,5
bind = SUPER_SHIFT,6,movetoworkspace,6
bind = SUPER_SHIFT,7,movetoworkspace,7
bind = SUPER_SHIFT,8,movetoworkspace,8
bind = SUPER_SHIFT,9,movetoworkspace,9
bind = SUPER_SHIFT,0,movetoworkspace,10
bindm = SUPER,mouse:272,movewindow
bindm = SUPER,mouse:273,resizewindow

View file

@ -9,6 +9,7 @@
in { in {
home = lib.mkIf isLinux { home = lib.mkIf isLinux {
packages = with pkgs; [ packages = with pkgs; [
arandr
blueberry blueberry
libnotify libnotify
noisetorch noisetorch
@ -16,42 +17,7 @@ in {
]; ];
}; };
gtk = lib.mkIf isLinux {
enable = true;
cursorTheme = {
name = "Catppuccin-Mocha-Cursors";
package = pkgs.catppuccin-cursors.mochaPink;
};
iconTheme = {
package = pkgs.papirus-folders-catppuccin.override {
flavour = "mocha";
accent = "pink";
};
name = "Papirus-Dark";
};
theme = {
name = "Catppuccin-Mocha-Standard-Pink-Dark";
package = pkgs.unstable.catppuccin-gtk;
};
gtk2.extraConfig = ''
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintslight"
gtk-xft-rgba="rgb"
'';
gtk3.extraConfig = {
gtk-xft-antialias = 1;
gtk-xft-hinting = 1;
gtk-xft-hintstyle = "hintslight";
gtk-xft-rgba = "rgb";
};
};
programs = lib.mkIf isLinux { programs = lib.mkIf isLinux {
autorandr.enable = true;
i3status-rust = { i3status-rust = {
enable = true; enable = true;
bars.default = { bars.default = {
@ -95,14 +61,6 @@ in {
}; };
}; };
}; };
rofi = {
enable = true;
font = "Berkeley Mono 14";
extraConfig.icon-theme = "Papirus-Dark";
terminal = "${lib.getExe pkgs.wezterm}";
theme = ./rofi/theme.rasi;
};
}; };
services = lib.mkIf isLinux { services = lib.mkIf isLinux {
@ -177,11 +135,9 @@ in {
}; };
xdg = lib.mkIf isLinux { xdg = lib.mkIf isLinux {
configFile = { configFile."i3" = {
"i3" = {
source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/modules/i3"; source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/modules/i3";
recursive = true; recursive = true;
}; };
}; };
};
} }

View file

@ -0,0 +1,5 @@
local present, neogit = pcall(require, "neogit")
if not present then
return
end

View file

@ -32,6 +32,7 @@ vim.o.tabstop = 2
vim.o.softtabstop = 0 vim.o.softtabstop = 0
vim.o.expandtab = true vim.o.expandtab = true
vim.o.signcolumn = "yes:1" vim.o.signcolumn = "yes:1"
vim.opt.shortmess:append("sI")
-- double box drawing characters for splits -- double box drawing characters for splits
vim.opt.fillchars:append({ vim.opt.fillchars:append({
horiz = "", horiz = "",

49
modules/rice.nix Normal file
View file

@ -0,0 +1,49 @@
{
lib,
pkgs,
...
}: let
inherit (pkgs.stdenv.hostPlatform) isLinux;
in {
gtk = lib.mkIf isLinux {
enable = true;
cursorTheme = {
name = "Catppuccin-Mocha-Cursors";
package = pkgs.catppuccin-cursors.mochaPink;
};
iconTheme = {
package = pkgs.papirus-folders-catppuccin.override {
flavour = "mocha";
accent = "pink";
};
name = "Papirus-Dark";
};
theme = {
name = "Catppuccin-Mocha-Standard-Pink-Dark";
package = pkgs.unstable.catppuccin-gtk;
};
gtk2.extraConfig = ''
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintslight"
gtk-xft-rgba="rgb"
'';
gtk3.extraConfig = {
gtk-xft-antialias = 1;
gtk-xft-hinting = 1;
gtk-xft-hintstyle = "hintslight";
gtk-xft-rgba = "rgb";
};
};
programs.rofi = lib.mkIf isLinux {
enable = true;
package = pkgs.rofi-wayland;
font = "Berkeley Mono 14";
extraConfig.icon-theme = "Papirus-Dark";
terminal = "${lib.getExe pkgs.wezterm}";
theme = ./rofi/theme.rasi;
};
}

View file

@ -3,10 +3,8 @@
flakePath, flakePath,
... ...
}: { }: {
xdg.configFile = { xdg.configFile."wezterm" = {
"wezterm" = {
source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/modules/wezterm"; source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/modules/wezterm";
recursive = true; recursive = true;
}; };
};
} }