Flake lock file updates:
• Updated input 'crane':
'github:ipetkov/crane/cfb6efcfc706e21c84682171581168e591b265d9' (2023-02-16)
→ 'github:ipetkov/crane/953b70da2813fb882c39890f2514e7db76fc8843' (2023-02-19)
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/28319deb5ab05458d9cd5c7d99e1a24ec2e8fc4b' (2023-02-15)
→ 'github:NixOS/nixpkgs/b69883faca9542d135fa6bab7928ff1b233c167f' (2023-02-20)
• Updated input 'pre-commit-hooks':
'github:cachix/pre-commit-hooks.nix/5f0cba88ac4d6dd8cad5c6f6f1540b3d6a21a798' (2023-02-16)
→ 'github:cachix/pre-commit-hooks.nix/c9495f017f67a11e9c9909b032dc7762dfc853cf' (2023-02-20)
• Updated input 'rust-overlay':
'github:oxalica/rust-overlay/3bab7ae4a80de02377005d611dc4b0a13082aa7c' (2023-02-16)
→ 'github:oxalica/rust-overlay/f02d590b871a6241dc55d41e799bc530e28214ce' (2023-02-21)
|
||
|---|---|---|
| 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.