nix-da/options/nysh.nix

36 lines
726 B
Nix

{
lib,
inputs',
config,
...
}:
let
inherit (lib) mkEnableOption mkOption;
inherit (lib.types) package;
cfg = config.modules.services.nysh;
in
{
options.modules.services.nysh = {
enable = mkEnableOption "nysh";
package = mkOption {
type = package;
default = inputs'.nysh.packages.nysh;
};
};
config = {
systemd.user.services.nysh = {
wantedBy = [ "graphical-session.target" ];
unitConfig = {
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
serviceConfig = {
Type = "simple";
ExecStart = "/bin/sh -lc ${cfg.package}/bin/nysh";
Restart = "on-failure";
};
};
};
}