nixos: cosmetic refactor of environment.etc."hostid"
Create the file using attrset instead of list, to make it easier to later provide other files in the same module.
This commit is contained in:
parent
31dc66a55a
commit
49d444416c
@ -910,11 +910,8 @@ in
|
|||||||
domainname "${cfg.domain}"
|
domainname "${cfg.domain}"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
environment.etc = mkIf (cfg.hostId != null)
|
environment.etc."hostid" = mkIf (cfg.hostId != null)
|
||||||
[
|
{ source = pkgs.runCommand "gen-hostid" {} ''
|
||||||
{
|
|
||||||
target = "hostid";
|
|
||||||
source = pkgs.runCommand "gen-hostid" {} ''
|
|
||||||
hi="${cfg.hostId}"
|
hi="${cfg.hostId}"
|
||||||
${if pkgs.stdenv.isBigEndian then ''
|
${if pkgs.stdenv.isBigEndian then ''
|
||||||
echo -ne "\x''${hi:0:2}\x''${hi:2:2}\x''${hi:4:2}\x''${hi:6:2}" > $out
|
echo -ne "\x''${hi:0:2}\x''${hi:2:2}\x''${hi:4:2}\x''${hi:6:2}" > $out
|
||||||
@ -922,8 +919,7 @@ in
|
|||||||
echo -ne "\x''${hi:6:2}\x''${hi:4:2}\x''${hi:2:2}\x''${hi:0:2}" > $out
|
echo -ne "\x''${hi:6:2}\x''${hi:4:2}\x''${hi:2:2}\x''${hi:0:2}" > $out
|
||||||
''}
|
''}
|
||||||
'';
|
'';
|
||||||
}
|
};
|
||||||
];
|
|
||||||
|
|
||||||
environment.systemPackages =
|
environment.systemPackages =
|
||||||
[ pkgs.host
|
[ pkgs.host
|
||||||
|
Loading…
Reference in New Issue
Block a user