articles/NixOS-configuration-restruc.../configuration-inputs-output...

108 lines
2.5 KiB
Plaintext

@startuml
left to right direction
<style>
cloud {
LineThickness 3
LineColor lightblue
BackGroundColor lightcyan
}
folder {
LineThickness 3
LineColor lightblue
BackGroundColor lightcyan
}
</style>
node "NixOS machine" as machine {
file "hardware-configuration.nix" as hardware_configuration #lightcyan
folder """userdata/""" as userdata_folder {
/'
' file "schema.json\n<i>(who uses?)" as schema
' file "tokens_schema.json\n<i>(who uses?)" as tokens_schema
'/
file "tokens.json" as tokens
file "<b>userdata.json" as userdata
tokens -l[hidden]- userdata
}
collections "/nix/store/*" as nix_store
file local_flake_nix [
<b>flake.nix
===
inputs = {
selfprivacy-nixos-config.url = ...;
};
outputs = {
nixosConfigurations =
selfprivacy-nixos-config.outputs.nixosConfigurations-fun
hardware-configuration userdata;
};
]
/'
' file local_flake_lock as "flake.lock"
' local_flake_nix -l- local_flake_lock
'/
}
folder "configuration repo" as config_repo {
/'
' file "flake.nix" as flake_nix {
' card "input: nixpkgs.url"
' card "input: selfprivacy-overlay.url"
' }
'/
file flake_nix [
<b>flake.nix
===
inputs = {
nixpkgs.url = ...;
selfprivacy-overlay.url = ...;
};
outputs = {
nixosConfigurations-fun =
hardware-configuration: userdata:
...;
};
]
file flake_lock [
<b>flake.lock
]
flake_lock - flake_nix
note top of flake_lock : pinning with hashes
file "<b><u>configuration.nix" as configuration
collections "pure imports" as pure_imports
}
cloud "overlay\n<i>commit @ git.selfprivacy.org" as overlay {
node "selfprivacy-graphql-api" as selfprivacy_graphql_api
}
cloud "selfprivacy-rest-api\n<i>commit @ git.selfprivacy.org" as selfprivacy_rest_api_commit {
component "python app" as selfprivacy_api_app
}
cloud " <b>nixpkgs\n<i>commit @ github.com (?)" as nixpkgs
nixpkgs --> flake_lock
overlay --> flake_lock
local_flake_nix <-r- userdata
local_flake_nix <-l- hardware_configuration
selfprivacy_rest_api_commit -->> selfprivacy_graphql_api
flake_nix --> configuration
flake_lock --> configuration
configuration --> local_flake_nix
local_flake_nix -[bold]-|> nix_store : nixos-rebuild
configuration <-l- pure_imports
footer %date("yyyy-MM-dd'T'HH:mmZ")
@enduml