Commit Graph

121 Commits

Author SHA1 Message Date
fin444
c20787adb1 don't attempt to export zpool if there is none 2024-06-30 13:57:22 +00:00
Johannes Bornhold
f964678caa Add new parameter "--kexec-extra-flags"
This allows to pass in special flags like "--no-sync" into the call to "kexec".
2024-06-10 11:52:22 +00:00
Jörg Thalheim
4079e0de1c add gnutar as dependency 2024-06-07 14:23:04 +00:00
Jörg Thalheim
574bacb9ba bump version t0 1.3.0 2024-06-07 15:24:06 +02:00
Jörg Thalheim
f931e0db1f update default nixos kexec image to 24.05 2024-06-07 13:12:36 +00:00
Sizhe Zhao
09f1f8306b
fix(src/nixos-anywhere): make root own copied files 2024-05-27 10:43:10 +08:00
Sizhe Zhao
5770dd84d2
fix(src/nixos-anywhere): extra-files expects a path 2024-05-27 10:42:04 +08:00
Sizhe Zhao
131a6e3ec0 feat(src): remove rsync from runtimeDeps 2024-05-26 09:13:58 +00:00
Sizhe Zhao
62e554d177 feat(src/nixos-anywhere): don't use rsync 2024-05-26 09:13:58 +00:00
fidgetingbits
3f975977d9 Don't fail if .ssh/authorized_keys is missing 2024-05-26 08:47:21 +00:00
Acid Bong
2f5b494e19
src/get-facts.sh: remove the bashism 2024-05-07 20:26:26 +03:00
a-kenji
2a30f395b6 bump version to currently released version 2024-05-07 10:06:15 +02:00
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
5317af5f14 drop rsync patch again 2023-11-18 19:34:49 +00:00
Jörg Thalheim
9a36044b97 add rsync patch 2023-11-06 13:39:34 +01:00
Chris Marchesi
bea2862c63 Prefer system rsync
This sets up the package derivation to prefer the system rsync in the
same way the system SSH is preferred, to prevent issues that may arise
(e.g. crashes) that can arise from mixing the system SSH with the
derivation-provided rsync.

Fixes #242.
2023-11-02 07:51:49 +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
6ab330d99e generate terraform documentation 2023-09-17 08:40:45 +00:00
Jörg Thalheim
db969b669d package: align with nixpkgs version
This is the format we have to use when upstreaming
2023-09-16 10:28:20 +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