This commit is contained in:
Lucy Hochkamp 2025-03-23 16:02:52 +01:00
parent 62df62c3aa
commit db11846811
No known key found for this signature in database
27 changed files with 887 additions and 64 deletions

View file

@ -0,0 +1,48 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.xyno.desktop.swayidle;
makoConf = pkgs.writeText "mako.conf" ''
font=Source Sans Pro Nerd Font 11
background-color=#1d2021ff
border-color=#3c3836FF
text-color=#ebdbb2ff
progress-color=over #928374FF
'';
in
{
options.xyno.desktop.swayidle.enable = lib.mkEnableOption "enable swayidle and swaylock and stuff";
options.xyno.desktop.swayidle.wantedBy = lib.mkOption {
type = lib.types.str;
default = "niri.service";
};
options.xyno.desktop.swayidle.package = lib.mkOption {
type = lib.types.package;
default = pkgs.swayidle;
};
options.xyno.desktop.swayidle.swaylockPackage = lib.mkOption {
type = lib.types.package;
default = pkgs.swaylock-effects;
};
options.xyno.desktop.swayidle.swaylockArgs = lib.mkOption {
type = lib.types.str;
default = "--fade-in 2 --clock --timestr %T%z --datestr %F";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with cfg; [ package swaylockPackage ];
systemd.user.services.mako = {
unitConfig.PartOf = "graphical-session.target";
unitConfig.After = "graphical-session.target";
unitConfig.Requisite = "graphical-session.target";
serviceConfig.Restart = "on-failure";
wantedBy = [ cfg.wantedBy ];
script = "${cfg.package}/bin/mako -c ${makoConf}";
restartTrigers = makoConf;
};
};
}