feat: systemctl

This commit is contained in:
punkfairie 2025-05-31 12:38:30 -07:00
parent 57a6f61802
commit b8f1295953
Signed by: punkfairie
GPG key ID: B3C5488E9A1A7CA6
4 changed files with 32 additions and 21 deletions

View file

@ -30,6 +30,7 @@ in {
ripgrep = enabled;
ssh = enabled;
starship = enabled;
systemctl = enabled;
};
}
#

View file

@ -27,6 +27,7 @@
./ripgrep.nix
./ssh.nix
./starship
./systemctl.nix
./waybar.nix
# TODO: uncomment when swaylock is figured out

View file

@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.marleyos.programs.systemctl;
in {
options.marleyos.programs.systemctl.enable = lib.mkEnableOption "systemctl";
config = lib.mkIf (cfg.enable && pkgs.stdenv.isLinux) {
home.shellAbbrs = rec {
sctl = "systemctl";
sctls = "systemctl status";
sctle = "systemctl enable --now";
sctld = "systemctl disable --now";
sctlr = "systemctl restart";
sctla = "systemctl start";
sctlo = "systemctl stop";
ssctl = "sudo ${sctl}";
ssctls = "sudo ${sctls}";
ssctle = "sudo ${sctle}";
ssctld = "sudo ${sctld}";
ssctlr = "sudo ${sctlr}";
ssctla = "sudo ${sctla}";
ssctlo = "sudo ${sctlo}";
};
};
}

View file

@ -1,21 +0,0 @@
{
lib,
config,
...
}: let
cfg = config.marleyos.programs.systemctl;
in {
options.marleyos.programs.systemctl.enable = lib.mkEnableOption "systemctl";
config = lib.mkIf cfg.enable {
home.shellAbbrs = {
sctl = "sudo systemctl";
sctls = "sudo systemctl status";
sctle = "sudo systemctl enable --now";
sctld = "sudo systemctl disable --now";
sctlr = "sudo systemctl restart";
sctla = "sudo systemctl start";
sctlo = "sudo systemctl stop";
};
};
}