Commit graph

86 commits

Author SHA1 Message Date
Graham Christensen 60e5fff623
Support user-defined diagnostics attribution (#635)
* Switch to flakehub

* Diagnostics: support user-defined attribution.

Allows a user to specify an additional value to associate their diagnostics with that value. nix-installer doesn't generate or store these values, and most users have no need for it.

* Respond to feedback
2023-09-20 11:23:23 -07:00
Ana Hobden 05571a4990
Make nix.conf changes deterministic (#620)
* Make nix.conf changes deterministic

* Add mac fixture

* Warn/error if user settings don't match our needs

* Repair mac fixture

* fmt

* clipster

* Tidy up some feedback

* fmt

* resolve some nits
2023-09-13 17:02:05 +00:00
Ana Hobden b3dcf07f58
Check for file existence before attempting to open it (#626)
* Check for file existence before attempting to open it

* Fixup
2023-09-13 09:55:44 -07:00
Ana Hobden dd36129aa2
Improve --help (#624) 2023-09-13 09:52:41 -07:00
Ana Hobden ff20fc04b3
Fix the Mac CI with Silverblue (#591) 2023-07-24 11:44:28 -07:00
Hofer-Julian e84fd2bed9
Add support for ostree-based Linux distributions (#586)
* Add support for ostree-based Linux distributions

Fixes #389
I've tested this planner on Fedora Silverblue and Endless OS

* Stop duplicating check functions

* Remove `init` cli flag
2023-07-24 11:10:20 -07:00
Ana Hobden a049e52fd8
Teach installer about Clear Linux (#581) 2023-07-24 10:43:10 -07:00
Hofer-Julian c3fa6e9623
Fix most clippy warnings (#572)
The only remaining is at `NixInstallerSubcommand`

See https://rust-lang.github.io/rust-clippy/master/index.html#/large_enum_variant
2023-07-17 08:34:46 -07:00
Ana Hobden 80026e1e2f
Add pre install/uninstall checks to planners (#561)
* Add pre install/uninstall checks to planners

* Refine checks

* fmt

* Make sure checks run before install/uninstall described as well

* Make nix-darwin error expected

* Fix import

* Fix import

* Report expected errors properly

* format
2023-07-12 09:08:42 -07:00
Ana Hobden 9c915b3f6a
bugfix: Let Mac users specify encryption directly (#546) 2023-06-30 12:43:02 -07: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 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 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 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 5a8526268d
Improve the SELinux heuristic to look for sestatus (#470) 2023-05-18 09:47:28 -07: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 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 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 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 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 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 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 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
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 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 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 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
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
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 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 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
Ana Hobden 232789ed1c
Fixup fdesetup isactive outputting when it should not (#163) 2023-01-09 09:24:24 -08:00
Ana Hobden e27d01f221
Correctly expected error in default planner if nix installed (#151)
* Correctly expected error in default planner if nix installed

* fixup
2023-01-04 09:32:45 -08:00
Ana Hobden d510fa812f
Resolve a system unit ordering bug after update (#144) 2023-01-03 10:31:17 -08:00
Ana Hobden deee222ad2
Fix ubuntu 16.04 support (#140)
* Fix ubuntu 16.04 support

* Format

* Correct env settings

* Rearrange plan a bit
2022-12-23 13:24:06 -08:00
Ana Hobden d299dbf0f2
Rename harmonic to nix-installer (#125)
* Rename harmonic to nix-installer

* Fix build

* handle nix-install.sh rename

* Forgot some things

* Fix a mistype

* Fix env var

* Fix merge change that popped up
2022-12-19 18:26:58 +00:00
Ana Hobden 1e6d7d75c9
Do SELinux checks (#123)
* Do SELinux checks

* Add improved error message with issue link

* Improve SELinux error message

* Correct lint
2022-12-19 07:30:45 -08:00
Ana Hobden c4274c93fb
Add action & Tune Tracing (#119)
* Add action

* Checkout so we have actions.yml

* yaml poking

* Handle GITHUB_TOKEN

* Don't ask github to do templating, use directives for logging

* Missing changes

* Fix build error

* Fix yaml even more

* Add shell command

* Add a wait on the socket again

* Print some debugging

* Use more correct env vars

* Correct install url logic

* Use different style for inputs

* Fix yaml errror

* Tweak around local-root

* provision nix-install.sh as well

* Use nix-install.sh path directory in NIX_INSTALL_URL

* Tweak variables to hopefully work

* Call it BINARY_ROOT instead

* Add exec output

* Set no-confirm

* no echo

* Add token to workflow

* Set no-confirm properly

* Add no-confirm back for uninstall

* Correct some env and vars

* CreateDirectory respects existing symlink

* Add a few more checks to the CI

* pass valid yaml...

* Slightly more aggressive cleanup of /nix

* Ensure steam-deck cleans /home/nix

* Add steam-deck check for persistence

* Canonicalize steam-deck persistence

* Ensure absolute path

* Inverted logic sad

* python3 on mac

* Add readme info and fix a extra-conf mistype

* Add unsaved changes

* More fine grained trace logging

* Restore spans we lost in refactor

* BuiltinPlanner can accept settings

* Reflect feedback

* Push actually working code hopefully this time

* Speeling
2022-12-16 18:55:28 +00:00
Ana Hobden 51a2d0bbae
Fix --no-default-features build (#114)
* Fix --no-default-features build

* Correct yaml for gha

* gha yaml sure is a thing

* Fix yaml yet again

* Fix nix develop invocation

* Fix --all-features pass
2022-12-12 12:21:10 -08:00
Ana Hobden dad8180985
Allow expected errors (#116)
* Move binary out of /nix if it is there during uninstall

* Add tracing

* Sorta working...

* Have expected() return an err

* Better handle expected errors during install

* Hello trailing whitespace
2022-12-12 12:20:50 -08:00
Ana Hobden ac5660b3e0
Fix the nix-directory.service possibly erroring and preventing nix from working (#101) 2022-12-09 07:36:35 -08:00
Ana Hobden 4ce8d94ac7
Create ActionError (#79)
* wip

* Fixes

* Fix a comment
2022-12-05 08:55:30 -08:00
Ana Hobden ae37842a0d
Add Steam Deck Support (#34)
* Init Steam Deck support

* Improve systemd units

* Handle stopping nix-daemon.service before stopping mount

* Better handle being in a sysext

* Add some install directions

* Add a KDE autostart script

* Tidy up uninstall

* Use stop/disable instead of disable --now

* Fixup a double-disable

* Repair some defaults

* Tidy up services

* Make ci test steam deck planner

* Delete bonus line

* Use newer image

* Get steam-deck working hopefully

* Create steamos-readonly mock

* Make stub of steamos-readonly

* Use sudo for chmod

* Attempt CI fix

* Don't add deck group

* A more clever method

* We have a new method and the CI can be cleaned a bit

* Brazenly disable sandbox on the deck ci

* Extra-conf takes vec

* Dump lsblk mount

* An even more clever method

* More debugging symbols

* More debugging symbols

* Even more debugging

* probe for issues

* Get specific with permissions and ownership (for ci)

* We are now way overboard on debugging symbols

* Specify permissions on created home stub

* Allow specifying persistence

* Cleanup debugging bits

* Fixup persistence path

* Work out some better linking in units

* units don't need executable

* Tidy

* Delint

* Remove a note from readme

* Github actions seems to have build the wrong checkout?

* Doctest repair

* Don't create directory twice

* Restore missing doc comments

Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
2022-12-02 07:31:15 -08:00
Ana Hobden c39bf0a510
Flesh out docs and tidy up public API substantially (#67)
* Make plans versioned

* Delint

* speeeeeeeeling

* remove file that was dead

* Flesh out docs and improve public API

* Speeling

* Fixups

* Fix doctests

* Do a better job with actionstate

* Add some more docs

* Fix doctest

* Make CLI stuff optional

* Touchup

* Speeling
2022-11-28 22:57:35 +00:00