Switch to uwsm

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-06-03 13:00:07 +01:00
parent 1f44a8b6bc
commit b12fa0e811
19 changed files with 153 additions and 190 deletions

36
flake.lock generated
View File

@@ -31,11 +31,11 @@
]
},
"locked": {
"lastModified": 1748505737,
"narHash": "sha256-289InRDisoGlKbs4wvWfoNLJJaoBXd2Vq0cxi7PR+d0=",
"lastModified": 1748845209,
"narHash": "sha256-fWfMFjKNxzGjqW2XZHDg6cSyHcir8rk8ev9DHo2YkTA=",
"owner": "aylur",
"repo": "astal",
"rev": "2f2f23133dfd1d8068ffc238579eecd6a5c4e4a9",
"rev": "7f2292f0792ffc9b127d4788b3dd3f104b5374b2",
"type": "github"
},
"original": {
@@ -52,11 +52,11 @@
]
},
"locked": {
"lastModified": 1748225455,
"narHash": "sha256-AzlJCKaM4wbEyEpV3I/PUq5mHnib2ryEy32c+qfj6xk=",
"lastModified": 1748832438,
"narHash": "sha256-/CtyLVfNaFP7PrOPrTEuGOJBIhcBKVQ91KiEbtXJi0A=",
"owner": "nix-community",
"repo": "disko",
"rev": "a894f2811e1ee8d10c50560551e50d6ab3c392ba",
"rev": "58d6e5a83fff9982d57e0a0a994d4e5c0af441e4",
"type": "github"
},
"original": {
@@ -115,11 +115,11 @@
]
},
"locked": {
"lastModified": 1748523756,
"narHash": "sha256-Dp7jYh9sPQw6G7ob3pJnjBzkxxFWir17yhlzAPnYJPs=",
"lastModified": 1748939465,
"narHash": "sha256-fOiTgpPr066aliyPWQvP3ckvH1pvUFx660U4GVysYyM=",
"owner": "karaolidis",
"repo": "home-manager",
"rev": "205adabdcae88eb5eab5b2c2dbe2a74f8be21f23",
"rev": "9168d85abbf984b7f0891095405841212dfd3f8b",
"type": "github"
},
"original": {
@@ -131,11 +131,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1748529242,
"narHash": "sha256-JA6sGuGPTCY6rDMpAP1BopvVNyawjBuW1gaAWnMWnRw=",
"lastModified": 1748939429,
"narHash": "sha256-IrdLwKWucb9xj1dOpbXHuaV1GzHYx51ZGF4wbl5NPwU=",
"owner": "karaolidis",
"repo": "nixpkgs",
"rev": "c2332b8df21fbf1b0839c99aca528133edf70c7f",
"rev": "7b041169050f5a7b6a15bacdb68a935cee995fe7",
"type": "github"
},
"original": {
@@ -156,11 +156,11 @@
]
},
"locked": {
"lastModified": 1748523337,
"narHash": "sha256-7JsRh/WVZWy4rS/fmknkcJlIpjfkk+8h0/FddtiSJ5M=",
"lastModified": 1748935843,
"narHash": "sha256-ZTbwljoJXgkGAPlYz0GIcNiXQNfPFHe2A0Dqe9KDyPA=",
"owner": "nix-community",
"repo": "NUR",
"rev": "50a65345d91b37457c947f37afd93cfe07cdeea7",
"rev": "032af0a65aa867a6209718033995f5ba73fee543",
"type": "github"
},
"original": {
@@ -233,11 +233,11 @@
]
},
"locked": {
"lastModified": 1748147548,
"narHash": "sha256-9IaAQkgyF4PFtVyui8vF6oJah0iVcO9DaOefjdTMthE=",
"lastModified": 1748752728,
"narHash": "sha256-en008ncPUQjVx2i3PbM4RWeZkD9DNbJwIy0epppXe2o=",
"owner": "Gerg-L",
"repo": "spicetify-nix",
"rev": "f0595e3b59260457042450749eaec00a5a47db35",
"rev": "0e03de40d5128eb2ad600c98f57cf5db2cdf3240",
"type": "github"
},
"original": {

View File

@@ -4,7 +4,7 @@ export default () => (
<button
className="launcher"
onClickRelease={() =>
execAsync('bash -c "rofi -cache-dir $XDG_CACHE_HOME/rofi -show drun"')
execAsync('bash -c "rofi -cache-dir $XDG_CACHE_HOME/rofi -show drun -run-command \"uwsm app -- {cmd}\""')
}
>
<icon className="icon" icon="nix-snowflake-symbolic" />;

View File

@@ -39,6 +39,8 @@ in
theme.template.".config/astal/theme.sass".source = ./theme.sass;
systemd.user = {
services.ags.Unit.After = [ "graphical-session.target" ];
targets.tray.Unit = {
BindsTo = [ "ags.service" ];
After = [

View File

@@ -11,8 +11,5 @@
{
services.blueman.enable = true;
home-manager.users.${user} = {
services.blueman-applet.enable = true;
systemd.user.services.blueman-applet.Unit.After = [ "graphical-session.target" ];
};
home-manager.users.${user}.services.blueman-applet.enable = true;
}

View File

@@ -1,21 +0,0 @@
{
user ? throw "user argument is required",
home ? throw "home argument is required",
}:
{
config,
lib,
pkgs,
...
}:
{
home-manager.users.${user} = {
services.cbatticon = {
enable = true;
lowLevelPercent = 20;
criticalLevelPercent = 10;
};
systemd.user.services.cbatticon.Unit.After = [ "graphical-session.target" ];
};
}

View File

@@ -21,23 +21,26 @@ in
cliphist = {
Unit = {
Description = "Clipboard manager";
BindsTo = [ "graphical-session.target" ];
After = [
"graphical-session.target"
config.environment.persistence."/persist/cache"."${home}/.cache/cliphist".mount
];
PartOf = [ "graphical-session.target" ];
};
Service.ExecStart = lib.meta.getExe (
pkgs.writeShellApplication {
name = "init-cliphist";
runtimeInputs = with pkgs; [
wl-clipboard
cliphist
];
text = "exec wl-paste --watch cliphist store";
}
);
Service = {
ExecStart = lib.meta.getExe (
pkgs.writeShellApplication {
name = "init-cliphist";
runtimeInputs = with pkgs; [
wl-clipboard
cliphist
];
text = "exec wl-paste --watch cliphist store";
}
);
Restart = "on-failure";
};
Install.WantedBy = [ "graphical-session.target" ];
};
@@ -45,23 +48,26 @@ in
cliphist-image = {
Unit = {
Description = "Clipboard manager (images)";
BindsTo = [ "graphical-session.target" ];
After = [
"graphical-session.target"
config.environment.persistence."/persist/cache"."${home}/.cache/cliphist".mount
];
PartOf = [ "graphical-session.target" ];
};
Service.ExecStart = lib.meta.getExe (
pkgs.writeShellApplication {
name = "init-cliphist-image";
runtimeInputs = with pkgs; [
wl-clipboard
cliphist
];
text = "exec wl-paste --type image --watch cliphist store";
}
);
Service = {
ExecStart = lib.meta.getExe (
pkgs.writeShellApplication {
name = "init-cliphist-image";
runtimeInputs = with pkgs; [
wl-clipboard
cliphist
];
text = "exec wl-paste --type image --watch cliphist store";
}
);
Restart = "on-failure";
};
Install.WantedBy = [ "graphical-session.target" ];
};

View File

@@ -20,13 +20,17 @@
})
];
programs.hyprland.enable = true;
programs.hyprland = {
enable = true;
withUWSM = true;
};
home-manager.users.${user} = {
imports = [ ./options.nix ];
wayland.windowManager.hyprland = {
enable = true;
systemd.enable = false;
settings = {
"$mod" = "Super";
@@ -47,7 +51,7 @@
);
in
[
"$mod, Return, exec, $term"
"$mod, Return, exec, uwsm app -- $term"
"$mod, 1, exec, ${bindHelper} 1"
"$mod, 2, exec, ${bindHelper} 2"
@@ -96,7 +100,7 @@
"$mod, Space, centerwindow"
"$mod, q, killactive"
"Ctrl_Alt, Delete, exit"
"Ctrl_Alt, Delete, exec, uwsm stop"
];
binde = [
@@ -157,8 +161,8 @@
};
programs.zsh.loginExtra = lib.mkAfter ''
if [ -z "$WAYLAND_DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then
Hyprland 2> >(systemd-cat -p err -t hyprland) 1> >(systemd-cat -p info -t hyprland)
if uwsm check may-start; then
exec uwsm start hyprland-uwsm.desktop
fi
'';

View File

@@ -12,18 +12,6 @@ in
with lib;
with types;
{
initExtraConfig = mkOption {
type = lines;
default = "";
description = "Extra configuration lines to add to exec-once";
};
reloadExtraConfig = mkOption {
type = lines;
default = "";
description = "Extra configuration lines to add to exec";
};
onMonitorChange.services = mkOption {
type = listOf str;
default = [ ];
@@ -31,37 +19,29 @@ in
};
};
config = {
wayland.windowManager.hyprland.initExtraConfig =
lib.mkIf (cfg.onMonitorChange.services != [ ])
"${
lib.meta.getExe (
pkgs.writeShellApplication {
name = "hyprland-monitor-change-services";
runtimeInputs = with pkgs; [
socat
systemd
];
runtimeEnv.SERVICES = lib.strings.concatStringsSep " " cfg.onMonitorChange.services;
text = builtins.readFile ./scripts/monitors.sh;
}
)
} &";
wayland.windowManager.hyprland.settings = {
exec-once = lib.meta.getExe (
pkgs.writeShellApplication {
name = "init-hyprland";
text = cfg.initExtraConfig;
}
);
exec = lib.meta.getExe (
pkgs.writeShellApplication {
name = "reload-hyprland";
text = cfg.reloadExtraConfig;
}
);
config.systemd.user.services.hyprland-monitor-watcher = {
Unit = {
Description = "Restarts services on monitor change";
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
ExecStart = lib.meta.getExe (
pkgs.writeShellApplication {
name = "hyprland-monitor-watcher";
runtimeInputs = with pkgs; [
socat
systemd
];
runtimeEnv.SERVICES = lib.strings.concatStringsSep " " cfg.onMonitorChange.services;
text = builtins.readFile ./scripts/monitors.sh;
}
);
Restart = "on-failure";
};
Install.WantedBy = [ "graphical-session.target" ];
};
}

View File

@@ -33,17 +33,17 @@
);
in
[
", Print, exec, ${hyprshot} -m output -m active -f ${filename}"
"Ctrl, Print, exec, ${hyprshot} -m output -m active -f ${filename} -- ${swappyWrapper}"
", Print, exec, uwsm app -- ${hyprshot} -m output -m active -f ${filename}"
"Ctrl, Print, exec, uwsm app -- ${hyprshot} -m output -m active -f ${filename} -- ${swappyWrapper}"
"$mod, s, exec, ${hyprshot} -m output -m active -f ${filename}"
"$mod_Ctrl, s, exec, ${hyprshot} -m output -m active -f ${filename} -- ${swappyWrapper}"
"$mod, s, exec, uwsm app -- ${hyprshot} -m output -m active -f ${filename}"
"$mod_Ctrl, s, exec, uwsm app -- ${hyprshot} -m output -m active -f ${filename} -- ${swappyWrapper}"
", XF86SelectiveScreenshot, exec, ${hyprshot} -m region -z -f ${filename}"
"Ctrl, XF86SelectiveScreenshot, exec, ${hyprshot} -m region -z -f ${filename} -- ${swappyWrapper}"
", XF86SelectiveScreenshot, exec, uwsm app -- ${hyprshot} -m region -z -f ${filename}"
"Ctrl, XF86SelectiveScreenshot, exec, uwsm app -- ${hyprshot} -m region -z -f ${filename} -- ${swappyWrapper}"
"$mod_Shift, S, exec, ${hyprshot} -m region -z -f ${filename}"
"$mod_Shift_Ctrl, S, exec, ${hyprshot} -m region -z -f ${filename} -- ${swappyWrapper}"
"$mod_Shift, S, exec, uwsm app -- ${hyprshot} -m region -z -f ${filename}"
"$mod_Shift_Ctrl, S, exec, uwsm app -- ${hyprshot} -m region -z -f ${filename} -- ${swappyWrapper}"
];
};
}

View File

@@ -7,6 +7,5 @@
home-manager.users.${user} = {
home.packages = with pkgs; [ networkmanagerapplet ];
services.network-manager-applet.enable = true;
systemd.user.services.network-manager-applet.Unit.After = [ "graphical-session.target" ];
};
}

View File

@@ -35,7 +35,7 @@
};
wayland.windowManager.hyprland.settings = {
bind = [ ", XF86Calculator, exec, ${lib.meta.getExe pkgs.qalculate-gtk}" ];
bind = [ ", XF86Calculator, exec, uwsm app -- ${lib.meta.getExe pkgs.qalculate-gtk}" ];
windowrulev2 = [ "float, class:(qalculate-gtk)" ];
};
};

View File

@@ -22,7 +22,7 @@ in
};
wayland.windowManager.hyprland.settings.bind = [
"$mod, r, exec, ${lib.meta.getExe hmConfig.programs.rofi.finalPackage} -cache-dir ${home}/.cache/rofi -modi drun,window -show drun"
"$mod, r, exec, ${lib.meta.getExe hmConfig.programs.rofi.finalPackage} -cache-dir ${home}/.cache/rofi -modi drun,window -show drun -run-command \"uwsm app -- {cmd}\""
];
};
}

View File

@@ -20,6 +20,7 @@
localNetworkGameTransfers.openFirewall = true;
extest.enable = true;
protontricks.enable = true;
extraCompatPackages = with pkgs; [ proton-ge-bin ];
};
gamescope = {
@@ -33,53 +34,47 @@
gamemode.enable = true;
};
home-manager.users.${user} = {
systemd.user = {
services.steam-ln =
let
steamLn = lib.meta.getExe (
pkgs.writeShellApplication {
name = "steam-ln";
runtimeInputs = with pkgs; [ coreutils ];
text = builtins.readFile ./steam-ln.sh;
}
);
in
{
Unit = {
Description = "Sync Steam games with Games directory";
After = [
config.environment.persistence."/persist/state"."${home}/.local/share/Steam".mount
config.environment.persistence."/persist/user"."${home}/Games".mount
];
DefaultDependencies = false;
};
Service = {
ExecStart = steamLn;
Type = "oneshot";
};
Install.WantedBy = [ "graphical-session.target" ];
};
paths.steam-ln = {
home-manager.users.${user}.systemd.user = {
services.steam-ln =
let
steamLn = lib.meta.getExe (
pkgs.writeShellApplication {
name = "steam-ln";
runtimeInputs = with pkgs; [ coreutils ];
text = builtins.readFile ./steam-ln.sh;
}
);
in
{
Unit = {
Description = "Monitor Steam games directory for changes";
Description = "Sync Steam games with Games directory";
After = [
config.environment.persistence."/persist/state"."${home}/.local/share/Steam".mount
config.environment.persistence."/persist/user"."${home}/Games".mount
];
DefaultDependencies = false;
};
Path.PathChanged = "${home}/.local/share/Steam/steamapps/common";
Install.WantedBy = [ "graphical-session.target" ];
};
};
Service = {
ExecStart = steamLn;
Type = "oneshot";
};
home = {
packages = with pkgs; [ protonup ];
sessionVariables.STEAM_EXTRA_COMPAT_TOOLS_PATHS = "${home}/.steam/root/compatibilitytools.d";
Install.WantedBy = [ "default.target" ];
};
paths.steam-ln = {
Unit = {
Description = "Monitor Steam games directory for changes";
After = [
config.environment.persistence."/persist/state"."${home}/.local/share/Steam".mount
config.environment.persistence."/persist/user"."${home}/Games".mount
];
};
Path.PathChanged = "${home}/.local/share/Steam/steamapps/common";
Install.WantedBy = [ "default.target" ];
};
};
}

View File

@@ -34,21 +34,19 @@ in
systemd.user.services.swww = {
Unit = {
Description = "Wallpaper daemon";
BindsTo = [ "graphical-session.target" ];
After = [
"graphical-session.target"
config.environment.persistence."/persist/cache"."${home}/.cache/swww".mount
];
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "forking";
ExecStart = lib.meta.getExe (
pkgs.writeShellApplication {
name = "init-swww";
runtimeInputs = with pkgs; [ swww ];
text = "exec swww init";
text = "exec swww-daemon -q";
}
);
@@ -61,6 +59,8 @@ in
text = "exec swww kill";
}
);
Restart = "on-failure";
};
Install.WantedBy = [ "graphical-session.target" ];

View File

@@ -49,8 +49,8 @@
../common/configs/system/zsh
./configs/git
./configs/globalprotect
./configs/pki
./configs/vpn
./users/nikara
];

View File

@@ -1,18 +0,0 @@
(
charge_control_end_threshold: 60,
disable_nvidia_powerd_on_battery: true,
ac_command: "",
bat_command: "",
platform_profile_linked_epp: true,
platform_profile_on_battery: Quiet,
change_platform_profile_on_battery: true,
platform_profile_on_ac: Quiet,
change_platform_profile_on_ac: true,
profile_quiet_epp: Power,
profile_balanced_epp: BalancePower,
profile_custom_epp: Performance,
profile_performance_epp: Performance,
ac_profile_tunings: {},
dc_profile_tunings: {},
armoury_settings: {},
)

View File

@@ -91,7 +91,26 @@
enable = true;
# FIXME: https://gitlab.com/asus-linux/asusctl/-/issues/532
# enableUserService = true;
asusdConfig.source = ./asusd.ron;
asusdConfig.text = ''
(
charge_control_end_threshold: 60,
disable_nvidia_powerd_on_battery: true,
ac_command: "",
bat_command: "",
platform_profile_linked_epp: true,
platform_profile_on_battery: Quiet,
change_platform_profile_on_battery: true,
platform_profile_on_ac: Quiet,
change_platform_profile_on_ac: true,
profile_quiet_epp: Power,
profile_balanced_epp: BalancePower,
profile_custom_epp: Performance,
profile_performance_epp: Performance,
ac_profile_tunings: {},
dc_profile_tunings: {},
armoury_settings: {},
)
'';
};
supergfxd = {