Flake lock file updates:
• Updated input 'devshell':
'github:numtide/devshell/643d1857fea4e71e7f251cb574f59b1d63778085' (2023-03-03)
→ 'github:numtide/devshell/3e0e60ab37cd0bf7ab59888f5c32499d851edb47' (2023-03-16)
• Updated input 'flake-utils':
'github:numtide/flake-utils/3db36a8b464d0c4532ba1c7dda728f4576d6d073' (2023-02-13)
→ 'github:numtide/flake-utils/93a2b84fc4b70d9e089d029deacc3583435c2ed6' (2023-03-15)
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/5a1dc8acd977ff3dccd1328b7c4a6995429a656b' (2023-03-12)
→ 'github:NixOS/nixpkgs/ac718d02867a84b42522a0ece52d841188208f2c' (2023-03-15)
• Updated input 'pre-commit-hooks':
'github:cachix/pre-commit-hooks.nix/1a20b9708962096ec2481eeb2ddca29ed747770a' (2023-03-09)
→ 'github:cachix/pre-commit-hooks.nix/32b1dbedfd77892a6e375737ef04d8efba634e9e' (2023-03-16)
• Updated input 'pre-commit-hooks/nixpkgs-stable':
'github:NixOS/nixpkgs/2f9fd351ec37f5d479556cd48be4ca340da59b8f' (2023-01-15)
→ 'github:NixOS/nixpkgs/9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8' (2023-03-15)
• Updated input 'rust-overlay':
'github:oxalica/rust-overlay/d907affef544f64bd6886fe6bcc5fa2495a82373' (2023-03-14)
→ 'github:oxalica/rust-overlay/5c1af9b9d618e02a87cdd30a3022aec0b78cd9aa' (2023-03-16)
• Updated input 'treefmt-nix':
'github:numtide/treefmt-nix/5ec73d38dde4c766a9ae19840fc6afa724096f00' (2023-03-12)
→ 'github:numtide/treefmt-nix/0f560a84215e79facd2833b20bfdc2033266f126' (2023-03-15)
|
||
|---|---|---|
| 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.