detailed versioning + no dest
This commit is contained in:
1 parent
64ab08d891
commit
2d35fd973c
5 files changed
+14
-7
No files matched your search
@@ -57,7 +57,9 @@
|
||||
version =
|
||||
"${builtins.substring 0 4 self.lastModifiedDate}."
|
||||
+ "${builtins.substring 4 2 self.lastModifiedDate}."
|
||||
+ "${builtins.substring 6 2 self.lastModifiedDate}-${shortRev}";
|
||||
+ "${builtins.substring 6 2 self.lastModifiedDate}."
|
||||
+ "${builtins.substring 8 2 self.lastModifiedDate}."
|
||||
+ "${builtins.substring 10 2 self.lastModifiedDate}-${shortRev}";
|
||||
in
|
||||
{
|
||||
nixosModules.default = { lib, ... }: {
|
||||
|
||||
+1
-1
@@ -468,7 +468,7 @@ in
|
||||
type = types.str;
|
||||
default = "dev";
|
||||
description = ''
|
||||
"YYYY.MM.DD-<commit-sha>" reported by `hermenix version`.
|
||||
"YYYY.MM.DD.hh.mm-<commit-sha>" reported by `hermenix version`.
|
||||
`version` subcommand. Normally supplied for free by this flake's own
|
||||
`nixosModules.default` (from its git metadata) - the "dev" default
|
||||
here only shows up if this module is imported some other way.
|
||||
|
||||
+6
-1
@@ -98,7 +98,7 @@ def "main migrate" [
|
||||
# SAFETY: only ever reads from `source`; the original is never modified.
|
||||
def "main migrate connections" [
|
||||
source: string # existing flat HERMES_HOME to copy from (read-only)
|
||||
dest: string # destination HERMES_HOME folder; ignored when --to-guest is set
|
||||
dest: string = "" # destination HERMES_HOME folder; not required when --to-guest is set
|
||||
--files: list<string> = [config.yaml auth.json .env] # files (relative to HERMES_HOME) to copy
|
||||
--extra-dirs: list<string> = [connections] # subdirectories to copy when present
|
||||
--rewrite-from: list<string> = [host.docker.internal fwdesk.lab.internal castle.hub.internal]
|
||||
@@ -108,6 +108,11 @@ def "main migrate connections" [
|
||||
--guest-user: string = "hermes"
|
||||
--guest-dest: string = "/var/lib/hermes" # destination inside the guest; only used with --to-guest
|
||||
] {
|
||||
mut to_guest = $to_guest
|
||||
if $dest == "" {
|
||||
$to_guest = true
|
||||
note "no <dest> given — assuming --to-guest (streaming into the running guest)"
|
||||
}
|
||||
if not ($source | path exists) { die $"source path does not exist: ($source)" }
|
||||
if ($rewrite_from | length) != ($rewrite_to | length) {
|
||||
die "--rewrite-from and --rewrite-to must have the same length"
|
||||
|
||||
+2
-2
@@ -62,8 +62,8 @@ def run-argv [argv: list<string>] {
|
||||
# --------------------------------------------------------------- version ---
|
||||
|
||||
# HERMENIX_VERSION is baked in at build time (flake.nix / modules/host.nix)
|
||||
# as "YYYY.MM.DD-<commit-sha>" from this repo's own git metadata. "dev" is
|
||||
# only seen running an unwrapped checkout of the script directly.
|
||||
# as "YYYY.MM.DD.hh.mm-<commit-sha>" from this repo's own git metadata. "dev"
|
||||
# is only seen running an unwrapped checkout of the script directly.
|
||||
def hermenix-version [] {
|
||||
$env.HERMENIX_VERSION? | default "dev"
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ def "hermenix-version defaults to dev when unset" [] {
|
||||
|
||||
@test
|
||||
def "hermenix-version passes through when set" [] {
|
||||
with-env { HERMENIX_VERSION: "2026.01.01-abc1234" } {
|
||||
assert equal (hermenix-version) "2026.01.01-abc1234"
|
||||
with-env { HERMENIX_VERSION: "2026.01.01.12.34-abc1234" } {
|
||||
assert equal (hermenix-version) "2026.01.01.12.34-abc1234"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user