Commit graph

27 commits

Author SHA1 Message Date
Jimmy Reichley
f1b4d6ea24
Whoops typo 2023-09-29 13:37:07 -04:00
Jimmy Reichley
699f6b4495
Allow providing 'sshConfigHost' param 2023-09-29 01:06:40 -04:00
matthewcroughan
b4d17b8e2a default hermetic to true 2022-12-15 15:08:40 +00:00
matthewcroughan
8dca4f6f58 Make flock usage hermetic 2022-10-28 01:43:24 +01:00
matthewcroughan
572db25f42 Use explicit cross-platform flock rather than impurely referencing it 2022-10-26 22:56:41 +01:00
Magic_RB
b2c30fe2c2
Add options to specify Nix options
Signed-off-by: Magic_RB <magic_rb@redalder.org>
2022-09-24 15:59:53 +02:00
matthewcroughan
aa9b423354 Add locking via flock(1)
This adds basic advisory locking such that two Nixinate deployments do
not run the activation script at the same time, both for local and
remote. The default timeout is 60 seconds, and is currently
unconfigurable.
2022-08-19 05:45:57 +01:00
matthewcroughan
1a19e15736 Use doubled quotes instead of single quotes for SSH commands
This makes writing commands a little easier without escaping everything
2022-08-19 04:51:42 +01:00
Magic_RB
b5683029f9 Add option to substitute on the target machine if local build
Signed-off-by: Magic_RB <magic_rb@redalder.org>

Co-authored-by: matthewcroughan <matt@croughan.sh>
2022-06-10 15:38:13 +01:00
matthewcroughan
dfbd0c6628 No longer refer to drvPath in hermetic remote rebuilds 2022-06-02 01:27:49 +01:00
matthewcroughan
034013af9d Fix hermetic remote builds and tests
In the previous attempt to add this feature, I had forgotten to add the
new tests to tests/default.nix, which meant I believed the feature
worked when it did not. Additionally, real world testing shows that if
the path does not exist on the remote already, that nix build --store
will not work and will throw the following error: 'path '/nix/store/foo'
is required, but there is no substituter that can build it' To fix this,
I've decided to use nix copy --derivation and then nix-store --realise
on the remote. A lot of refactoring is needed to make this codebase
presentable anyway, so this hack is fine for now, though it is
admittedly an unclean implementation.
2022-06-02 00:55:57 +01:00
matthewcroughan
4a356409ca Add support for hermetic remote builds
A hermetic remote rebuild is when Nixinate sends a specific Nix binary
to the remote first, then uses it when activating a system closure,
rather than using the Nix that is already on the remote. This is
defaulted to false for the time being, as the bandwidth usage can be
high. This allows users to avoid the need to bootstrap the remote first
by enabling flakes on the remote Nix binary.
2022-05-29 19:02:50 +01:00
matthewcroughan
2f6e57d39f hercules-ci: mark x86_64-linux as a CI system 2022-05-24 03:23:19 +01:00
matthewcroughan
971bfe5d1f Add vmTest for Nixinate
This initializes ./test/default.nix which is referred to by the
flake.nix under the `checks` attribute. This default.nix should point to
all future tests, where they can be looked up and ran like:

nix build .#checks.x86_64-linux.vmTest

The test included is a simple NixOS VM Test. It uses Nixinate to deploy
a machine with `services.nginx.enable = true` set, and tests whether
nginx.service is started and reachable after deployment.
2022-04-19 05:43:22 +01:00
matthewcroughan
fcae9a11d0 Provide pkgs in forAllSystems
This is stolen from DavHau's dream2nix flake which reworks forAllSystems to provide two arguments, the pkgs and the system.
2022-03-31 17:40:00 +01:00
matthewcroughan
0d210c1d17 Fix dry-runs
Co-authored-by: Mason Mackaman <masondeanm@aol.com>
2022-03-24 18:46:04 +00:00
matthewcroughan
abc1895492 Remove examples from flake.nix inputs
Subflakes are not really a stable part of the flakes api, so they shouldn't be included in the flake.nix.
2022-03-23 23:18:23 +00:00
matthewcroughan
83eb225f9a Use nix copy instead of rsync 2022-02-28 01:15:36 +00:00
Chloe Kever
2a107a1b7b Add dry runs.
Co-authored-by: Mason Mackaman <masondeanm@aol.com>
2022-02-16 14:56:33 -08:00
Chloe Kever
48f1c6d1df root as the default user. 2022-02-15 18:39:10 -08:00
Chloe Kever
d9e1a0153f Define the script within nix, not bash. 2022-02-15 18:37:50 -08:00
Chloe Kever
6766412769 Remove trailing whitespace. 2022-02-15 18:19:48 -08:00
matthewcroughan
07a62f362b Use nixos-unstable
This is required to make nixos-rebuild work with flakes.
2022-02-07 00:59:29 +00:00
matthewcroughan
b7d47ddd37 Use nixos-rebuild switch instead of switch-to-configuration
This fixes https://github.com/MatthewCroughan/nixinate/issues/5
2022-02-07 00:58:06 +00:00
matthewcroughan
8f960401c4 flake: add local building
This adds the ability to build a system closure locally and push it to
the remote using `nix copy`
2022-01-26 22:58:48 +00:00
matthewcroughan
6003461f0e add examples 2022-01-26 20:17:20 +00:00
matthewcroughan
d4de691afb init 2022-01-03 10:50:50 +00:00