From a3979f544a4b0c2303b49de70d7e535d7a8e2cf8 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Fri, 15 Nov 2024 22:18:13 -0800 Subject: [PATCH] feat(home): Journalctl & Systemctl --- modules/home/programs/journalctl/default.nix | 22 ++++++++++++++++ modules/home/programs/systemctl/default.nix | 27 ++++++++++++++++++++ old/home/services/default.nix | 21 --------------- 3 files changed, 49 insertions(+), 21 deletions(-) create mode 100644 modules/home/programs/journalctl/default.nix create mode 100644 modules/home/programs/systemctl/default.nix delete mode 100644 old/home/services/default.nix diff --git a/modules/home/programs/journalctl/default.nix b/modules/home/programs/journalctl/default.nix new file mode 100644 index 0000000..2c16a3e --- /dev/null +++ b/modules/home/programs/journalctl/default.nix @@ -0,0 +1,22 @@ +{ + lib, + config, + namespace, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkEnableModule; + + cfg = config.${namespace}.programs.journalctl; +in +{ + options.programs = mkEnableModule "journalctl"; + + config = mkIf cfg.enable { + home.shellAbbrs = { + jctlf = "sudo journalctl --follow --unit"; + jctle = "sudo journalctl --pager-end --unit"; + }; + }; +} diff --git a/modules/home/programs/systemctl/default.nix b/modules/home/programs/systemctl/default.nix new file mode 100644 index 0000000..5c8a736 --- /dev/null +++ b/modules/home/programs/systemctl/default.nix @@ -0,0 +1,27 @@ +{ + lib, + config, + namespace, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkEnableModule; + + cfg = config.${namespace}.programs.systemctl; +in +{ + options.programs = mkEnableModule "systemctl"; + + config = 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"; + }; + }; +} diff --git a/old/home/services/default.nix b/old/home/services/default.nix deleted file mode 100644 index 121c527..0000000 --- a/old/home/services/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ ... }: -{ - home.shellAbbrs = { - jctlf = "sudo journalctl --follow --unit"; - jctle = "sudo journalctl --pager-end --unit"; - - 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"; - }; - - imports = [ - ./clipboard.nix - ./dunst.nix - ./syncthing.nix - ]; -}