Commit Graph

110 Commits

Author SHA1 Message Date
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
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
Jörg Thalheim
cf1f2eda0f add comment why we pin nix 2023-07-14 13:04:57 +02:00
zimbatm
98640b4b21 fix blocking nix-copy-closure
Pin nix to a version that has a working nix-copy-closure.

See https://github.com/NixOS/nix/issues/8480
2023-07-13 23:33:45 +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