From 71b62fcb9c4ba03a87bfb4e4c95e20703dfaa024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Bori?= Date: Mon, 23 Dec 2024 23:22:21 +0100 Subject: [PATCH] :package: Added `manix` Also added sudo to make nh works with lix --- modules/home/cli/programs/manix/default.nix | 20 ++++++++++++++++++++ modules/home/roles/common/default.nix | 1 + modules/nixos/security/doas/default.nix | 8 ++++---- modules/nixos/security/sudo/default.nix | 19 +++++++++++++++++++ systems/x86_64-linux/laptop/default.nix | 1 + systems/x86_64-linux/rob/default.nix | 1 + systems/x86_64-linux/vm/default.nix | 1 + 7 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 modules/home/cli/programs/manix/default.nix create mode 100644 modules/nixos/security/sudo/default.nix diff --git a/modules/home/cli/programs/manix/default.nix b/modules/home/cli/programs/manix/default.nix new file mode 100644 index 0000000..72ce308 --- /dev/null +++ b/modules/home/cli/programs/manix/default.nix @@ -0,0 +1,20 @@ +{ + pkgs, + config, + lib, + namespace, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkBoolOpt; + + cfg = config.${namespace}.cli.programs.manix; +in +{ + options.${namespace}.cli.programs.manix = { + enable = mkBoolOpt false "Whether or not to enable manix."; + }; + + config = mkIf cfg.enable { home.packages = with pkgs; [ manix ]; }; +} diff --git a/modules/home/roles/common/default.nix b/modules/home/roles/common/default.nix index 566eb8b..c1d7bd2 100644 --- a/modules/home/roles/common/default.nix +++ b/modules/home/roles/common/default.nix @@ -38,6 +38,7 @@ in killall = enabled; file-tools = enabled; xclip = enabled; + manix = enabled; }; }; diff --git a/modules/nixos/security/doas/default.nix b/modules/nixos/security/doas/default.nix index 70fa859..dd4bc87 100644 --- a/modules/nixos/security/doas/default.nix +++ b/modules/nixos/security/doas/default.nix @@ -17,7 +17,7 @@ in config = mkIf cfg.enable { # Disable sudo - security.sudo.enable = false; + # security.sudo.enable = false; # Enable and configure `doas` security.doas = { @@ -32,8 +32,8 @@ in }; # Add an alias to the shell for backward-compat and convenience - environment.shellAliases = { - sudo = "doas"; - }; + # environment.shellAliases = { + # sudo = "doas"; + # }; }; } diff --git a/modules/nixos/security/sudo/default.nix b/modules/nixos/security/sudo/default.nix new file mode 100644 index 0000000..0eef90f --- /dev/null +++ b/modules/nixos/security/sudo/default.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + namespace, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkBoolOpt enabled; + + cfg = config.${namespace}.security.sudo; +in +{ + options.${namespace}.security.sudo = { + enable = mkBoolOpt false "Whether or not to replace sudo with sudo."; + }; + + config = mkIf cfg.enable { security.sudo = enabled; }; +} diff --git a/systems/x86_64-linux/laptop/default.nix b/systems/x86_64-linux/laptop/default.nix index 078905b..68a33b8 100644 --- a/systems/x86_64-linux/laptop/default.nix +++ b/systems/x86_64-linux/laptop/default.nix @@ -90,6 +90,7 @@ in ${namespace} = { boot.plymouth = enabled; security.doas = enabled; + security.sudo = enabled; desktops.plasma6 = enabled; display-managers.sddm = enabled; diff --git a/systems/x86_64-linux/rob/default.nix b/systems/x86_64-linux/rob/default.nix index d964464..5f9b456 100644 --- a/systems/x86_64-linux/rob/default.nix +++ b/systems/x86_64-linux/rob/default.nix @@ -30,6 +30,7 @@ in ${namespace} = { boot.plymouth = enabled; + security.sudo = enabled; security.doas = enabled; desktops.plasma6 = enabled; diff --git a/systems/x86_64-linux/vm/default.nix b/systems/x86_64-linux/vm/default.nix index d3d0f47..7166bb3 100644 --- a/systems/x86_64-linux/vm/default.nix +++ b/systems/x86_64-linux/vm/default.nix @@ -29,6 +29,7 @@ in ${namespace} = { security = { doas = enabled; + sudo = enabled; }; desktops = {