mirror of
https://github.com/nickolaj-jepsen/nixos.git
synced 2026-01-22 16:16:50 +01:00
update
This commit is contained in:
parent
2b7b63a18c
commit
638ef7093e
140 changed files with 307 additions and 121 deletions
22
modules/base/networking.nix
Normal file
22
modules/base/networking.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
config,
|
||||
hostname,
|
||||
...
|
||||
}: {
|
||||
age.secrets.hosts-private = {
|
||||
# Contains IP addresses that i have no business sharing
|
||||
rekeyFile = ../../secrets/hosts-private.age;
|
||||
};
|
||||
|
||||
# Inject the private hosts file, because setting networking.hostFiles doesn't work
|
||||
system.activationScripts.hosts-private = ''
|
||||
cat /etc/hosts > /etc/hosts.bak
|
||||
rm /etc/hosts
|
||||
cat /etc/hosts.bak "${config.age.secrets.hosts-private.path}" >> /etc/hosts
|
||||
rm /etc/hosts.bak
|
||||
'';
|
||||
|
||||
networking = {
|
||||
hostName = hostname;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue