feat: systemctl
This commit is contained in:
parent
57a6f61802
commit
b8f1295953
4 changed files with 32 additions and 21 deletions
|
@ -30,6 +30,7 @@ in {
|
||||||
ripgrep = enabled;
|
ripgrep = enabled;
|
||||||
ssh = enabled;
|
ssh = enabled;
|
||||||
starship = enabled;
|
starship = enabled;
|
||||||
|
systemctl = enabled;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
./ripgrep.nix
|
./ripgrep.nix
|
||||||
./ssh.nix
|
./ssh.nix
|
||||||
./starship
|
./starship
|
||||||
|
./systemctl.nix
|
||||||
./waybar.nix
|
./waybar.nix
|
||||||
|
|
||||||
# TODO: uncomment when swaylock is figured out
|
# TODO: uncomment when swaylock is figured out
|
||||||
|
|
30
modules/home/programs/systemctl.nix
Normal file
30
modules/home/programs/systemctl.nix
Normal 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}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -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";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in a new issue