mirror of
https://github.com/tuxdotrs/nix-config.git
synced 2026-09-20 09:09:04 +05:30
feat(desktop): add twm and hyprland module
This commit is contained in:
@@ -1,43 +1,58 @@
|
||||
{
|
||||
flake.modules.homeManager.desktop = {
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
# TODO: Hyprland 0.55 switched to Lua-based configuration.
|
||||
# HM module is updated but I'm too lazy at this point so we symlink our config instead.
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
package = null;
|
||||
portalPackage = null;
|
||||
xwayland.enable = true;
|
||||
configType = "hyprlang";
|
||||
systemd.variables = ["--all"];
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.tnix.desktop.hyprland;
|
||||
in {
|
||||
options.tnix.desktop.hyprland = {
|
||||
enable = mkEnableOption "tux's Hyprland";
|
||||
|
||||
monitorConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = "Hyprland monitor configuration";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
package = null;
|
||||
portalPackage = null;
|
||||
xwayland.enable = true;
|
||||
configType = "hyprlang";
|
||||
systemd.variables = ["--all"];
|
||||
};
|
||||
|
||||
home.file = {
|
||||
".config/hypr" = {
|
||||
recursive = true;
|
||||
source = pkgs.twm.hyprland;
|
||||
};
|
||||
".config/hypr/config/monitors.lua".text = cfg.monitorConfig;
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
ags
|
||||
awww
|
||||
grim
|
||||
slurp
|
||||
hyprshot
|
||||
wl-clipboard
|
||||
wl-screenrec
|
||||
omasnap
|
||||
(writeShellScriptBin "hypr-screenshot" ''
|
||||
hyprshot -m region -r ppm - | satty --filename -
|
||||
'')
|
||||
|
||||
(writeShellScriptBin "hypr-screenrecord" ''
|
||||
wl-screenrec -g "$(slurp)"
|
||||
'')
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
home.file = {
|
||||
".config/hypr/config".source =
|
||||
config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/Projects/hypr/config";
|
||||
".config/hypr/hyprland.lua".source =
|
||||
config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/Projects/hypr/hyprland.lua";
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
ags
|
||||
awww
|
||||
grim
|
||||
slurp
|
||||
hyprshot
|
||||
wl-clipboard
|
||||
wl-screenrec
|
||||
omasnap
|
||||
(writeShellScriptBin "hypr-screenshot" ''
|
||||
hyprshot -m region -r ppm - | satty --filename -
|
||||
'')
|
||||
|
||||
(writeShellScriptBin "hypr-screenrecord" ''
|
||||
wl-screenrec -g "$(slurp)"
|
||||
'')
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user