From b37371a61aa9f6ec3f4e4e4b118a9d06f3689b5e Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 2 May 2025 16:15:52 +0200 Subject: ... --- accounts/gkleen@sif/default.nix | 85 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 82 insertions(+), 3 deletions(-) (limited to 'accounts/gkleen@sif/default.nix') diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 6574af9d..e900370b 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix @@ -175,13 +175,92 @@ in { gpu-api = "vulkan"; }; - zsh.initExtra = '' - source ${./zshrc} + zsh.initExtra = 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 + cfg.programs.git.package + magickWrapped + curl + file + gnutar + cpio + magic-wormhole + quickserve + cfg.programs.zsh.package + fuse + util-linux + findutils + qrencode + tty-clock + cfg.programs.jq.package + eza + less + config.systemd.package + config.programs.ssh.package + gnused + ]; + execer = with pkgs; [ + "cannot:${lib.getExe' rpm "rpm2cpio"}" + "cannot:${lib.getExe' squashfsTools "unsquashfs"}" + "cannot:${lib.getExe' unzip "unzip"}" + "cannot:${lib.getExe cfg.programs.git.package}" + "cannot:${lib.getExe cpio}" + "cannot:${lib.getExe' magic-wormhole "wormhole"}" + "cannot:${lib.getExe quickserve}" + "cannot:${lib.getExe' fuse "fusermount"}" + "cannot:${lib.getExe less}" + "cannot:${lib.getExe' config.systemd.package "systemctl"}" + "cannot:${lib.getExe config.programs.ssh.package}" + ]; + wrapper = with pkgs; [ + "${lib.getExe' magickWrapped "magick"}:${lib.getExe' imagemagick "magick"}" + ]; + fake = { + builtin = ["print"]; + external = ["sudo" "umount"]; + }; + }; + }; + }; + 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 '' + source ${zshrc}/share/zshrc ''; zsh.dirHashes = let flakeHashes = mapAttrs' (n: v: nameValuePair (inputNames.${n} or n) (toString v)) flakeInputs; inputNames = { - "nixpkgs" = "nixos"; }; in flakeHashes // { u2w = "$HOME/projects/uni2work"; -- cgit v1.2.3