Flake lock file updates:
• Updated input 'crane':
'github:ipetkov/crane/5291dd0aa7a52d607fc952763ef60714e4c881d4' (2023-03-07)
→ 'github:ipetkov/crane/2552a2d1ccf33d43259a9e00f93dbacb9e6d6bed' (2023-03-20)
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/ac718d02867a84b42522a0ece52d841188208f2c' (2023-03-15)
→ 'github:NixOS/nixpkgs/1603d11595a232205f03d46e635d919d1e1ec5b9' (2023-03-18)
• Updated input 'rust-overlay':
'github:oxalica/rust-overlay/5c1af9b9d618e02a87cdd30a3022aec0b78cd9aa' (2023-03-16)
→ 'github:oxalica/rust-overlay/c680a0a4144bb0931f6cebd601a3978bbafc4f64' (2023-03-20)
|
||
|---|---|---|
| nix | ||
| src | ||
| .envrc | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| default.nix | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| README.md | ||
| shell.nix | ||
Profile generation
Activation strategy
The activation script calls system-manager activate,
which will perform the following actions.
Systemd services
The info about services (name and store path of the service file) is found
in a file called services/services.json in the system-manager configuration directory.
The info about the services that were part of the previous generation is stored
in a state file at /var/lib/system-manager.
We then:
- Compare the list of services present in the current configuration with the ones stored in the state file from the previous generation.
- For all services in the new generation,
create a symlink from
/etc/systemd/system/<service name>to the service file in the nix store. - For all services present in the old generation but not in the new one:
- Stop the service.
- Remove the symlink from
/etc/systemd/system.
- Perform a systemd daemon-reload
- Start the services that are present in this generation and not in the previous one
- Restart services that are present in both
This approach basically ignores the wantedBy option.
A future version might improve upon this, but one of the complexities is that
NixOS does not encode the wantedBy option in the generated unit files, but
rather produces <unit name>.wants directories in the directory that
/etc/systemd/system gets linked to.
Supporting this properly would mean that we need to find a way to register
the wantedBy option on a non-NixOS system in a way such that we can use it.