feat: standalone home-manager configuration

This commit is contained in:
Guz
2025-02-05 10:25:00 -03:00
parent bda700fb79
commit 69a34d818f
4 changed files with 198 additions and 0 deletions

View File

@@ -76,5 +76,17 @@
};
};
homeConfigurations = {
"guz" = home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = {inherit inputs self;};
modules = [
inputs.stylix.homeManagerModules.stylix
# inputs.xremap.homeManaggerModules.default
./home
];
pkgs = import nixpkgs {system = "x86_64-linux";};
};
};
};
}

17
home/default.nix Normal file
View File

@@ -0,0 +1,17 @@
{self, ...}: {
home.username = "guz";
home.homeDirectory = "/home/guz";
imports = [
./desktop.nix
./keymaps.nix
];
# The *state version* indicates which default
# settings are in effect and will therefore help avoid breaking
# program configurations. Switching to a higher state version
# typically requires performing some manual steps, such as data
# conversion or moving files.
home.stateVersion = "24.11";
}

128
home/desktop.nix Normal file
View File

@@ -0,0 +1,128 @@
{
config,
pkgs,
lib,
osConfig ? null,
...
}:
(
# Check if it is being used as a NixOS module
if (isNull osConfig)
then {
stylix.enable = true;
stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
stylix.image = ../static/guz-wallpaper-default.png;
}
else {}
)
// {
# Desktop Environment
## Hyprland
wayland.windowManager.hyprland.enable = true;
wayland.windowManager.hyprland.settings = {
"$MOD" = "SUPER";
"$MONITOR-1" = "";
"$MONITOR-2" = "";
animations.enabled = true;
decoration = {
rounding = 5;
dim_inactive = true;
dim_strength = 0.2;
dim_around = 0.4;
blur.enabled = false;
};
dwindle = {
pseudotile = true;
preserve_split = true;
};
exec-once = [
"systemctl --user enable --now hyprpaper.service"
"systemctl --user enable --now hypridle.service"
];
general = {
gaps_in = 5;
gaps_out = 10;
border_size = 0;
layout = "dwindle";
};
input = {
kb_layout = "br";
kb_variant = "abnt2";
follow_mouse = 1;
sensitivity = 0;
};
monitor = [
", preferred, auto, 1"
];
windowrulev2 = [
# Inkscape pop-ups
"float,class:^(org.inkscape.Inkscape)$"
"tile,class:^(org.inkscape.Inkscape)$,title:(.*)(- Inkscape)$"
# Blender pop-ups
"float,class:^(blender)$,title:^(?!.*\ \-\ Blender).*$)"
];
workspace = [
# Primary monitor
"1,monitor:$MONITOR-1,default:true"
"2,monitor:$MONITOR-1"
"3,monitor:$MONITOR-1"
"4,monitor:$MONITOR-1"
"5,monitor:$MONITOR-1"
# Second monitor
"6,monitor:$MONITOR-2"
"7,monitor:$MONITOR-2"
"8,monitor:$MONITOR-2"
"9,monitor:$MONITOR-2"
"10,monitor:$MONITOR-2,default:true"
];
};
### Idle lock screen
programs.hyprlock.enable = true;
services.hypridle.enable = true;
services.hypridle.settings = let
hyprlock = lib.getExe config.programs.hyprlock.package;
brightnessctl = lib.getExe pkgs.brightnessctl;
hyprctl = lib.getExe' config.wayland.windowManager.hyprland.package "hyprctl";
loginctl = lib.getExe' pkgs.systemd "loginctl";
in {
general = {
lock_cmd = "pidof ${hyprlock} || ${hyprlock}";
before_sleep_cmd = "${loginctl} unlock-session";
after_sleep_cmd = "${hyprctl} dispatch dpms on";
};
listener = {
timeout = 10;
on-timeout = "${brightnessctl} -sd rgb:kbd_backlight set 0 && ${hyprlock}";
on-resume = "${brightnessctl} -rd rgb:kbd_backlight";
};
};
### Wallpaper
services.hyprpaper.enable = true;
# Wayland/flatpak portals
xdg.portal.enable = true;
xdg.portal.extraPortals = with pkgs; [
xdg-desktop-portal-wlr
xdg-desktop-portal-gtk
];
xdg.portal.config = {
common.default = ["gtk"]; # Use GTK for things such as file picker.
};
}

41
home/keymaps.nix Normal file
View File

@@ -0,0 +1,41 @@
{
config,
lib,
pkgs,
...
}: {
wayland.windowManager.hyprland.settings.bind = [
"$MOD, 1, workspace, 1"
"$MOD, 2, workspace, 2"
"$MOD, 3, workspace, 3"
"$MOD, 4, workspace, 4"
"$MOD, 5, workspace, 5"
"$MOD + SHIFT, 1, movetoworkspace, 1"
"$MOD + SHIFT, 2, movetoworkspace, 2"
"$MOD + SHIFT, 3, movetoworkspace, 3"
"$MOD + SHIFT, 4, movetoworkspace, 4"
"$MOD + SHIFT, 5, movetoworkspace, 5"
"$MOD, 6, workspace, 6"
"$MOD, 7, workspace, 7"
"$MOD, 8, workspace, 8"
"$MOD, 9, workspace, 9"
"$MOD, 0, workspace, 10"
"$MOD + SHIFT, 6, movetoworkspace, 6"
"$MOD + SHIFT, 7, movetoworkspace, 7"
"$MOD + SHIFT, 8, movetoworkspace, 8"
"$MOD + SHIFT, 9, movetoworkspace, 9"
"$MOD + SHIFT, 0, movetoworkspace, 10"
"$MOD, H, movefocus, l"
"$MOD, L, movefocus, r"
"$MOD, K, movefocus, u"
"$MOD, J, movefocus, d"
];
wayland.windowManager.hyprland.settings.bindm = [
# Left-click
"$MOD, mouse:272, movewindow"
# Right-click
"$MOD, mouse:273, resizewindow"
];
}