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
|
@ -34,6 +34,7 @@ in
|
||||||
inputs
|
inputs
|
||||||
system
|
system
|
||||||
pkgs
|
pkgs
|
||||||
|
osConfig
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
lib,
|
lib,
|
||||||
inputs,
|
inputs,
|
||||||
system,
|
system,
|
||||||
|
osConfig,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
@ -15,4 +16,5 @@ mkMerge [
|
||||||
(import ./media-player.nix)
|
(import ./media-player.nix)
|
||||||
(import ./status-bar.nix { inherit pkgs; })
|
(import ./status-bar.nix { inherit pkgs; })
|
||||||
(import ./terminal.nix)
|
(import ./terminal.nix)
|
||||||
|
(import ./window-manager { inherit pkgs osConfig lib; })
|
||||||
]
|
]
|
||||||
|
|
11
homes/x86_64-linux/rafiq/desktop/window-manager/default.nix
Normal file
11
homes/x86_64-linux/rafiq/desktop/window-manager/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
osConfig,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
wayland.windowManager.hyprland.settings = import ./hyprland/settings.nix {
|
||||||
|
inherit pkgs osConfig lib;
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
osConfig,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (lib) mkMerge;
|
||||||
|
inherit (osConfig.desktop) mainMonitor;
|
||||||
|
in
|
||||||
|
mkMerge [
|
||||||
|
(import ./decoration.nix)
|
||||||
|
(import ./keybinds.nix { inherit pkgs; })
|
||||||
|
{
|
||||||
|
ecosystem.no_update_news = true;
|
||||||
|
xwayland.force_zero_scaling = true;
|
||||||
|
|
||||||
|
monitor = [
|
||||||
|
"${mainMonitor.id}, ${mainMonitor.resolution}@${mainMonitor.refresh-rate}, auto, ${mainMonitor.scale}"
|
||||||
|
", preferred, auto, 1"
|
||||||
|
];
|
||||||
|
|
||||||
|
exec-once = [
|
||||||
|
"uwsm app -- $LOCKSCREEN"
|
||||||
|
"uwsm app -- $NOTIFICATION_DAEMON"
|
||||||
|
"uwsm app -- $STATUS_BAR"
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
|
]
|
|
@ -11,15 +11,7 @@ let
|
||||||
inherit (lib) mkMerge mkIf mkEnableOption;
|
inherit (lib) mkMerge mkIf mkEnableOption;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.desktop = {
|
|
||||||
wayland.enableUtils = mkEnableOption "common Wayland utilities";
|
|
||||||
};
|
|
||||||
config = mkIf upstreamCfg.enable (mkMerge [
|
config = mkIf upstreamCfg.enable (mkMerge [
|
||||||
(mkIf cfg.wayland.enableUtils {
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
wl-clipboard-rs
|
|
||||||
];
|
|
||||||
})
|
|
||||||
(lib.mkIf (osConfig.hardware.gpu == "nvidia") {
|
(lib.mkIf (osConfig.hardware.gpu == "nvidia") {
|
||||||
home.packages = [ pkgs.stable-diffusion-webui.forge.cuda ];
|
home.packages = [ pkgs.stable-diffusion-webui.forge.cuda ];
|
||||||
home.persistence."/persist/home/${config.snowfallorg.user.name}".directories = [
|
home.persistence."/persist/home/${config.snowfallorg.user.name}".directories = [
|
||||||
|
|
|
@ -1,48 +0,0 @@
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
osConfig,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
inherit (osConfig.desktop) mainMonitor;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
config = lib.mkIf (osConfig.desktop.windowManager == "hyprland") {
|
|
||||||
desktop.wayland.enableUtils = true;
|
|
||||||
wayland.windowManager.hyprland = {
|
|
||||||
enable = true;
|
|
||||||
systemd.enable = false;
|
|
||||||
settings = lib.mkMerge [
|
|
||||||
{
|
|
||||||
ecosystem.no_update_news = true;
|
|
||||||
|
|
||||||
monitor = [
|
|
||||||
"${mainMonitor.id}, ${mainMonitor.resolution}@${mainMonitor.refresh-rate}, auto, ${mainMonitor.scale}"
|
|
||||||
", preferred, auto, 1"
|
|
||||||
];
|
|
||||||
|
|
||||||
exec-once = [
|
|
||||||
"uwsm app -- $LOCKSCREEN"
|
|
||||||
"uwsm app -- $NOTIFICATION_DAEMON"
|
|
||||||
"uwsm app -- $STATUS_BAR"
|
|
||||||
];
|
|
||||||
|
|
||||||
xwayland.force_zero_scaling = true;
|
|
||||||
}
|
|
||||||
(import ./decoration.nix)
|
|
||||||
(import ./keybinds.nix { inherit pkgs; })
|
|
||||||
];
|
|
||||||
};
|
|
||||||
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}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -5,23 +5,21 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (lib) mkEnableOption;
|
inherit (lib) mkEnableOption mkIf singleton;
|
||||||
inherit (lib.pantheon) mkStrOption;
|
inherit (lib.pantheon) mkStrOption;
|
||||||
|
inherit (pkgs) wl-clipboard-rs;
|
||||||
|
cfg = config.desktop;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
|
||||||
./windowManager.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
options.desktop = {
|
options.desktop = {
|
||||||
enable = mkEnableOption "";
|
enable = mkEnableOption "";
|
||||||
|
enableWaylandUtilities = mkEnableOption "";
|
||||||
mainMonitor = {
|
mainMonitor = {
|
||||||
id = mkStrOption;
|
id = mkStrOption;
|
||||||
scale = lib.pantheon.mkStrOption;
|
scale = lib.pantheon.mkStrOption;
|
||||||
resolution = lib.pantheon.mkStrOption;
|
resolution = lib.pantheon.mkStrOption;
|
||||||
refresh-rate = lib.pantheon.mkStrOption;
|
refresh-rate = lib.pantheon.mkStrOption;
|
||||||
};
|
};
|
||||||
windowManager = lib.pantheon.mkStrOption;
|
|
||||||
enableSpotifyd = lib.mkEnableOption "";
|
enableSpotifyd = lib.mkEnableOption "";
|
||||||
enableSteam = lib.mkEnableOption "";
|
enableSteam = lib.mkEnableOption "";
|
||||||
enableVR = lib.mkEnableOption "";
|
enableVR = lib.mkEnableOption "";
|
||||||
|
@ -34,6 +32,9 @@ in
|
||||||
font-awesome
|
font-awesome
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
(mkIf cfg.enableWaylandUtilities {
|
||||||
|
home-manager.sharedModules = singleton { home.packages = [ wl-clipboard-rs ]; };
|
||||||
|
})
|
||||||
(lib.mkIf config.desktop.enableSteam {
|
(lib.mkIf config.desktop.enableSteam {
|
||||||
programs.steam = {
|
programs.steam = {
|
||||||
enable = true;
|
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;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -8,7 +8,7 @@
|
||||||
notification-daemon.mako.enable = true;
|
notification-daemon.mako.enable = true;
|
||||||
status-bar.waybar.enable = true;
|
status-bar.waybar.enable = true;
|
||||||
terminal.ghostty.enable = true;
|
terminal.ghostty.enable = true;
|
||||||
windowManager = "hyprland";
|
window-manager.hyprland.enable = true;
|
||||||
enableSpotifyd = true;
|
enableSpotifyd = true;
|
||||||
enableSteam = true;
|
enableSteam = true;
|
||||||
enableVR = true;
|
enableVR = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue