Commit graph

313 commits

Author SHA1 Message Date
Ana Hobden 9c915b3f6a
bugfix: Let Mac users specify encryption directly (#546) 2023-06-30 12:43:02 -07:00
Ana Hobden 3586457624
Turn off auto optimise store on mac (#542)
* Disable auto-optimise-store on Mac

* Add comment on why we disable something

* fmt

* Auto-allocate-uids is linux only too
2023-06-28 21:11:16 +00:00
Ana Hobden 4bfd6c2547
Use ssl-cert-file config (#527)
* Use ssl-cert-file config

* Include mac change

* Use canonical ssl cert file

* Don't set ssl-cert-file in shell profiles

* Canonicalize in diagnostics

* Optionally read cert file
2023-06-26 10:36:46 -07:00
Ana Hobden 0b6d723db3
Uninstalling should change directory if in nix (#526)
* Change directory during uninstall if run from /nix

* Include log message
2023-06-23 11:42:18 -07:00
Ana Hobden a962b3390b
Restore user creation on Mac (#524)
* Restore user creation on Mac

* Repair MacOS build

* Pass clone not borrow

* Fixup double group create

* Add some links
2023-06-23 10:29:47 -07:00
Ana Hobden b29a7585bd
Add self test functionality (#506)
* Add self test functionality

* Fix mac ci

* Improve erorr messaging

* i32 support

* Fixup self-test comment

* Fix review nits
2023-06-08 08:09:04 -07:00
Ana Hobden 99941446df
Fix uninstalling on latest steam deck with offload (#502) 2023-06-02 07:34:31 -07:00
Ana Hobden 1d51b25bf7
Use os-release to determine appropriate planner (#501) 2023-06-01 13:00:39 -07:00
Ana Hobden 5a07b2331b
Support for SteamOS Nix Offload in SteamOS 20230522.1000 (#495)
* Document how to handle different branches and buildIDs of the steam deck OS

* Changes required for SteamOS 20230522.1000

* Speeling

* Handle steamos upgrades better

* Speeling

* Tidy
2023-06-01 09:48:50 -07:00
Ana Hobden 0f231b715f
Improve messaging when /nix/receipt.json is already found (#491)
* Improve messaing when receipt already found

* Further improvement

* Use a const for message
2023-06-01 16:23:54 +00:00
Ana Hobden 7ec5148e6d
Add time machine exclusions for Mac (#480)
* Add time machine exclusions for Mac

* Prod CI

* Stub out mac test for a remote build

* Add plan changes

* wip

* Move the exclusions to be later

* Fixups

* Use pathbufs

* Import pathbuf

* Update test plans
2023-05-31 13:36:44 -07:00
Ana Hobden f91b93bdb0
APFS volumes don't necessarily have names (#490) 2023-05-31 13:36:24 -07:00
Ana Hobden 464ac0776e
Fixup GHA home directory on Mac (#482) 2023-05-26 13:16:31 -07:00
Ana Hobden 2673a9b299
Improve WSL systemd detection (#469)
* Improve WSL systemd detection

* Make systemd missing in wsl an expected error

* fmt

* Use && instead

* Make it more verbose
2023-05-19 14:49:43 +00:00
Ana Hobden 5a8526268d
Improve the SELinux heuristic to look for sestatus (#470) 2023-05-18 09:47:28 -07:00
Ana Hobden 9de3c56c37
Improve messaging around version incompatability (#457)
* Improve messaging around version incompatability, suggesting how the user may address the situation

* Even better messaging

* Improve plan versioning messaging

* Remove note about /nix/nix-installer since it may not exist
2023-05-17 10:29:47 -07:00
Ana Hobden 1c18698ee6
Improve failure chain on revert (#467) 2023-05-17 16:01:36 +00:00
Ana Hobden e3a5ffc8f7
Add SELinux support (#465)
* Add SELinux support

* Nits

* Fix spellcheck

* Don't store mod, use locked shell

* Unwhoops a stale comment

* Speeling: Myy aarch neemesis

* Fix lost code:

* Add method note
2023-05-17 16:27:14 +02:00
Ana Hobden 10732cef68
Don't error if already installed with same settings, just warn (#454) 2023-05-09 07:53:36 -07:00
Ana Hobden 7c9dfacf8e
Fixup multiple --extra-conf usages (#456)
* Fixup multiple --extra-conf usages

* Merge experimental-features passed in extra-conf
2023-05-09 07:53:25 -07:00
Ana Hobden 217c3683bc
Make the RequiredBy items in the nix.mount of steam-deck planner in [Install] (#455) 2023-05-09 07:52:11 -07:00
Ana Hobden 08ef3bb82a
Test Nix 2.15 and the auto-uid-allocation feature (#196)
* Auto UID allocation

* Uncomment plan tests

* Delete legacy users on install

* Group up deleteuser actions
2023-05-05 13:54:37 -07:00
Ana Hobden bdd087a615
Set permissions on unpacked Nix store paths more carefully (#451)
* Set permissions on unpacked Nix store paths more carefully

* Don't setperm on links
2023-05-05 12:27:00 -07:00
Ana Hobden 965185dcab
fsync after writing Nix config to attempt to fix the flaky preserves_comment test (#448) 2023-05-05 12:12:05 -07:00
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
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
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
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 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
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
Ana Hobden c150d603ea
Remove some bad merge code (#252) 2023-02-15 13:20:58 -08:00
Ana Hobden 1b3d441051
Clarify stability (#244)
* Clarify stability a bit

* Further stability clarification in CONTRIBUTING.md

* Improve some wording
2023-02-13 14:07:35 -08:00
Ana Hobden e3d06c24e7
Offer users better error if fstab entries exist (#241)
* Offer users better error if fstab entries exist

* Split up errors

* Remove a naughty bracket

* last nits
2023-02-10 22:44:39 +00:00
Ana Hobden fc13c1d250
Make systemd unit start detect already running unit (#240)
* Make systemd unit start detect already running unit

* Prod CI

* Fixup messaging

* Reflect comments
2023-02-10 20:43:46 +00:00
Ana Hobden ab4c528595
Rename some of the planners (#243)
* Rename some of the planners

* Fixup Mac

* Also move actions

* Also update CI
2023-02-10 20:35:00 +00:00
Ana Hobden e35278a121
It's the Determinate Nix Installer (#242)
* We like the phrasing the Determinate Nix Installer for now

* Cajoled

* Fixups
2023-02-10 19:48:44 +00:00
Ana Hobden 20b054b50c
Better support existing files with CreateFile and CreateorInsertIntoFile (#239)
* Better support existing files with CreateFile and CreateorInsertIntoFile

* Skip instead of complete if found

* Fixup some permissions

* Fixup nix version used

* Use unix module instead of linux one

* Use unix module instead of linux one in other spot

* Also cover CreateDirectory

* Add some more tests

* Fixup messaging

* Corect some logic inversions
2023-02-10 10:56:22 -08:00
Ana Hobden ce28eedf2a
Better support users/groups existing before install (#238)
* Better support users/groups existing before install

* Skip instead of complete if found

* Prod CI

* Add debuging messages

* Mark completed instead of skipped
2023-02-09 10:34:34 -08:00
Ana Hobden 28db9f2953
Attempt to minimize steam deck display manager restart risk (#237)
* Attempt to minimize steam deck display manager restart risk

* Fiddle a bit more

* Prod CI

* Be much more specific with services we restart
2023-02-08 11:58:48 -08:00
Ana Hobden 4884588339
Bump Nix to 2.13.2 (#236)
* Bump Nix to 2.13.2

* Use nix 2.13.2 in flake

* Prod CI
2023-02-08 11:41:36 -08:00
Ana Hobden 2c91bea9eb
Add 32 bit support (#229)
* Add 32 bit support

* Add buildkite job for i686

* Use x86 for system on i686

* Adapt nix-installer.sh script to support i686
2023-02-06 07:50:23 -08:00
Ana Hobden d69f335703
init-less install (#188)
* wip

* Add dockerfile

* Add readme bits

* Fix logic inversion

* Relax init detection error

* Tidying heuristics

* Fix doc tests

* Mac supports start-daemon false

* Get VM tests working

* Add instructions

* Some target_os flagging

* More target flagging

* Fix lints

* Fixup more mac-only stuff

* cfg flag examples too

* Fix planner wording

* More os specific lint fixing

* More refinement on mac and the README

* Add new CI jobs to test no-daemon

* Use nix-installer-pr to point at branch

* Tests with no-init

* init/no-daemon are linux only

* nix tests support a per-distro all attribute

* Add working podman test

* Expand docker tests

* Add contributing notes

* format

* Support both podman and docker

* Update contributing

* Add Windows WSL test script for Ubuntu

* format nix tests

* More ignores to check-spelling

* Add systemd based wsl test

* We don't have root-only darwin

* Reflect review nits

* Reenable tests

* Restore mac plan

* Flag off os specific tests

* Better cfg flagging

* Remove dead comments

* Rework readme to look better with new sections

* Correct codeblock language

* Remove some warnings
2023-02-01 12:35:52 -08:00