Commit graph

239 commits

Author SHA1 Message Date
Graham Christensen 5a58cf20be
Nix 2.13.3 -> 2.15.0 (#428)
* Nix 2.13.3 -> 2.15.0

* Use new path for profile path addition

---------

Co-authored-by: Ana Hobden <operator@hoverbear.org>
2023-05-01 10:15:21 -07:00
Ana Hobden b3c47227ff
Fixup a cure case where a store path already exists so we never make a symlink (#414) 2023-04-12 06:25:24 -07:00
Ana Hobden 4fc7a0db18
Check user group commands exist during plan (#411)
* Check user/group related commands exist prior to execution/revert

* Fixup

* Don't check for executables on mac

* fmt
2023-04-11 07:44:49 -07:00
Ana Hobden 9549d793cc
Avoid globbing issues by using symlinks and readlink (#413) 2023-04-11 07:44:20 -07:00
Ana Hobden 75627bcd91
Provide users a better error message if systemd is not active (#412)
* Provide users a better error message if systemd is not active

* Fixups

* Fix mac

* Fixup
2023-04-10 16:16:46 -07:00
Ana Hobden cb48a7261b
Handle the APFS volume not existing but the Service and Fstab being present (#405)
* Handle the APFS volume not existing but the Service and Fstab being present

* Add handling if we need to bootout the service

* Spelling

* Rename enum
2023-04-10 20:13:25 +00:00
Ana Hobden 16ddada7a3
Only stop the nix daemon if it's actually active, not just enabled (#410)
* Only stop the nix daemon if it's actually active, not just enabled

* Add vm-tests
2023-04-10 12:47:34 -07:00
Ana Hobden 1718e0c428
Trim fdesetup output, remove accidently committed SSL related settings (#403)
* Trim fdesetup output, remove accidently committed SSL related settings

* More complete revert of accidental code

* Fix a bad
2023-04-05 11:13:24 -07:00
Ana Hobden 8bb37f1bcf
Uninstall shouldn't fail fast (#382)
* Uninstall shouldn't fail fast

* wip

* wip

* No longer fails fast

* Tidy up error handling

* Touchup post merge

* Refactor nix tests

* Some minor fixes

* Uninstall fail tests

* Fiddle with messaging

* nixfmt

* Tweak display a bit

* fix docs

* Fix Mac

* Revert setting I was testing

* Reflect feedback about a log level
2023-04-05 15:12:38 +00:00
Ana Hobden 5ec1d0e9b9
Fixup create_volume_service action tag (#398) 2023-04-03 16:19:28 +00:00
Ana Hobden 5b9cb16c94
Add a bit of issue metadata (#386)
* Add a bit of issue metadata

* Immediately install
2023-03-29 17:24:34 +00:00
Ana Hobden c0e9e7015e
Revert default_missing_value to default_value (#380)
We don't need to do this anymore. It was some change I was testing that
didn't work, and I forgot to remove it.
2023-03-28 16:58:57 +00:00
Ana Hobden 607b5271c1
Use retry strategy after diskutil create (#376) 2023-03-28 09:47:12 -07:00
Ana Hobden 4856cff7b6
Make shell profile locations chosen by planner (#375)
* Make shell profile locations chosen by planner

* Fix mac

* Fix fixture
2023-03-27 21:36:54 +00:00
Ana Hobden a74c6da41e
Improve Mac Volume Curing (#362)
* Improve Mac Volume Curing

* Add test

* Improve error

* Speeling

* Remove comment

* Fix escaping issue

* Reflect comments
2023-03-27 13:28:47 -07:00
Ana Hobden 709e81565c
Fixup diagnostic_endpoint setting to be more flexible (#374)
* Fixup diagnostic_endpoint setting to be more flexible

* Fixup doctests
2023-03-27 11:56:44 -07:00
Ana Hobden b7839953dc
Do not try to reload the systemd daemon when we are using --no-start-daemon (#365) 2023-03-23 18:25:34 +00:00
Ana Hobden 11834a3aab
Detect fdesetup properly (#361) 2023-03-22 10:59:04 -07:00
Ana Hobden 9ab29d5e36
Add Rosetta check for Mac (#355)
* Add Rosetta check for Mac

* Use a different, better method

* Setup sysctl error
2023-03-22 10:58:46 -07:00
Ana Hobden f73f8fef38
Be less grumpy about existing file permissions. (#359)
* Don't set permissions on shell profiles

* Alter CreateOrInsertFile permissions behavior.

* Fixup tests
2023-03-22 09:26:34 -07:00
Ana Hobden 8afb8e457d
Use nixpkgs-unstable (#351) 2023-03-20 09:38:44 -07:00
Ana Hobden 371f94ba51
Set NIX_SSL_CERT_FILE in the daemon (#347)
* Set NIX_SSL_CERT_FILE in the daemon

* Fixups
2023-03-20 09:38:15 -07:00
Ana Hobden 3347ccb9d5
Update zshrc, not zshenv (#339)
* Update both zshenv and zshrc

* Update only zshrc

* Add troubleshooting section

* Correct diagnostics note in readme

* Quirks!

* Remove a period

* Improve wording

* Tidy readme a bit

* Unforget a period
2023-03-16 09:39:49 -07:00
Ana Hobden c128700130
Add ssl-cert-file option (#341)
* Add ssl-cert-file option

* Add reqwest support for ssl cert

* Fix build

* Include in install differences

* Handle weird paths, include ENV setting in instructions
2023-03-16 16:32:14 +00:00
Ana Hobden c55a59b10e
Groom plan synopsis (#338)
* Groom plan synopsis

* Review nits
2023-03-16 08:56:03 -07:00
Ana Hobden 89094e0d40
Proxy envs need to get elevated (#342) 2023-03-16 07:43:07 -07:00
Ana Hobden c13b08987b
Explicit proxy support (#337)
* Add proxy support

* Improve clap definition and check

* Include missing protocol

* Improve error
2023-03-14 07:56:57 -07:00
Ana Hobden a977370e74
Add fish vendor_conf.d support (#335)
* Add fish vendor_conf.d support

* Unmess naming
2023-03-13 15:01:00 -07:00
Cole Helbling 96d8870902
Default to systemd, refer to documentation if systemd is not available (#336) 2023-03-13 14:12:33 -07:00
Ana Hobden 8e27adcf98
Be more positive in help output about our software working and not failing (#334) 2023-03-13 14:09:20 -07:00
Cole Helbling 1861d48d59
Only list changed plan settings in summary (#333)
* Only list changed plan settings in summary

* List all settings when `--explain`ing

* Sort the settings output
2023-03-13 13:30:04 -07:00
Ana Hobden c6abf95f02
Add install script cure tests (#322)
* Add install script cure tests

* Add missing stuff from commit

* Fix installer-test-fedora-v36-install-script-multi-broken-daemon-disabled

* Do some renaming

* Speeling

* Tweak permissions since Mac apparently has no root group
2023-03-13 12:09:44 -07:00
Cole Helbling b96e6b2513
Make nix-installer plan invalid-plan fail (#331)
* Make `nix-installer plan invalid-plan` fail

Prior to this change, the `invalid-plan` would unexpectedly be
interpreted as the output path. Now there is a flag to specify where the
plan should be written to.

* use `out-file` and `NIX_INSTALLER_PLAN_OUT_FILE`
2023-03-13 17:41:52 +00:00
Cole Helbling 88eca9eb9c
Include user index in the user comment (#330)
* Include user index in the user comment

If they're all called "Nix build user", anywhere that shows up without
the uid / username would make it difficult to diagnose any issues that
may occur.

* Create users 1-32 instead of 0-31

The official install scripts start at 1 as well.

* Update fixtures

Yes, I hand-edited the macos json, sue me.

* fixup: accept a comment, not the index

* fixup: comment, not index
2023-03-13 10:16:02 -07:00
Ana Hobden e0080d1262
Repair /nix removal test (#320)
* Repair /nix removal test

* Iron out the logic better

* Repair nix flake check

* Remove extra sandbox=false flag

* Add ubuntu 16.04 test
2023-03-10 23:28:04 +00:00
Cole Helbling 32dca2e846
Support busybox user/group modification, more informational errors (#319) 2023-03-10 14:00:20 -08:00
Ana Hobden 7c2f1b03a5
Tweak the logging levels in CI and in some instrumentation (#318) 2023-03-10 11:50:08 -08:00
Ana Hobden 385283173b
Only symlink if the link doesn't already exist in configure_init_service.rs (#317) 2023-03-08 13:50:18 -08:00
Ana Hobden 07a48fe3bd
Cure APFS/Fstabs on Mac (#246)
* wip

* Do main editing portion

* Some more curing on fstab entries

* Overwrite fstab instead of append

* Add newline

* Improve --explain output for CreateNixVolume

* Tweak some permissions

* Fixup a few more permissions spots

* Improve encrypted volume handling

* Handle APFS volumes existing already to some degree

* Correct speeling

* More tweaking preparing for bootstrap/kickstart work

* Most of volume curing works

* Make kickstart use domain/service too

* Fixup nits

* Fix a missing format!
2023-03-08 12:49:13 -08:00
Ana Hobden 4a3deef2a0
Fixup a couple differences with the official installer scripts (#311)
* Fixup a couple differences with the official installer scripts

* Fixup broken tests
2023-03-08 12:44:11 -08:00
Cole Helbling f9ab680840
Cure existing systemd units (#313)
* Cure existing systemd units

* ActionError::Exists -> ActionError::DifferentContent

To more accurately reflect its associated error message.

* create_directory: use PathWasNotDir error instead

* check if the service files and an override dir exists in plan and execute

* fixup: target_os guarding

* fixup: check if existing file is a symlink and see if they link to the same place

* abstract systemd unit checking to function

* fixup: logic error

if the link_dest and unit_src were the same, we'd still error that the
file exists
2023-03-08 12:39:37 -08:00
Ana Hobden 85abfc3cb5
Curing existing /nix (#310)
* Curing existing /nix

* Fixup macs

* Suggest an uninstall command if the binary is not present

* Fixup some nits

* Skip a not great suggestion

* Suggest a nice url
2023-03-08 18:43:57 +00:00
Ana Hobden 5fe7dd9828
Remove nix channel placement (#304)
* Remove place_channel_configuration.rs

* Remove channels option

* Add fixture updates
2023-03-08 09:24:41 -08:00
Ana Hobden 6219b2c48d
Make CreateUser idempotent (#306) 2023-03-07 09:53:12 -08:00
Cole Helbling 2594316750
Integrate nix-config-parser (#263)
Co-authored-by: Ana Hobden <operator@hoverbear.org>
2023-03-06 17:29:44 +00:00
Ana Hobden 903258942c
Add more failure context / Improve error structure (#296)
* wip: add more context to errors

* Add a bunch fo context

* Repair source handling

* Add remaining contexts

* Add some context, but some of it is not right...

* Tidy up contexts properly

* Get command errors working how I want

* Remove some debug statements

* Repair mac build

* Move typetag to Action

* newtypes!

* Fix doctest
2023-03-03 14:20:17 -08:00
Cole Helbling 49154b9863
Make errors non-exhaustive (#299) 2023-03-03 20:03:51 +00:00
Cole Helbling d7c14d6695
Detect WSL1 and error (#297)
* Detect WSL1 and error

WSL1 is not supported because some things Nix relies on to work are not
available.

* Update linux.rs

* Add link to MS docs on WSL1 -> WSL2 upgrade
2023-03-03 09:49:46 -08:00
Cole Helbling 3be93c54f6
Use launchctl load -w on macOS (#298) 2023-03-03 09:28:55 -08:00
Cole Helbling 9c8284cd06
Add newline to end of plan json output (#283)
* Add newline to end of `plan` json output

This causes some shells (like sh) to continue their prompt right after
the closing brace, which is kinda meh.

* Add newline to end of `receipt.json`

`cat /nix/receipt.json` has the same issue as the previous commit, in
that it will bleed into the prompt for some shells that don't insert an
implicit newline.

* Add newline to end of fixture json documents
2023-02-28 08:38:42 -08:00