From 84e220c8a78db92dbf946c7528330b864415e63d Mon Sep 17 00:00:00 2001 From: Nettika Date: Sat, 13 Jul 2024 22:32:24 -0700 Subject: [PATCH] Add tools.coding option --- common/coding.nix | 31 +++++++++++++++++++++++++++++++ common/default.nix | 12 ++++-------- common/secrets.nix | 13 +++++++++++++ marauder/default.nix | 26 ++++---------------------- monolith/default.nix | 19 +------------------ 5 files changed, 53 insertions(+), 48 deletions(-) create mode 100644 common/coding.nix create mode 100644 common/secrets.nix diff --git a/common/coding.nix b/common/coding.nix new file mode 100644 index 0000000..1e59e5b --- /dev/null +++ b/common/coding.nix @@ -0,0 +1,31 @@ +{ lib, config, ... }: +with lib; +{ + options = { + tools.coding = { + enable = mkEnableOption "Enable coding tools"; + }; + }; + + config = mkIf config.tools.coding.enable { + programs.git = { + enable = true; + lfs.enable = true; + config = { + init.defaultBranch = "master"; + user = { + email = "git@nettika.cat"; + name = "Nettika"; + }; + credential.helper = "store"; + }; + }; + programs.nano = { + enable = true; + nanorc = '' + set autoindent + set linenumbers + ''; + }; + }; +} diff --git a/common/default.nix b/common/default.nix index e0518bc..b22d840 100755 --- a/common/default.nix +++ b/common/default.nix @@ -1,11 +1,7 @@ { pkgs, lib, config, ... }: -with lib; { - options.tools.secrets = { - enable = mkEnableOption "Enable secret-management tools"; - }; - - config = mkIf config.tools.secrets.enable { - environment.systemPackages = [ pkgs.git-crypt ]; - }; + imports = [ + ./coding.nix + ./secrets.nix + ]; } diff --git a/common/secrets.nix b/common/secrets.nix new file mode 100644 index 0000000..1ad301f --- /dev/null +++ b/common/secrets.nix @@ -0,0 +1,13 @@ +{ lib, config, pkgs, ... }: +with lib; +{ + options = { + tools.secrets = { + enable = mkEnableOption "Enable secret-management tools"; + }; + }; + + config = mkIf config.tools.secrets.enable { + environment.systemPackages = [ pkgs.git-crypt ]; + }; +} diff --git a/marauder/default.nix b/marauder/default.nix index 8e170dd..7279141 100755 --- a/marauder/default.nix +++ b/marauder/default.nix @@ -53,7 +53,6 @@ }; }; - users.users = { nettika = { isNormalUser = true; @@ -69,6 +68,10 @@ enable = true; }; + tools.coding = { + enable = true; + }; + environment.systemPackages = with pkgs; [ # Chat clients discord @@ -93,27 +96,6 @@ obsidian ]; - programs.git = { - enable = true; - lfs.enable = true; - config = { - init.defaultBranch = "master"; - user = { - email = "git@nettika.cat"; - name = "Nettika"; - }; - credential.helper = "store"; - }; - }; - - programs.nano = { - enable = true; - nanorc = '' - set autoindent - set linenumbers - ''; - }; - programs.steam = { enable = true; remotePlay.openFirewall = true; diff --git a/monolith/default.nix b/monolith/default.nix index b0dbd72..2ac8c25 100755 --- a/monolith/default.nix +++ b/monolith/default.nix @@ -41,25 +41,8 @@ enable = true; }; - programs.git = { + tools.coding = { enable = true; - lfs.enable = true; - config = { - init.defaultBranch = "master"; - user = { - email = "git@nettika.cat"; - name = "Nettika"; - }; - credential.helper = "store"; - }; - }; - - programs.nano = { - enable = true; - nanorc = '' - set autoindent - set linenumbers - ''; }; services.openssh = {