From e8077fde966e051fc449fffcfa061c7f7edc47b0 Mon Sep 17 00:00:00 2001 From: Caroline Larimore Date: Mon, 14 Apr 2025 19:01:38 -0700 Subject: migration: finalize --- modules/home/tools/bash/default.nix | 15 ++++++++++++ modules/home/tools/btop/default.nix | 15 ++++++++++++ modules/home/tools/default.nix | 15 ++++++++++++ modules/home/tools/git/default.nix | 45 +++++++++++++++++++++++++++++++++++ modules/home/tools/gpg/default.nix | 32 +++++++++++++++++++++++++ modules/home/tools/ssh/default.nix | 20 ++++++++++++++++ modules/home/tools/tmux/default.nix | 15 ++++++++++++ modules/home/tools/vim/default.nix | 43 +++++++++++++++++++++++++++++++++ modules/home/tools/zoxide/default.nix | 15 ++++++++++++ 9 files changed, 215 insertions(+) create mode 100644 modules/home/tools/bash/default.nix create mode 100644 modules/home/tools/btop/default.nix create mode 100644 modules/home/tools/default.nix create mode 100644 modules/home/tools/git/default.nix create mode 100644 modules/home/tools/gpg/default.nix create mode 100644 modules/home/tools/ssh/default.nix create mode 100644 modules/home/tools/tmux/default.nix create mode 100644 modules/home/tools/vim/default.nix create mode 100644 modules/home/tools/zoxide/default.nix (limited to 'modules/home/tools') diff --git a/modules/home/tools/bash/default.nix b/modules/home/tools/bash/default.nix new file mode 100644 index 0000000..d0f0d9d --- /dev/null +++ b/modules/home/tools/bash/default.nix @@ -0,0 +1,15 @@ +{ options, config, lib, pkgs, namespace, ... }: + +with lib; with lib.${namespace}; let + cfg = config.${namespace}.tools.bash; +in { + options.${namespace}.tools.bash = with types; { + enable = mkEnableOption "bash"; + }; + + config = mkIf cfg.enable { + programs.bash = { + enable = true; + }; + }; +} diff --git a/modules/home/tools/btop/default.nix b/modules/home/tools/btop/default.nix new file mode 100644 index 0000000..87528a1 --- /dev/null +++ b/modules/home/tools/btop/default.nix @@ -0,0 +1,15 @@ +{ options, config, lib, namespace, ... }: + +with lib; with lib.${namespace}; let + cfg = config.${namespace}.tools.btop; +in { + options.${namespace}.tools.btop = with types; { + enable = mkEnableOption "btop"; + }; + + config = mkIf cfg.enable { + programs.btop = { + enable = true; + }; + }; +} diff --git a/modules/home/tools/default.nix b/modules/home/tools/default.nix new file mode 100644 index 0000000..9627d0f --- /dev/null +++ b/modules/home/tools/default.nix @@ -0,0 +1,15 @@ +{ lib, pkgs, namespace, ... }: + +with lib; with lib.${namespace}; { + imports = with pkgs; [ + (mkSimpleTool "cloc" {}) + (mkSimpleTool "ffmpeg" {}) + (mkSimpleTool "wine" { + packages = [ + wineWowPackages.stable + winetricks + ]; + persist = [ ".wine" ]; + }) + ]; +} diff --git a/modules/home/tools/git/default.nix b/modules/home/tools/git/default.nix new file mode 100644 index 0000000..1780d80 --- /dev/null +++ b/modules/home/tools/git/default.nix @@ -0,0 +1,45 @@ +{ options, config, lib, namespace, ... }: + +with lib; with lib.${namespace}; let + cfg = config.${namespace}.tools.git; +in { + options.${namespace}.tools.git = with types; { + enable = mkEnableOption "git"; + + name = mkOption { + type = str; + }; + + email = mkOption { + type = str; + }; + + key = mkOption { + type = nullOr str; + }; + + sign = mkOption { + type = bool; + default = true; + }; + }; + + config = mkIf cfg.enable { + programs.git = { + enable = true; + + userName = cfg.name; + userEmail = cfg.email; + + signing = { + key = cfg.key; + signByDefault = cfg.sign; + }; + + ignores = [ + "*~" + "*.swp" + ]; + }; + }; +} diff --git a/modules/home/tools/gpg/default.nix b/modules/home/tools/gpg/default.nix new file mode 100644 index 0000000..297d9d0 --- /dev/null +++ b/modules/home/tools/gpg/default.nix @@ -0,0 +1,32 @@ +{ options, config, lib, pkgs, namespace, ... }: + +with lib; with lib.${namespace}; let + cfg = config.${namespace}.tools.gpg; + impermanence = config.${namespace}.impermanence; +in { + options.${namespace}.tools.gpg = with types; { + enable = mkEnableOption "gpg"; + }; + + config = mkIf cfg.enable { + home.persistence.${impermanence.secure.location} = { + directories = [ + ".gnupg" + ]; + }; + + programs.gpg.enable = true; + + services.gpg-agent = { + enable = true; + enableSshSupport = true; + pinentryPackage = (pkgs.writeShellScriptBin "pinentry-wrapper" '' + if [[ -v DISPLAY ]]; then + exec ${pkgs.pinentry-gnome3}/bin/pinentry-gnome3 "$@" + fi + + exec ${pkgs.pinentry-gnome3}/bin/pinentry-tty "$@" + ''); + }; + }; +} diff --git a/modules/home/tools/ssh/default.nix b/modules/home/tools/ssh/default.nix new file mode 100644 index 0000000..10139df --- /dev/null +++ b/modules/home/tools/ssh/default.nix @@ -0,0 +1,20 @@ +{ options, config, lib, pkgs, namespace, ... }: + +with lib; with lib.${namespace}; let + cfg = config.${namespace}.tools.ssh; + impermanence = config.${namespace}.impermanence; +in { + options.${namespace}.tools.ssh = with types; { + enable = mkEnableOption "ssh"; + }; + + config = mkIf cfg.enable { + home.persistence.${impermanence.secure.location} = { + directories = [ + ".ssh" + ]; + }; + + programs.ssh.enable = true; + }; +} diff --git a/modules/home/tools/tmux/default.nix b/modules/home/tools/tmux/default.nix new file mode 100644 index 0000000..3f9b7a0 --- /dev/null +++ b/modules/home/tools/tmux/default.nix @@ -0,0 +1,15 @@ +{ options, config, lib, namespace, ... }: + +with lib; with lib.${namespace}; let + cfg = config.${namespace}.tools.tmux; +in { + options.${namespace}.tools.tmux = with types; { + enable = mkEnableOption "tmux"; + }; + + config = mkIf cfg.enable { + programs.tmux = { + enable = true; + }; + }; +} diff --git a/modules/home/tools/vim/default.nix b/modules/home/tools/vim/default.nix new file mode 100644 index 0000000..b07f8d4 --- /dev/null +++ b/modules/home/tools/vim/default.nix @@ -0,0 +1,43 @@ +{ options, config, lib, namespace, ... }: + +with lib; with lib.${namespace}; let + cfg = config.${namespace}.tools.vim; + theme = config.${namespace}.desktop.theme; +in { + options.${namespace}.tools.vim = with types; { + enable = mkEnableOption "vim"; + }; + + config = mkIf cfg.enable { + home.file.".vim/vimrc".text = '' + set number + set relativenumber + set showcmd + + set termguicolors + set background=dark + colorscheme ${theme.name} + + syntax on + + highlight Normal guibg=#000000 + + " Awesome magical color override from + " https://gist.github.com/romainl/379904f91fa40533175dfaec4c833f2f + augroup MyColors + autocmd! + autocmd ColorScheme * highlight Normal guibg=#000000 + augroup END + ''; + + home.file.".vim/pack/default/start/gruvbox".source = builtins.fetchGit { + url = "https://github.com/morhetz/gruvbox.git"; + rev = "f1ecde848f0cdba877acb0c740320568252cc482"; + }; + + home.file.".vim/pack/all/start/vim-nix".source = builtins.fetchGit { + url = "https://github.com/LnL7/vim-nix.git"; + rev = "e25cd0f2e5922f1f4d3cd969f92e35a9a327ffb0"; + }; + }; +} diff --git a/modules/home/tools/zoxide/default.nix b/modules/home/tools/zoxide/default.nix new file mode 100644 index 0000000..75db246 --- /dev/null +++ b/modules/home/tools/zoxide/default.nix @@ -0,0 +1,15 @@ +{ options, config, lib, namespace, ... }: + +with lib; with lib.${namespace}; let + cfg = config.${namespace}.tools.zoxide; +in { + options.${namespace}.tools.zoxide = with types; { + enable = mkEnableOption "zoxide"; + }; + + config = mkIf cfg.enable { + programs.zoxide = { + enable = true; + }; + }; +} -- cgit v1.2.3