refactor(homeModules/desktop): move hyprland config to module

This commit is contained in:
Mohammad Rafiq 2025-05-20 12:05:48 +08:00
parent 97e4bf372b
commit a1001ddb4c
No known key found for this signature in database
4 changed files with 27 additions and 2 deletions

View file

@ -11,6 +11,7 @@
cli.git.name = "Mohammad Rafiq";
cli.git.email = "rafiq@rrv.sh";
cli.git.defaultBranch = "prime";
desktop.windowManager = "hyprland";
home.shellAliases.v = "nvim";
home.shellAliases = {

View file

@ -1,7 +1,6 @@
{pkgs,...}:
{
imports = [
./desktop/hyprland.nix
./desktop/firefox.nix
];
home.packages = with pkgs; [

View file

@ -0,0 +1,17 @@
{ config, lib, osConfig, ... }:
{
options.desktop = {
windowManager = lib.pantheon.mkStrOption;
};
config = {
assertions =
[
{
assertion = (osConfig.desktop.windowManager == config.desktop.windowManager);
message = "You have set your home window manager to one that is not installed on this system.";
}
];
};
}

View file

@ -2,6 +2,12 @@
let
mainMonitor = osConfig.desktop.mainMonitor;
in
{
imports = [
];
config = lib.mkIf (config.desktop.windowManager == "hyprland") (lib.mkMerge [
{
xdg.configFile."uwsm/env".text = # sh
''
@ -44,3 +50,5 @@ in
};
};
}
]);
}