Compare commits

...

2 commits

Author SHA1 Message Date
Patrick 62a6893709
fix: clone script 2024-06-19 21:17:47 +02:00
Patrick 420ca309d9
cleanup minify 2024-06-19 19:08:12 +02:00
6 changed files with 3 additions and 48 deletions

View file

@ -164,6 +164,7 @@
inherit system;
config.allowUnfree = true;
};
packages = pkgs;
topology = import nix-topology {
inherit pkgs;

View file

@ -23,16 +23,13 @@ in
rage
nix
nix-diff
nix-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;
}

View file

@ -10,7 +10,7 @@ writeShellApplication {
runtimeInputs = [ps procps xdotool jq];
text = ''
if [[ $XDG_CURRENT_DESKTOP == sway ]]; then
if [[ ''${XDG_CURRENT_DESKTOP-} == sway ]]; then
PAREN=$(swaymsg -t get_tree | jq '.. | select(.type?) | select(.focused==true).pid')
else
PAREN=$(xdotool getwindowfocus getwindowpid)