Commit graph

524 commits

Author SHA1 Message Date
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
Ana Hobden 7d2071e84b
Use rustls-tls-native-roots (#332) 2023-03-13 14:13:05 -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 51056b854a
Add test for missing users and groups (#321)
* Add test for missing users and groups

* typo
2023-03-10 12:44:32 -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 f2437037f2
Add curing vm tests (#312)
* add some additional vm tests

* Wire things up

* Add further tests

* Fixups

* Add more exhaustive default test check

* Whoops fmt

* Disable a currently breaking test

* Repair notice content in CONTRIBUTING.md
2023-03-09 17:29:49 +00: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 3f4480a1d2
Fix vm/container tests after #304 (#316) 2023-03-08 11:37:34 -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
Cole Helbling b7d7afd02e
README: clarify WSL means WSL2 (#315) 2023-03-08 18:30:31 +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 c42a3f58d9
v0.5.1-unreleased (#307) 2023-03-06 12:51:43 -08:00
Cole Helbling 9d939e7885
Release v0.5.0 (#305) 2023-03-06 19:12:12 +00: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 d9dfb3c063
Update some dependencies (#303) 2023-03-06 09:14:40 -08: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 792639b6ad
update: dogfood our action (#293) 2023-03-02 08:08:34 -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
Cole Helbling d49e12cd7d
Update default nix_package_url to Nix 2.13.3 (#279) 2023-02-28 08:38:14 -08:00
Cole Helbling f941e13140
Use 0o644 for files, not 0o664 (#278)
(.nix-channels was the last remaining user of the 0o664 typo)
2023-02-28 08:36:09 -08:00
Cole Helbling 9ddcbf6513
Bump tempfile to 3.4.0 (#277) 2023-02-27 07:51:47 -08:00
Graham Christensen d20c0b9746
Describe Diagnostics (#276)
Co-authored-by: Cole Helbling <cole.helbling@determinate.systems>
2023-02-27 15:49:40 +00:00
Ana Hobden f9f927840d
Release v0.4.0 (#273) 2023-02-24 22:29:52 +00:00
Ana Hobden 3fc5857db2
Repair is_ci handling, sudo was erasing the variables (#274) 2023-02-24 22:09:26 +00:00
Ana Hobden db329ea65f
Prelease tidy and add is_ci to Diagnostics (#271)
* Some pre-release tidy and add is_ci to diagnostics

* Bump locks

* Fixup cargo-audit raised issues

* Remove a spare 'I' which we were saving for later

* rename a field

* failure_variant, not error_variant
2023-02-24 13:07:11 -08:00
Ana Hobden 59abd1bef0
Use extra-nix-path to resolve nix-shell -p not working (#270) 2023-02-24 12:28:16 -08:00
Cole Helbling 2fa5bf2e22
gitignore: ignore Nix result directories (#272) 2023-02-24 20:12:58 +00:00
Ana Hobden 19dd7a13d4
Add diagnostics reporting (#264)
* Add diagnostics reporting

* Some tidying

* Remove injected failure

* Update URL

* Fixups

* Fix tests

* Use triples instead of architecture
2023-02-24 10:11:12 -08:00
Cole Helbling 8de35b2477
README: upgrade MacOS stability and note (#269)
Removing users and/or groups may fail if there is no user logged in
graphically. Aside from that, it should work.
2023-02-24 09:27:00 -08:00
Cole Helbling b04b1eec70
Improve permissions checking when dealing with existing files (#267)
* create_file: check if path is file, improve permissions checking

* create_or_insert_into_file: check if path is file, improve permissions checking

* fixup: 100xxx -> xxx modes

* fixup: suggest legal mode for chmod
2023-02-23 19:32:09 +00:00
Ana Hobden 689cf84bbf
Enable deleting users and groups on Mac (#253)
* Enable deleting users and groups on Mac

* Scaffold user change

* Add a warning if it doesn't work in situations we expect it to not work

* Scaffold out doing group member ship -- maybe we need an AddGroup action

* AddUserToGroup action

* Update plans

* Improve messaging

* Nit in error message

* Repair some review nits
2023-02-22 07:46:52 -08:00
Ana Hobden 7e951a5b6a
Set the correct permissions on the zshenv (#257)
* Set the correct permissions on the zshenv

* Update error to suggest chmod instead of delete

* Missed a formatting option

* 644, not 755

* Get a bit more specific

* Mac specific permissions
2023-02-21 07:28:14 -08:00
Luc Perkins 5582d050fc
Add note on --no-confirm flag (#261) 2023-02-21 07:27:21 -08:00
Ana Hobden a89e05b850
Don't parallize user creation (#260) 2023-02-18 16:56:25 -08:00
Ana Hobden 5e7cb50c50
Don't specify chmod on synthetic.conf (#259) 2023-02-17 14:10:00 -08:00
Ana Hobden f20b2a4b63
Improve error message guidance (#258)
* Improve error message guidance

* Fix octal
2023-02-17 20:41:01 +00:00