Commit Graph

69 Commits

Author SHA1 Message Date
Maciej Krüger
313ac878e9 Detect IPv6 automatically, Rewrite kexec url
This uses ip r g 1.1.1.1 to test if there's any route to an IPv4
internet host

If that fails and the url is a github.com one it will change github.com
to gh-v6.com,
as specified in the documentation

This saves the user from an extra manual step and makes nixos-anywhere
better

Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2024-04-30 06:48:37 +00:00
zimbatm
3170c45be4 fix bashism
[[ ]] is not available in POSIX sh, and test -o is not well defined
either.

Move the facts-gathering script out so it can be tested with shellcheck.
2024-04-29 16:23:53 +00:00
lassulus
5f06770db9
Merge pull request #305 from a-kenji/add-password
feat: add copy-password
2024-04-23 12:28:33 +02:00
a-kenji
a2b5fcaa9e feat: add env-password
Allow setting the bootstrap password on invocation of
`nixos-anywhere`.

This makes use of the `sshpass` program, to provide `ssh-copy-id` with
the password.

The `runtimeDeps` change in the following way:

sshpass: ∅ → 1.10, +29.5 KiB

Improves the usage especially together with the iso image installers of `nixos-images`.
2024-04-23 11:54:31 +02:00
a-kenji
5561f00281 help: fix phrasing 2024-04-19 16:17:59 +02:00
Gary Guo
52f932b262 Switch to root user if non-root user is used for nixos installer 2024-03-23 00:47:24 +00:00
Shea Levy
31c945ed58 Allow using doas in place of sudo.
doas is much smaller and is used by some distributions, such as
Alpine, instead of sudo.
2024-02-28 19:13:04 +00:00
Shea Levy
3572a7c47e Only require sh, not bash, on the remote machine 2024-02-28 19:13:04 +00:00
c_14
b6abac7b0e fix container detection
When systemd-detect-virt exists and we aren't in a container,
is_container contains "y none none" instead of none.

1. has outputs y/n to stdout which we need to remove
2. has always returns truthy, we need to check it's string value not the
   exit value
3. systemd-detect-virt --container returns non-zero when we aren't in a
   container, use if then else instead of && ||
2024-02-21 23:34:50 +00:00
mangoiv
4c94cecf3d [feat] remove -t parameter and replace it with a check of whether it's tty 2024-01-07 12:12:16 +00:00
Jörg Thalheim
2facb632d7 detect containers
In particular people might use openvz containers, which doesn't support kexec.
2024-01-07 12:07:28 +00:00
Michael Hoang
7671a880e3 don't require trusted user for --build-on-remote 2024-01-01 01:05:57 +00:00
Paul Haerle
1dc6b529e6
nixos 23.05 -> 23.11 (#261) 2023-12-12 11:21:01 +01:00
Pol Dellaiera
9c3de7d78d Replace numtide with nix-community 2023-11-23 09:09:02 +00:00
Jörg Thalheim
0a929da703 only fetch pubkey in case we want to build on remote
This is a bit faster and also helps to mitigated cases where additionally options
that are not respected by ssh-keyscan (i.e. JumpHost) are used
2023-10-28 08:10:28 +00:00
Paul Haerle
a30e5254a7
replace || : with || true 2023-10-27 11:35:06 +02:00
Jörg Thalheim
354fc5017c umount /mnt prior to exporting zpool
potentially fixes https://github.com/nix-community/disko/issues/434
2023-10-27 11:28:49 +02:00
Ivan Trubach
a8d94ffa9a fix shell syntax for copy-host-keys 2023-10-04 17:40:24 +00:00
Jörg Thalheim
60282db5c1 fix commandline parsing for copy-host-keys 2023-10-04 17:40:24 +00:00
Ivan Trubach
eb5ff34414 copy over ssh host keys
nixos-kexec-installer preserves SSH host keys, so should we, to avoid
changing host identity.

See also
- c4c73bce65/nix/kexec-installer/kexec-run.sh (L42C1-L46C1)
- c4c73bce65/nix/installer.nix (L44-L55)
2023-10-04 17:40:24 +00:00
mib
bb058eb8dc fix: use ssh args for getting connection settings 2023-09-25 10:54:15 +00:00
Jörg Thalheim
50b53e6e4e vm-test: do not allow extra-files and disk-encryption-keys 2023-09-02 18:37:31 +00:00
Jörg Thalheim
9201231d0c make --vm-test fail for --store-paths 2023-09-02 11:48:44 +00:00
Adam Stephens
2e1bf867ee force use of bash to allow for non-posix user shells 2023-08-28 14:57:06 +00:00
a-kenji
f417afd489 chore: fix typos 2023-08-22 13:55:28 +02:00
Jörg Thalheim
3197bcf152 drop unused : 2023-08-05 10:38:56 +02:00
Jörg Thalheim
622e00afbb also pass ssh_args to rsync 2023-08-05 10:37:25 +02:00
Jörg Thalheim
9df79870b0
Merge pull request #168 from bluepython508/nix-copy-ssh-args
Pass ssh_args to nix copy and nix build SSH invocations
2023-08-05 09:34:44 +01:00
Jörg Thalheim
ac89dd5178 add kexec support for linux-aarch64 2023-08-05 09:54:58 +02:00
bluepython508
5e450374b1 Pass ssh_args to nix copy and nix build SSH invocations
This is necessary for --post-kexec-ssh-port to be useful in situations involving port forwarding, such as when running on qemu
2023-08-05 07:48:36 +00:00
lassulus
a72a4e5bee put key information into builder info to avoid long filenames 2023-07-31 13:49:36 +02:00
lassulus
581053b2c4 add --vm-test mode for local vm tests
Update src/nixos-anywhere.sh
2023-07-21 15:10:53 +02:00
Jörg Thalheim
a9e9b704a3 skip zpool command if we don't have it installed
for example not all installer will have it.
2023-07-18 15:29:58 +02:00
mergify[bot]
f0b9ecd941
Merge branch 'main' into zfs_export 2023-07-18 12:30:40 +00:00
Domen Kožar
8a381b97ca
kexec is a path 2023-07-18 12:41:36 +01:00
lassulus
aaef92aef9 export zfs pool after installation 2023-07-15 16:01:38 +02:00
Neal Fennimore
024bad7cc6 Add in ssh port option 2023-07-12 22:02:20 +02:00
ajs124
eb1997c054 move kexec check into kexec codepath
without this, the check gets run and fails even if no kexec will be done
e.g. when an installer is booted
2023-07-12 18:43:02 +00:00
Jacek Galowicz
70909def0c Add -t param to nixos-anywhere to enable for prompts during installation 2023-06-13 20:16:34 +02:00
Ilan Joselevich
7ba548dc78
treewide: 22.11 -> 23.05 2023-06-11 14:08:38 +03:00
Jörg Thalheim
ff8fbfb657
Merge pull request #135 from numtide/non-nixos-quirk
add workaround when running in non-nixos environments
2023-06-07 19:38:33 +01:00
Jörg Thalheim
f44ce5b7b8 add workaround when running in non-nixos environments 2023-06-07 16:52:30 +02:00
Jörg Thalheim
d4fbe4c173 print error message to stderr if ssh-keyscan fails 2023-06-07 07:36:34 +02:00
Jörg Thalheim
c5fc538880 extract correct hostname from ssh settings 2023-06-07 07:36:34 +02:00
bors[bot]
8aa9b49229
Merge #132
132: make usage formatting more consistent r=Mic92 a=Mic92



Co-authored-by: Jörg Thalheim <joerg@thalheim.io>
2023-06-07 05:16:23 +00:00
Jörg Thalheim
69443d6929 make usage formatting more consistent 2023-06-07 07:15:31 +02:00
bors[bot]
c532c9314e
Merge #129
129: Create ~/.ssh folder and add .direnv to gitignore r=Mic92 a=Melkor333



Co-authored-by: Samuel Hierholzer (Adfinis AG) <samuel.hierholzer@adfinis.com>
2023-06-07 04:52:47 +00:00
Jörg Thalheim
f3d4bec0df fix ssh-keyscan for non-standard ssh ports 2023-06-07 00:44:35 +02:00
Samuel Hierholzer (Adfinis AG)
a102f30bc8
fix: create ~/.ssh folder as required by ssh-copy-id 2023-06-06 08:15:18 +02:00
Paul Haerle
33b11cf0ee
fix: .disko -> .diskoScript
...to avoid a deprecation warning from disko
2023-06-01 20:37:28 +02:00