nix-da/options/services/nysh.nix

40 lines
799 B
Nix

{
lib,
inputs',
config,
pkgs,
...
}:
let
inherit (lib) mkEnableOption mkOption mkIf;
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 = mkIf cfg.enable {
systemd.user.services.nysh = {
path = [
pkgs.curl
pkgs.brightnessctl
pkgs.networkmanager
];
wantedBy = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "/bin/sh -lc ${cfg.package}/bin/nysh";
Restart = "on-failure";
NoNewPrivileges = true;
};
};
};
}