{ pkgs, lib, config, sysConfig, flakeInputs, ... }: let zshrc = pkgs.resholve.mkDerivation { pname = "zshrc"; version = "0.0.0"; src = ./zshrc; dontUnpack = true; dontConfigure = true; dontBuild = true; installPhase = '' mkdir -p $out/share install "$src" $out/share/zshrc ''; solutions = { default = { scripts = [ "share/zshrc" ]; interpreter = "none"; inputs = with pkgs; [ coreutils rpm binutils squashfsTools unzip config.programs.git.package magickWrapped curl file gnutar cpio magic-wormhole config.programs.zsh.package util-linux findutils qrencode tty-clock config.programs.jq.package eza less sysConfig.systemd.package sysConfig.programs.ssh.package gnused miniserve p7zip ]; execer = with pkgs; [ "cannot:${lib.getExe' rpm "rpm2cpio"}" "cannot:${lib.getExe' squashfsTools "unsquashfs"}" "cannot:${lib.getExe' unzip "unzip"}" "cannot:${lib.getExe config.programs.git.package}" "cannot:${lib.getExe cpio}" "cannot:${lib.getExe' magic-wormhole "wormhole"}" "cannot:${lib.getExe' fuse "fusermount"}" "cannot:${lib.getExe less}" "cannot:${lib.getExe' sysConfig.systemd.package "systemctl"}" "cannot:${lib.getExe sysConfig.programs.ssh.package}" "cannot:${lib.getExe' p7zip "7z"}" ]; wrapper = with pkgs; [ "${lib.getExe' magickWrapped "magick"}:${lib.getExe' imagemagick "magick"}" ]; fake = { builtin = ["print"]; external = lib.mapAttrsToList (_: cfg: cfg.program) sysConfig.security.wrappers; }; }; }; }; magickWrapped = pkgs.symlinkJoin { inherit (pkgs.imagemagick) name; paths = [ pkgs.imagemagick ]; buildInputs = with pkgs; [ makeWrapper ]; postBuild = '' wrapProgram $out/bin/magick \ --prefix PATH : ${lib.makeBinPath (with pkgs; [ ghostscript ])} ''; }; in { config = { programs.zsh.initContent = '' source ${zshrc}/share/zshrc ''; programs.zsh.dirHashes = let flakeHashes = lib.mapAttrs' (n: v: lib.nameValuePair (inputNames.${n} or n) (toString v)) flakeInputs; inputNames = { self = "nixos"; }; in flakeHashes // { docs = "$HOME/documents"; dl = "$HOME/Downloads"; scrot = "$HOME/screenshots"; media = "$HOME/media"; }; programs.starship.settings = { directory.substitutions = lib.mapAttrs' (name: value: let value' = builtins.unsafeDiscardStringContext value; value'' = if lib.hasPrefix "$HOME/" value' then "~" + lib.removePrefix "$HOME" value' else value'; in lib.nameValuePair value'' "~${name}" ) config.programs.zsh.dirHashes; }; }; }