diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-08-23 18:31:35 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-08-23 18:31:35 +0200 |
| commit | 1d933f1a458c510be9329edaab2b1381e098ac48 (patch) | |
| tree | be288232fa592c284c3eb0e1d291a07f12794e5d /modules/by-name/fi/fish/module.nix | |
| parent | modules/starship: Migrate to `by-name` (diff) | |
| download | nixos-config-1d933f1a458c510be9329edaab2b1381e098ac48.zip | |
modules/fish: Init
Diffstat (limited to '')
| -rw-r--r-- | modules/by-name/fi/fish/module.nix | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/modules/by-name/fi/fish/module.nix b/modules/by-name/fi/fish/module.nix new file mode 100644 index 00000000..4e68cb9c --- /dev/null +++ b/modules/by-name/fi/fish/module.nix @@ -0,0 +1,76 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.zsh; + + sourceFile = path: "source ${path}\n"; + + extraFiles = builtins.concatStringsSep "\n" ( + builtins.map (value: + if builtins.isPath value + then (sourceFile value) + else value) ( + builtins.attrValues cfg.integrations + ) + ); +in { + options.soispha.programs.fish = { + enable = lib.mkEnableOption "fish"; + + integrations = lib.mkOption { + type = lib.types.attrsOf (lib.types.either lib.types.path lib.types.str); + example = '' + { + atuin = ./integrations/atuin.fish; + } + ''; + default = {}; + }; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + home.sessionPath = lib.mkForce []; + + programs.fish = { + enable = true; + + shellInit = let + start = lib.modules.mkBefore ( + sourceFile ./config/01_show-task.fish + ); + end = lib.modules.mkAfter ( + sourceFile ./config/keybindings/00__start.fish + + sourceFile ./config/keybindings/01_insert.fish + + sourceFile ./config/keybindings/02_command.fish + + sourceFile ./config/keybindings/03_visual.fish + + sourceFile ./config/keybindings/04_replace.fish + + sourceFile ./config/keybindings/05_operator.fish + + sourceFile ./config/keybindings/06_replace_one.fish + + sourceFile ./config/keybindings/07_others.fish + + sourceFile ./config/keybindings/08__end.fish + ); + in + lib.modules.mkMerge + [ + start + + extraFiles + + end + ]; + }; + }; + }; +} |
