From cfcb4acf1640ea41a26d93cfd2ab3583f353a116 Mon Sep 17 00:00:00 2001 From: Tobias Happ Date: Thu, 27 May 2021 18:26:59 +0200 Subject: [PATCH] networking: add basic /etc files for networking --- modules/environment/networking.nix | 36 ++++++++++++++++++++++++++++++ modules/module-list.nix | 1 + 2 files changed, 37 insertions(+) create mode 100644 modules/environment/networking.nix diff --git a/modules/environment/networking.nix b/modules/environment/networking.nix new file mode 100644 index 0000000..38d82fe --- /dev/null +++ b/modules/environment/networking.nix @@ -0,0 +1,36 @@ +# Copyright (c) 2019-2021, see AUTHORS. Licensed under MIT License, see LICENSE. + +{ config, lib, pkgs, ... }: + +with lib; + +{ + + ###### interface + + options = { + + }; + + + ###### implementation + + config = { + + environment.etc = { + # /etc/services: TCP/UDP port assignments. + services.source = pkgs.iana-etc + "/etc/services"; + + # /etc/protocols: IP protocol numbers. + protocols.source = pkgs.iana-etc + "/etc/protocols"; + + # /etc/hosts: Hostname-to-IP mappings. + hosts.text = '' + 127.0.0.1 localhost + ::1 localhost + ''; + }; + + }; + +} diff --git a/modules/module-list.nix b/modules/module-list.nix index 34f12fe..aa2392a 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -9,6 +9,7 @@ ./environment/files.nix ./environment/links.nix ./environment/login + ./environment/networking.nix ./environment/path.nix ./environment/session-init.nix ./home-manager.nix