refactor: prepare new modules structure

This commit is contained in:
Nickolaj Jepsen 2025-05-20 20:05:23 +02:00
parent d25e24c15b
commit bf82970b9e
65 changed files with 94 additions and 94 deletions

17
modules/base/hosts.nix Normal file
View file

@ -0,0 +1,17 @@
{
config,
...
}: {
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
'';
}