diff options
Diffstat (limited to '')
-rwxr-xr-x | pkgs/by-name/au/aumo/aumo.sh | 29 | ||||
-rw-r--r-- | pkgs/by-name/au/aumo/package.nix | 15 |
2 files changed, 37 insertions, 7 deletions
diff --git a/pkgs/by-name/au/aumo/aumo.sh b/pkgs/by-name/au/aumo/aumo.sh index d86165b2..dba5ef63 100755 --- a/pkgs/by-name/au/aumo/aumo.sh +++ b/pkgs/by-name/au/aumo/aumo.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + NAME="aumo" error() { @@ -8,11 +18,11 @@ error() { die() { error "$1" - if [ -n "$2" ]; then - exit "$2" - else - exit 1 - fi + exit "${2-1}" +} + +usage() { + echo "Usage: $NAME mount|unmount" } get_mounted_labels() { @@ -45,14 +55,19 @@ mounting() { udisksctl mount --block-device "/dev/disk/by-label/$disk_name" } -case "$1" in +case "${1-unset}" in "mount") mounting ;; "unmount" | "umount") unmounting ;; +"unset") + usage + die "You need to provide one argument." + ;; *) - die "Usage: $NAME mount|unmount" + usage + die "Unknown command: '$1'" ;; esac diff --git a/pkgs/by-name/au/aumo/package.nix b/pkgs/by-name/au/aumo/package.nix index 58618e63..8132a15a 100644 --- a/pkgs/by-name/au/aumo/package.nix +++ b/pkgs/by-name/au/aumo/package.nix @@ -1,9 +1,21 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { writeShellApplication, # Dependencies udisks, findutils, rofi, + jq, + gnugrep, + util-linux, }: writeShellApplication { name = "aumo"; @@ -13,5 +25,8 @@ writeShellApplication { udisks findutils rofi + jq + gnugrep + util-linux # for findmnt ]; } |