anchor.diff:      mapAttrsToList (k: v: "alias ${k}='${v}'") cfg.shellAliases
     );
   
  +  fileType = types.submodule (
  +    { name, config, ... }: {
  +      options = {
  +        body = mkOption {
  +          default = null;
  +          type = types.nullOr types.lines;
  +          description = "Body of the function.";
  +        };
  +
  +        source = mkOption {
  +          type = types.path;
  +          description = ''
  +            Path of the source file. The file name must not start
  +            with a period.
  +          '';
  +        };
  +      };
  +
  +      config = {
  +        source = mkIf (config.body != null) (
  +          mkDefault (pkgs.writeTextFile {
  +            inherit name;
  +            text = ''
  +            function ${name}
  +              ${config.body}
  +            end
  +            '';
  +            executable = true;
  +          })
  +        );
  +      };
  +    }
  +  );
   in
   
   {
  
positive.code:         type = types.lines;
        };
      };
    };
  
    config = mkIf cfg.enable {
      home.packages = [ cfg.package ];
  
      xdg.dataFile."fish/home-manager_generated_completions".source =
  
negative.code:         set -g __fish_interactive_config_sourced 1
        end
      '';
    } {
        xdg.configFile = map (n: { target = "fish/functions/${n}.fish"; source = cfg.functions.${n}.source; }) (attrNames cfg.functions);
      } (
      let
        wrappedPkgVersion = lib.getVersion pkgs.fish;
        wrappedPkgName = lib.removeSuffix "-${wrappedPkgVersion}" pkgs.fish.name;
        dependencies = concatMap (p: p.dependencies) cfg.plugins;
        combinedPluginDrv = pkgs.buildEnv {
          name = "${wrappedPkgName}-plugins-${wrappedPkgVersion}";
          paths = cfg.plugins;
          postBuild = ''
            touch $out/setup.fish
  
            if [ -d $out/functions ]; then
              echo "set fish_function_path \$fish_function_path[1] $out/functions \$fish_function_path[2..-1]" >> $out/setup.fish
            fi
  
            if [ -d $out/completions ]; then
              echo "set fish_complete_path \$fish_complete_path[1] $out/completions \$fish_complete_path[2..-1]" >> $out/setup.fish
            fi
  
            if [ -d $out/conf.d ]; then
              echo "source $out/conf.d/*.fish" >> $out/setup.fish
            fi
          '';
        };
      in mkIf (length cfg.plugins > 0) {
        xdg.configFile."fish/conf.d/99plugins.fish".source = "${combinedPluginDrv}/setup.fish";
        home.packages = dependencies;
    })]);
  }
  