Commit Graph

293 Commits

Author SHA1 Message Date
notgne2
70c55363a9
Restructure project 2021-01-08 18:24:04 -07:00
notgne2
330a73e329
Check if systemd-boot is enabled before attempting to delete default entry line 2021-01-08 14:54:00 -07:00
notgne2
aa42daa800
Merge branch 'notgne2/new-logger' 2021-01-08 14:33:14 -07:00
notgne2
1021191b90
Use boot path from configuration and ignore failures when updating loader conf 2021-01-06 22:07:02 -07:00
notgne2
a9a5c4bd1e
Automatically filter out default line from loader.conf after NixOS activation 2021-01-05 16:44:00 -07:00
notgne2
3b08cef157
Document quotating profile or hostnames with a . in CLI (closes #10) 2021-01-01 19:35:22 -07:00
notgne2
12fee773d5
Format logs differently 2021-01-01 19:30:33 -07:00
notgne2
b6a6abe104
Modify activation logic to keep SSH connection alive for magic-rollback and avoid forking or disconnecting std{out,err} 2020-12-30 20:25:59 -07:00
notgne2
40d71ccdd7
Make printed deployment information be info level instead of warn 2020-12-27 13:04:54 -07:00
notgne2
4ba83f14ce
Merge pull request #35 from serokell/notgne2/fix-settings-merge
Fix the order in which settings are merged
2020-12-27 12:15:34 -07:00
notgne2
48548d1b15
Remove discriminant (they are already differenciated by binary name) 2020-12-27 11:33:55 -07:00
notgne2
01ea759cf6
Deduplicate level to emoji pattern into make_emoji() 2020-12-27 11:05:37 -07:00
notgne2
72b04b0ae8
Fix log dir/file mismatch 2020-12-27 10:59:32 -07:00
notgne2
bbc2a2d984
Use error log macro more in activate.rs 2020-12-27 10:58:20 -07:00
notgne2
4461d1ea3f
Replace logger, add more logging options including files 2020-12-27 10:52:37 -07:00
notgne2
ccf5160c1f
Merge branch 'master' into notgne2/fix-settings-merge 2020-12-27 10:51:15 -07:00
notgne2
d01eab0e97
Fix the order in which settings are merged 2020-12-22 11:36:48 -07:00
notgne2
91e934fd9e
Merge pull request #30 from serokell/notgne2/fix-substitution
Fix fast_connection flag to enable substitute-on-destination correctly
2020-12-20 11:19:02 -07:00
notgne2
3adc593f19
Fix fast_connection flag to enable substitute-on-destination correctly 2020-12-19 21:25:12 -07:00
Andreas Fuchs
7d4020f130 Simplify the types involved a little
The cursed match is still cursed, but at least we're not sending
useless data across channels anymore.
2020-12-15 13:00:01 -07:00
Andreas Fuchs
4ed33219a9 Build "activate" binary on all platforms
Now that activate uses a cross-platform fs notification library, we
can build it on Darwin again (and build its deps separately, speeding
up recompiles there).
2020-12-15 13:00:01 -07:00
Andreas Fuchs
c3b36bbb3b Use notify crate to learn about deletion of the activation sentinel
We should now be able to deploy to non-Linux systems, and build all
the required binaries too.
2020-12-15 13:00:01 -07:00
Andreas Fuchs
3bcb3879bd Update tokio & pull in notify, instead of inotify
The notify crate is cross-platform, and the newer tokio has some bug
fixes. Let's use those.
2020-12-15 13:00:01 -07:00
notgne2
ba7f57086c
Add reuse header to logo 2020-12-15 12:24:17 -07:00
notgne2
e633fc9d65
Add logo, remove early-development notice 2020-12-15 12:23:39 -07:00
Andreas Fuchs
c9eb270a8b
Debump the smol_str version to 0.1.16 to build on rust 1.45.2 (#28)
* Debump the smol_str version to 0.1.16 to build on rust 1.45.2

Rust 1.45.2 is what ships in the 20.09 release, and smol_str 0.1.17 is
incompatible with it.

* Clarify version bounds on the smol_str dependency
2020-12-15 12:08:31 -07:00
Steven Roose
dc466f2688 README: Fix example 2020-12-07 17:17:14 -07:00
Andreas Fuchs
05d21e0b66 Add SPDX-FileCopyrightText to the three files that I changed substantially 2020-12-02 10:24:23 -07:00
Andreas Fuchs
7436f4265b Reinstate NoProfileUser
Seems to have been removed by mistake in the previous cleanup
2020-12-02 10:24:23 -07:00
Alexander Bantyev
65a2f1b18d Clean up utils/mod.rs
Now that we don't copy `activate` from the same directory as `current_exe`,
we can skip the check that the `current_exe` is reachable and in nix store.
2020-12-02 10:24:23 -07:00
Alexander Bantyev
2d0ad40c64 activate flake check: confirm that activate-rs exists in the profile 2020-12-02 10:24:23 -07:00
Alexander Bantyev
10194ad529 Fail early if there is no activation script in profile path 2020-12-02 10:24:23 -07:00
Andreas Fuchs
c1e0f5a9c9 Use DeployData's store path to build the activate-rs path
This gets rid of yet more code, so - win!
2020-12-02 10:24:23 -07:00
Andreas Fuchs
4af6b8114e Don't copy the activate script (it's part of the closure anyway) 2020-12-02 10:24:23 -07:00
Andreas Fuchs
29ab0624e3 Use the profile closure's activate script to activate the profile
This gets rid of the "current_exe" vestige that has stuck around from
when this program was meant to be standalone; instead, we use
the (already known) path to the activate-rs wrapper, which
automatically uses the correct binary for the deploy target platform.
2020-12-02 10:24:23 -07:00
Andreas Fuchs
6ccc0b7ae9 Write an "activate-rs" script into the profile path
This should point to the correct path if the target platform differs
fro the deploying platform.
2020-12-02 10:24:23 -07:00
notgne2
fa4c0a86cd
Use crude Nix parsing for parsing the flake path 2020-11-29 11:51:52 -07:00
notgne2
a19af74789
Use the last . for node/profile name separation, ignore any trailing .. This should solve at least part of #10 2020-11-27 19:05:55 -07:00
notgne2
26bad3a2a6
Quote node and profile names given to nix build (relates to #10) 2020-11-27 18:52:46 -07:00
notgne2
7fa67466c7
Remove old --no-link flags to the Nix build 2020-11-27 15:01:50 -07:00
notgne2
3da8c6d048
Fix ProfileNotFound error message 2020-11-24 22:13:36 -07:00
Andreas Fuchs
42cbe751a8
Fix running & building under macOS (Big Sur) (#9)
* Add xcbuild as native build input 2 ways & pass --verbose to cargo build

* Make "deploy" build on macOS

* Bump the nixpkgs version to one that ships Rust 1.47, which can
  produce binaries under macOS 11 (Big Sur).

* Use darwin-specific options that let Naersk build the "deploy"
  binary under macOS. (With a work-around for
  https://github.com/nmattia/naersk/issues/127, which prevents this
  from being much more straight-forward).

Unfortunately, the "activate" binary can't be built under macOS due to
the inotify dependency; that means the best we can do is to run the
deploy under macOS, not deploy *to* macOS.
2020-11-24 22:11:15 -07:00
notgne2
ed97d54648
Remove references to setActivate from README 2020-11-22 22:02:12 -07:00
notgne2
435ecf9d00
Print deployment if interactive mode is disabled 2020-11-22 21:59:50 -07:00
notgne2
551dd1c304
Remove ref/cows from DeployDefs, add interactive flag (resolves #4) 2020-11-22 21:56:43 -07:00
notgne2
819eca679e
Refactor running to deprecate deploy_all_profiles/push_all_profiles 2020-11-22 21:15:58 -07:00
notgne2
45e99a75f9
Partially add deployment confirmation utilities (for #4) 2020-11-22 20:03:04 -07:00
notgne2
cb50d98884
Use /tmp as temp directory, not /tmp/deploy-rs (resolves #8 by deprecation) 2020-11-22 18:32:04 -07:00
notgne2
08c6bd8b73
Update activate.nixos to take a configuration, not a derivation 2020-11-22 18:12:29 -07:00
notgne2
1795c8aab4
Build nothing if checks attribute is missing in non-flakes mode (fixes #7) 2020-11-21 22:49:55 -07:00