faucet(id): add systemd-machine-id module option and derive hostId from it
This commit is contained in:
parent
cfeee8b559
commit
1b4cc0dc11
1 changed files with 16 additions and 0 deletions
16
faucet/id/default.nix
Normal file
16
faucet/id/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.faucet.id;
|
||||||
|
in {
|
||||||
|
options.faucet.id = mkOption {
|
||||||
|
type = with types; str;
|
||||||
|
description = "systemd machine id";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
environment.etc.machine-id.text = cfg + "\n";
|
||||||
|
networking.hostId = substring 0 8 cfg;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue