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.name = "Mohammad Rafiq";
cli.git.email = "rafiq@rrv.sh"; cli.git.email = "rafiq@rrv.sh";
cli.git.defaultBranch = "prime"; cli.git.defaultBranch = "prime";
desktop.windowManager = "hyprland";
home.shellAliases.v = "nvim"; home.shellAliases.v = "nvim";
home.shellAliases = { home.shellAliases = {

View file

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

@ -1,8 +1,14 @@
{config, lib, osConfig, ...}: { config, lib, osConfig, ... }:
let let
mainMonitor = osConfig.desktop.mainMonitor; mainMonitor = osConfig.desktop.mainMonitor;
in in
{ {
imports = [
];
config = lib.mkIf (config.desktop.windowManager == "hyprland") (lib.mkMerge [
{
xdg.configFile."uwsm/env".text = # sh xdg.configFile."uwsm/env".text = # sh
'' ''
@ -43,4 +49,6 @@ in
]; ];
}; };
}; };
}
]);
} }