nix: Abstract hyprland config into separate module

This should make it easy to switch between hyprland and other
environments if wanted.
This commit is contained in:
Donovan Glover 2023-05-09 14:03:54 -04:00
parent 1c99ffd784
commit e1d740fb63
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 67 additions and 71 deletions

View File

@ -12,6 +12,7 @@
modules = [
./configuration.nix
./modules/editor.nix
./modules/desktop.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
@ -25,20 +26,6 @@
home.packages = [ pkgs.httpie ];
home.stateVersion = "22.11";
programs.mpv.enable = true;
programs.kitty = {
enable = true;
font = {
package = pkgs."maple-mono-NF";
name = "MapleMono-NF";
};
settings = {
enable_audio_bell = false;
allow_remote_control = true;
dynamic_background_opacity = true;
background_opacity = "0.9";
close_on_child_death = true;
};
};
programs.librewolf = {
enable = true;
settings = {
@ -48,66 +35,9 @@
"browser.tabs.insertAfterCurrent" = true;
};
};
programs.gitui.enable = true;
programs.git = { diff-so-fancy = { enable = true; }; };
programs.lf = { enable = true; };
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "bottom";
position = "top";
height = 30;
modules-left = [ "wlr/taskbar" "tray" ];
modules-center = [ "hyprland/window" ];
modules-right =
[ "battery" "backlight" "wireplumber" "clock" ];
};
};
};
services.udiskie.enable = true;
programs.swaylock = {
package = pkgs."swaylock-effects";
settings = {
show-keyboard-layout = true;
daemonize = true;
font = "Noto Sans CJK JP";
effect-blur = "5x2";
clock = true;
indicator = true;
font-size = 25;
indicator-radius = 85;
indicator-thickness = 16;
screenshots = true;
fade-in = 1;
};
};
editorconfig = {
enable = true;
settings = {
"*" = {
charset = "utf-8";
end_of_line = "lf";
insert_final_newline = true;
indent_size = 2;
indent_style = "space";
trim_trailing_whitespace = true;
};
"*.md" = { indent_style = "tab"; };
"Makefile" = {
indent_style = "tab";
indent_size = 4;
};
"*.html" = {
indent_style = "tab";
indent_size = 4;
};
"*.go" = {
indent_style = "tab";
indent_size = 4;
};
};
};
};
}
];

66
modules/desktop.nix Normal file
View File

@ -0,0 +1,66 @@
{ config, lib, nixpkgs, home-manager, ... }: {
imports = [ home-manager.nixosModule ];
home-manager.users.user = { pkgs, ... }: {
programs.kitty = {
enable = true;
font = {
package = pkgs."maple-mono-NF";
name = "MapleMono-NF";
};
settings = {
enable_audio_bell = false;
allow_remote_control = true;
dynamic_background_opacity = true;
background_opacity = "0.9";
close_on_child_death = true;
};
};
programs.swaylock = {
package = pkgs."swaylock-effects";
settings = {
show-keyboard-layout = true;
daemonize = true;
font = "Noto Sans CJK JP";
effect-blur = "5x2";
clock = true;
indicator = true;
font-size = 25;
indicator-radius = 85;
indicator-thickness = 16;
screenshots = true;
fade-in = 1;
};
};
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "bottom";
position = "top";
height = 30;
modules-left = [ "wlr/taskbar" "tray" ];
modules-center = [ "hyprland/window" ];
modules-right = [ "battery" "backlight" "wireplumber" "clock" ];
};
};
};
programs.alacritty = {
enable = true;
settings = {
window.opacity = 0.9;
window.padding.x = 10;
window.padding.y = 10;
window.decorations = "none";
window.startup_mode = "Maximized";
window.decorations_theme_variant = "Dark";
font.normal.family = "MapleMono-NF";
font.size = 11;
draw_bold_text_with_bright_colors = true;
selection.save_to_clipboard = true;
cursor.style.shape = "Beam";
cursor.style.blinking = "Always";
mouse.hide_when_typing = true;
};
};
};
}