{ pkgs, config, lib, ... }: with lib; let unstablePkgs = import { }; library = import { inherit pkgs lib; }; #seafileClient = unstablePkgs.seafile-client.override{ # seafile-shared = unstablePkgs.seafile-shared; #}; allLicenses = let licenses = builtins.map (license: "echo '${license.shortName} : ${license.fullName}'") (builtins.attrValues pkgs.stdenv.lib.licenses); in pkgs.writers.writeBashBin "all-licenses" (lib.concatStringsSep "\n" licenses); seafileClient = pkgs.seafile-client.override { seafile-shared = pkgs.seafile-shared; }; replaceLinks = pkgs.writers.writeBashBin "replace-link-with-content" # sh '' if [ ! -L "$1" ] then echo "$1 does not exist or is not a file" exit 1 fi cp -rL "$1" "$1.backup" unlink "$1" mv "$1.backup" "$1" ''; pandocScript = inputFormat: outputFormat: pkgs.writers.writeDashBin "pandoc-from-${inputFormat}-to-${outputFormat}" '' ${pkgs.pandoc}/bin/pandoc \ --from ${inputFormat} \ --to ${outputFormat} \ --standalone \ "$@" ''; connectToSpeaker = name: id: pkgs.writeShellScriptBin "connect-to-speaker-${name}" # sh '' # hacky script because I have problems with # automatically connecting to trusted bluetooth devices. echo "Connect to Speaker ${name}" bluetoothctl <)) (writeShellScriptBin "music-making" (fileContents )) replaceLinks image-generator w3m links lynx # temperature s-tui (pkgs.writers.writeDashBin "temperature" '' ${pkgs.s-tui}/bin/s-tui '') powertop (pkgs.writers.writeBashBin "youtube-download-music" '' ${pkgs.youtube-dl}/bin/youtube-dl \ --extract-audio \ --audio-format vorbis \ --audio-quality 0 \ "$@" '') allLicenses memo nixfmt dateutils # etc-info stuff (pkgs.writers.writeDashBin "etc-info-sync" (lib.concatStringsSep "\n" (map (host: "rsync -avLz ${host}.private:/etc/info/ ~/.etc_info") (attrNames config.module.cluster.services.tinc."private".hosts)))) (pkgs.writers.writeBashBin "etc-info-restic" (lib.fileContents )) #(pkgs.writers.writeDashBin "reddit" '' #${unstablePkgs.tuir}/bin/tuir "$@" #'') ] ++ (lib.crossLists pandocScript [ [ "man" "markdown" "mediawiki" ] [ "mediawiki" "docbook5" "html5" "man" ] ]) # ++ (map (search: #pkgs.writers.writeDashBin "reddit-${search}" '' # ${unstablePkgs.tuir}/bin/tuir -s ${search} "$@" #'') [ "nixos" "systemdUltras" "terraform" ]) ; }