diff --git a/bin/lib/cmds.nu b/bin/lib/cmds.nu index a21e543..48dee6c 100644 --- a/bin/lib/cmds.nu +++ b/bin/lib/cmds.nu @@ -92,6 +92,11 @@ export def "skyg hm" [action: string@hm-actions, profile: string = "ari"] { home-manager $action --flake $".#($profile)" } +# List all secret names +export def "skyg secrets" [] { + secret-names +} + # Decrypt a secret from secrets/ folder export def "skyg decrypt" [secret: string@secret-names] { cd $REPO_ROOT diff --git a/bin/lib/types.nu b/bin/lib/types.nu index c083a37..ffb0f0d 100644 --- a/bin/lib/types.nu +++ b/bin/lib/types.nu @@ -1,3 +1,5 @@ +const REPO_ROOT = path self | path dirname | path dirname | path dirname + export def hm-actions [] { ["switch", "build"] } @@ -6,9 +8,8 @@ export def remote-cmds [] { ["test", "dry-activate", "run", "switch", "build"] } -const REPO_ROOT = path self | path dirname | path dirname | path dirname export def secret-names [] { cd $REPO_ROOT - ls secrets/*.age | get name | each { |f| $f | path basename | str replace ".age" "" } + glob secrets/*.age | each { |f| $f | path basename | str replace ".age" "" } }