1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

fish: always run fish_indent

This commit is contained in:
mat ess 2022-12-04 20:51:03 -05:00 committed by Robert Helgesson
parent 747e36476f
commit 7e81e7ae2b
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
13 changed files with 19 additions and 57 deletions

View file

@ -146,14 +146,11 @@ let
(mapAttrsToList (k: v: "alias ${k} ${escapeShellArg v}") cfg.shellAliases);
fishIndent = name: text:
if cfg.formatFishScripts then
pkgs.runCommand name {
nativeBuildInputs = [ cfg.package ];
inherit text;
passAsFile = [ "text" ];
} "fish_indent < $textPath > $out"
else
pkgs.writeText name text;
pkgs.runCommand name {
nativeBuildInputs = [ cfg.package ];
inherit text;
passAsFile = [ "text" ];
} "fish_indent < $textPath > $out";
in {
imports = [
@ -288,16 +285,6 @@ in {
<link xlink:href="https://fishshell.com/docs/current/cmds/function.html"/>.
'';
};
programs.fish.formatFishScripts = mkOption {
type = types.bool;
default = false;
description = ''
Whether to process fish configuration and scripts with
<literal>fish_indent</literal>.
'';
};
};
config = mkIf cfg.enable (mkMerge [