aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-09-12[#201] Deduce profile directory during activationRoman Melnikov1-19/+19
Problem: Since https://github.com/NixOS/nix/pull/5226 nix profiles for users are stored in 'XDG_STATE_HOME' or 'HOME' directory. However, 'deploy-rs' still expects profiles to be present in '/nix/var/nix/profiles/per-user'. As a result, an attempt to deploy a profile with newer nix may fail with an error about non-existing files. Solution: Instead of deducing the profile path prior to ssh'ing and actual activation, deduce the path to the profile during as a part of 'activate-rs' invocation. Now if the profile path is not specified explicitly as an attribute in profile within the deploy flake, the path to the profile is determined based on the user to which the profile belongs and on the values of 'XDG_STATE_HOME' and 'HOME' variables. Additionally, if the old profile directory (in '/nix/var/nix/profiles/per-user') for a given user already exists, it is used instead for the sake of backward compatibility.
2023-06-08actually merge confirm_timeout into merged_settingsArtemis Everfree1-1/+4
2023-04-20[Chore] Handle 'temp_path' as an actual 'Path' instead of 'String'Roman Melnikov1-3/+5
Problem: 'temp_path' and 'lock_path' are handled as 'String'. This can be a problem when the 'temp_path' directory is a symlink on the target system, e.g. this is the case with the default '/tmp' and macOS, where this directory is actually a symlink to '/private/tmp'. Solution: Handle 'temp_path' and 'lock_path' as actual Paths. Also, canonicalize 'temp_path' to avoid canary file path mismatches when checking filesystem events. As a side effect, also update the 'notify' dependency to the latest stable version.
2022-11-18Add option to build on the remote hostPhilipp Herzog1-4/+9
2022-01-28Add custom sudo command supportAndrew Fontaine1-1/+9
This is useful for nodes that utilize `doas` instead of `sudo`.
2021-08-12General code cleanupnotgne21-3/+3
2021-07-14export cli run in libTimothy DeHerrera1-0/+1
2021-06-22Add multi node supportYannik Sander1-27/+55
Run multiple deployments in sequence Resolve targets later Extend context by deployed flake Apply clippy suggestions Add revoke command builder Track succeeded deploys Add revoke function Register revoke error as deploy error Prepare revoke command in activate Extend logger to handle revoke Implement revoke command client side Run revoke on previously suceeded Control whether to override by flag Adhere profile configuration auto_rollback setting Cargo fmt Correctly provide profile path to activation script when revoking Document multi flake mode in README Resolve a typo in README.md Co-authored-by: notgne2 <gen2@gen2.space> Use existing teminology rename revoke_suceeded -> rollback_suceeded Use more open CLI argument name `targets` instead of `flakes` Document name changes in README Add sudo command support for revokes Call run_deploy with `dry_active` flag Test revoke commands contains sudo Set default temp_path in activate binary Require temp_path for wait and activate subcommands Add copyright comment Address review change requests Fix typo in README Co-authored-by: Alexander Bantyev <balsoft@balsoft.ru>
2021-04-07Add dry activate argument.Oleg Pykhalov1-0/+1
2021-01-26changed: remove 2015-style extern crateBernardo Meurer1-6/+0
2021-01-08Remove unused DeployPathToActivatePathErrornotgne21-8/+0
2021-01-08Fix trivial lint issuesnotgne21-1/+1
2021-01-08Restructure projectnotgne21-7/+5
2021-01-01Format logs differentlynotgne21-3/+3
2020-12-30Modify activation logic to keep SSH connection alive for magic-rollback and ↵notgne21-9/+45
avoid forking or disconnecting std{out,err}
2020-12-27Remove discriminant (they are already differenciated by binary name)notgne21-1/+0
2020-12-27Deduplicate level to emoji pattern into make_emoji()notgne21-14/+12
2020-12-27Replace logger, add more logging options including filesnotgne21-3/+92
2020-12-22Fix the order in which settings are mergednotgne21-2/+2
2020-12-02Add SPDX-FileCopyrightText to the three files that I changed substantiallyAndreas Fuchs1-0/+1
2020-12-02Reinstate NoProfileUserAndreas Fuchs1-0/+1
Seems to have been removed by mistake in the previous cleanup
2020-12-02Clean up utils/mod.rsAlexander Bantyev1-12/+0
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-02Use DeployData's store path to build the activate-rs pathAndreas Fuchs1-20/+0
This gets rid of yet more code, so - win!
2020-12-02Use the profile closure's activate script to activate the profileAndreas Fuchs1-16/+10
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-11-29Use crude Nix parsing for parsing the flake pathnotgne21-42/+88
2020-11-27Use the last `.` for node/profile name separation, ignore any trailing `.`. ↵notgne21-2/+41
This should solve at least part of #10
2020-11-22Remove ref/cows from DeployDefs, add interactive flag (resolves #4)notgne21-18/+16
2020-11-22Partially add deployment confirmation utilities (for #4)notgne21-0/+3
2020-10-29Make all the errors work correctly (I am so so sorry)notgne21-16/+37
2020-10-13Clean up some CLI arguments, make magic rollback optionalnotgne21-2/+8
2020-10-10Add profile path option to profilesnotgne21-7/+11
2020-10-08Update documentationnotgne21-25/+0
2020-10-01Rework system for deploy properties, add CLI override flagsnotgne21-40/+126
2020-10-01Improve nix copy stuffnotgne21-0/+24
2020-09-29Add license information, reformat Nix files, clean upnotgne21-0/+4
2020-09-29Move all activation logic to activate.rs (the unused warnings got annoying)notgne21-1/+0
2020-09-28separate out activation logicnotgne21-4/+68
2020-09-28Add missing filesnotgne21-0/+71