cleanup minify

This commit is contained in:
Patrick 2024-06-19 19:08:12 +02:00
parent c3900591be
commit 420ca309d9
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
4 changed files with 1 additions and 47 deletions

View file

@ -23,16 +23,13 @@ in
rage
nix
nix-diff
nixpkgs-update
];
commands = [
{
package = pkgs.deploy;
help = "build and deploy nix configurations";
}
{
package = pkgs.minify;
help = "build and deploy nix configurations";
}
{
package = pkgs.agenix-rekey;
help = "Edit and rekey repository secrets";

View file

@ -7,7 +7,6 @@
actual = super.callPackage ./actual.nix {};
homebox = super.callPackage ./homebox.nix {};
deploy = super.callPackage ./deploy.nix {};
minify = super.callPackage ./minify {};
j-link = super.callPackage ./jlink.nix {};
firefly-iii = super.callPackage ./firefly-iii.nix {};
mongodb-bin = super.callPackage ./mongodb-bin.nix {};

View file

@ -1,37 +0,0 @@
{writeShellApplication}:
writeShellApplication {
name = "minify";
text = ''
set -euo pipefail
function die { echo "error: $*" >&2; exit 1;}
function print_help() {
echo ' Usage: minify <flake> [OPTION]'
}
OPTIONS=()
POSITIONAL_ARGS=()
while [[ $# -gt 0 ]]; do
case "$1" in
"help"|"--help"|"-h")
show_help
exit 1
;;
-*)
OPTIONS+=("$1")
;;
*)
POSITIONAL_ARGS+=("$1")
;;
esac
shift
done
[[ ! ''${#POSITIONAL_ARGS[@]} -lt 1 ]] \
|| die "Missing argument: <flake>"
[[ ! ''${#POSITIONAL_ARGS[@]} -gt 2 ]] \
|| die "Too many arguments"
path=$(realpath "''${POSITIONAL_ARGS[0]}")
nix eval --impure --argstr path "$path" --file ${./minify.nix} "erg"
'';
}

View file

@ -1,5 +0,0 @@
{path}: let
flake = builtins.getFlake path;
in {
erg = builtins.mapAttrs (name: value: builtins.mapAttrs (name: value: name) value.inputs) flake.inputs;
}