Flake lock file updates:
• Updated input 'crane':
'github:ipetkov/crane/953b70da2813fb882c39890f2514e7db76fc8843' (2023-02-19)
→ 'github:ipetkov/crane/105e27adb70a9890986b6d543a67761cbc1964a2' (2023-03-04)
• Updated input 'devshell':
'github:numtide/devshell/71e3022e3ab20bbf1342640547ef5bc14fb43bf4' (2023-02-13)
→ 'github:numtide/devshell/643d1857fea4e71e7f251cb574f59b1d63778085' (2023-03-03)
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/d0d55259081f0b97c828f38559cad899d351cad1' (2023-02-21)
→ 'github:NixOS/nixpkgs/3c5319ad3aa51551182ac82ea17ab1c6b0f0df89' (2023-03-04)
• Updated input 'pre-commit-hooks':
'github:cachix/pre-commit-hooks.nix/c9495f017f67a11e9c9909b032dc7762dfc853cf' (2023-02-20)
→ 'github:cachix/pre-commit-hooks.nix/382bee738397ca005206eefa36922cc10df8a21c' (2023-03-03)
• Updated input 'rust-overlay':
'github:oxalica/rust-overlay/6c9e8ea3ba73a9fed29ddc1cc52ade8e5c946a8d' (2023-02-22)
→ 'github:oxalica/rust-overlay/1a9f6285d441ff438a6a1422dc3fde109d8615bf' (2023-03-05)
• Updated input 'treefmt-nix':
'github:numtide/treefmt-nix/819dd7f076832838bba238eceef9a3dbfc63f5d0' (2023-02-11)
→ 'github:numtide/treefmt-nix/f7fcf3770c6cec6fd5f995ba94e6e6376019b9ff' (2023-02-26)
|
||
|---|---|---|
| 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.