mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 04:19:19 -08:00
feat: heheehee
This commit is contained in:
parent
6a1dce4b4e
commit
a16524d215
6 changed files with 133 additions and 125 deletions
42
modules/home/konawall.nix
Normal file
42
modules/home/konawall.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{ inputs, lib, pkgs, config, ... }: let
|
||||
inherit (lib.options) mkOption mkEnableOption mkPackageOption;
|
||||
inherit (lib.types) submodule path nullOr;
|
||||
inherit (lib.modules) mkIf;
|
||||
cfg = config.programs.konawall-py;
|
||||
in {
|
||||
options.programs.konawall-py = {
|
||||
enable = mkEnableOption "konawall, the wallpaper manager";
|
||||
package = mkPackageOption inputs.konawall-py.packages.${pkgs.system} "konawall-py" {};
|
||||
settings = mkOption {
|
||||
type = submodule {
|
||||
freeformType = (pkgs.formats.toml {}).type;
|
||||
};
|
||||
default = {};
|
||||
};
|
||||
environmentFile = mkOption {
|
||||
type = nullOr path;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [
|
||||
cfg.package
|
||||
];
|
||||
xdg.configFile."konawall/config.toml".source = (pkgs.formats.toml {}).generate "konawall-config" cfg.settings;
|
||||
|
||||
systemd.user.services.konawall-py = {
|
||||
Unit = {
|
||||
Description = "konawall-py";
|
||||
X-Restart-Triggers = [(toString config.xdg.configFile."konawall/config.toml".source)];
|
||||
After = ["graphical-session.target" "network-online.target"];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${cfg.package}/bin/konawall";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "1s";
|
||||
EnvironmentFile = cfg.environmentFile;
|
||||
};
|
||||
Install = {WantedBy = ["graphical-session.target"];};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue