feat(desktop): move window-manager config to homes and use home-manager modules
This commit is contained in:
parent
a04688d17b
commit
9167a54ace
12 changed files with 99 additions and 86 deletions
|
@ -5,23 +5,21 @@
|
|||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkEnableOption;
|
||||
inherit (lib) mkEnableOption mkIf singleton;
|
||||
inherit (lib.pantheon) mkStrOption;
|
||||
inherit (pkgs) wl-clipboard-rs;
|
||||
cfg = config.desktop;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./windowManager.nix
|
||||
];
|
||||
|
||||
options.desktop = {
|
||||
enable = mkEnableOption "";
|
||||
enableWaylandUtilities = mkEnableOption "";
|
||||
mainMonitor = {
|
||||
id = mkStrOption;
|
||||
scale = lib.pantheon.mkStrOption;
|
||||
resolution = lib.pantheon.mkStrOption;
|
||||
refresh-rate = lib.pantheon.mkStrOption;
|
||||
};
|
||||
windowManager = lib.pantheon.mkStrOption;
|
||||
enableSpotifyd = lib.mkEnableOption "";
|
||||
enableSteam = lib.mkEnableOption "";
|
||||
enableVR = lib.mkEnableOption "";
|
||||
|
@ -34,6 +32,9 @@ in
|
|||
font-awesome
|
||||
];
|
||||
}
|
||||
(mkIf cfg.enableWaylandUtilities {
|
||||
home-manager.sharedModules = singleton { home.packages = [ wl-clipboard-rs ]; };
|
||||
})
|
||||
(lib.mkIf config.desktop.enableSteam {
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
|
|
47
modules/nixos/desktop/window-manager/hyprland/default.nix
Normal file
47
modules/nixos/desktop/window-manager/hyprland/default.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf singleton;
|
||||
inherit (config.desktop) mainMonitor;
|
||||
cfg = config.desktop.window-manager.hyprland;
|
||||
in
|
||||
{
|
||||
options.desktop.window-manager.hyprland = {
|
||||
enable = mkEnableOption "";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
desktop.enableWaylandUtilities = true;
|
||||
environment.loginShellInit = # sh
|
||||
''
|
||||
if [[ -z "$SSH_CLIENT" && -z "$SSH_CONNECTION" ]]; then
|
||||
if uwsm check may-start; then
|
||||
exec uwsm start hyprland-uwsm.desktop
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
environment.variables = {
|
||||
ELECTRON_OZONE_PLATFORM_HINT = "auto";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
withUWSM = true;
|
||||
};
|
||||
home-manager.sharedModules = singleton {
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
systemd.enable = false;
|
||||
};
|
||||
xdg.configFile."uwsm/env".text = # sh
|
||||
''
|
||||
export GDK_SCALE=${mainMonitor.scale}
|
||||
export STEAM_FORCE_DESKTOPUI_SCALING=${mainMonitor.scale}
|
||||
'';
|
||||
xdg.configFile."uwsm/env-hyprland".text = # sh
|
||||
''
|
||||
export GDK_SCALE=${mainMonitor.scale}
|
||||
export STEAM_FORCE_DESKTOPUI_SCALING=${mainMonitor.scale}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf (config.desktop.windowManager == "hyprland") {
|
||||
environment.loginShellInit = # sh
|
||||
''
|
||||
if [[ -z "$SSH_CLIENT" && -z "$SSH_CONNECTION" ]]; then
|
||||
if uwsm check may-start; then
|
||||
exec uwsm start hyprland-uwsm.desktop
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
environment.variables = {
|
||||
ELECTRON_OZONE_PLATFORM_HINT = "auto";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
withUWSM = true;
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue