Skip to content

Commit

Permalink
Add extraHosts option.
Browse files Browse the repository at this point in the history
  • Loading branch information
kurnevsky committed Jul 20, 2023
1 parent 2301e01 commit 672cbbe
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion modules/environment/networking.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,26 @@

with lib;

let
cfg = config.networking;
in

{

###### interface

options = { };
options = {

networking.extraHosts = lib.mkOption {
type = types.lines;
default = "";
example = "192.168.0.1 lanlocalhost";
description = lib.mdDoc ''
Additional verbatim entries to be appended to {file}`/etc/hosts`.
'';
};

};


###### implementation
Expand All @@ -26,6 +41,7 @@ with lib;
hosts.text = ''
127.0.0.1 localhost
::1 localhost
${cfg.extraHosts}
'';

"resolv.conf".text = ''
Expand Down

0 comments on commit 672cbbe

Please sign in to comment.