add NixOS flakes transition and state diagrams
parent
fffba0decb
commit
d1623b3a02
|
@ -0,0 +1,28 @@
|
|||
@startuml
|
||||
|
||||
state "current state" as current
|
||||
current : NixOS 22.11 w/o flakes
|
||||
|
||||
state "next state" as next
|
||||
next : NixOS 22.11 w/ flakes
|
||||
|
||||
state "future state" as future
|
||||
future : NixOS 23.05 w/ flakes
|
||||
|
||||
state "initial state" as initial
|
||||
initial : "Ubuntu"
|
||||
|
||||
initial -r-> next : implemented &\ntested @ hetzner\nTODO: digital-ocean
|
||||
current --> next : not tested\n(2023-11-30)
|
||||
next --> future
|
||||
|
||||
note right of next
|
||||
updated
|
||||
application
|
||||
needed
|
||||
end note
|
||||
|
||||
next -u[#red,dashed]-> current : full rollback\n<color:red><b>not possible\n(hard to implement)
|
||||
future --> next : full rollback\npossible
|
||||
|
||||
@enduml
|
|
@ -0,0 +1,76 @@
|
|||
@startuml
|
||||
|
||||
title SP NixOS state diagram
|
||||
|
||||
hide empty description
|
||||
|
||||
state "Ubuntu state" as ubuntu_state
|
||||
state "SP NixOS" as sp_nixos {
|
||||
state "clean state" as clean_state
|
||||
clean_state : * /etc/nixos = /etc/selfprivacy/nixos-config-source
|
||||
clean_state : * system @ profile<sub>N</sub>
|
||||
clean_state : * bootloader @ profile<sub>N</sub>
|
||||
clean_state : * all services up
|
||||
|
||||
state "modified config state" as modified_state
|
||||
modified_state : * /etc/nixos ≠ /etc/selfprivacy/nixos-config-source
|
||||
modified_state : * system @ profile<sub>N</sub>
|
||||
modified_state : * bootloader @ profile<sub>N</sub>
|
||||
modified_state : * all services up
|
||||
|
||||
state "new profile <color:red>failed activation</color> state" as new_profile_failed_activation_state
|
||||
new_profile_failed_activation_state : * /etc/nixos = /etc/selfprivacy/nixos-config-source
|
||||
new_profile_failed_activation_state : * system @ profile<sub>N+1</sub>
|
||||
new_profile_failed_activation_state : * bootloader @ profile<sub>N+1</sub>
|
||||
new_profile_failed_activation_state : * some <color:red>services failed
|
||||
|
||||
state "old profile <color:red>without activation</color> state" as old_profile_no_activation_state
|
||||
old_profile_no_activation_state : * /etc/nixos = /etc/selfprivacy/nixos-config-source
|
||||
old_profile_no_activation_state : * system @ profile<sub>N-1</sub>
|
||||
old_profile_no_activation_state : * <color:red>bootloader @ profile<sub>N</sub>
|
||||
old_profile_no_activation_state : * <color:red>no services reload
|
||||
|
||||
/'
|
||||
' state "new profile <color:red>failed bootloader state" as new_profile_failed_bootloader_state
|
||||
' new_profile_failed_bootloader_state : * /etc/nixos = /etc/selfprivacy/nixos-config-source
|
||||
' new_profile_failed_bootloader_state : * system @ profile<sub>N+1</sub>
|
||||
' new_profile_failed_bootloader_state : * <color:red>bootloader @ profile<sub>N</sub>
|
||||
' new_profile_failed_bootloader_state : * all services up
|
||||
'/
|
||||
|
||||
[*] --> clean_state : boot
|
||||
clean_state --> modified_state : <u>change via API:\n""userdata.json""\n""sp-modules/flake.nix""\n""sp-modules/flake.lock""\n<u>NixOS upgrade:\n""flake.lock""\n
|
||||
modified_state -u-> modified_state : \n\n\n\n\n\n\nnixos-rebuild switch\n<color:red>build\n<color:red>failure
|
||||
modified_state -u-> modified_state : nixos-rebuild switch\n<color:red>bootloader\n<color:red>update\n<color:red>failure
|
||||
modified_state -l-> new_profile_failed_activation_state : nixos-rebuild switch\n<color:red>activation\n<color:red>failure
|
||||
clean_state -u-> clean_state : \nrollback\nto profile<sub>N-1</sub>
|
||||
clean_state -l-> old_profile_no_activation_state : rollback\n<color:red>bootloader\n<color:red>update\n<color:red>failure
|
||||
old_profile_no_activation_state -l-> [*] : <color:red>99% chance disk is full!\n<color:red>do something?\nreboot?
|
||||
new_profile_failed_activation_state -u-> clean_state : rollback\nto profile<sub>N-1</sub>
|
||||
|
||||
state "new state" as new_state
|
||||
new_state : * /etc/nixos = /etc/selfprivacy/nixos-config-source
|
||||
new_state : * system @ profile<sub>N+1</sub>
|
||||
new_state : * bootloader @ profile<sub>N+1</sub>
|
||||
new_state : * <b><color:darkred>all services up?
|
||||
|
||||
modified_state --> new_state : nixos-rebuild switch\n@ profile<sub>N+1</sub>
|
||||
new_state -u-> clean_state : <b><u>selftest\n<b><color:green>OK</color></b> => do nothing\n<b><color:red>FAIL</color></b> => <b>rollback
|
||||
/'
|
||||
' new_state --u-> clean_state : <b>selftest\n<b><color:red>FAIL => rollback
|
||||
'/
|
||||
}
|
||||
|
||||
[*] -r-> ubuntu_state : boot
|
||||
ubuntu_state --> sp_nixos
|
||||
note on link
|
||||
nixos-infect
|
||||
---
|
||||
<- ""https://releases.nixos.org/nix/nix-${NIX_VERSION}/install""
|
||||
<- ""https://git.selfprivacy.org/selfprivacy/selfprivacy-nixos-infect""
|
||||
end note
|
||||
' <- ""https://git.selfprivacy.org/selfprivacy/selfprivacy-nixos-config""
|
||||
|
||||
footer %date("yyyy-MM-dd'T'HH:mmZ")
|
||||
|
||||
@enduml
|
Loading…
Reference in New Issue