nix-da/options/nysh.nix

50 lines
1.1 KiB
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";
};
};
# systemd.user.services.nysh = {
#Install.WantedBy = [ "graphical-session.target" ];
#Unit = {
#After = [ "graphical-session-pre.target" ];
#PartOf = [ "graphical-session.target" ];
#};
#Service = {
#Type = "simple";
#ExecStart = "/bin/sh -lc ${cfg.package}/bin/nysh";
#Restart = "on-failure";
#};
#};
};
}