nixos/images/base-config.nix

85 lines
1.9 KiB
Nix
Raw Permalink Normal View History

# based on: https://github.com/Mic92/dotfiles/blob/main/nixos/images/base-config.nix
2024-07-28 21:08:02 +02:00
{
lib,
pkgs,
config,
...
}:
{
networking = {
firewall.enable = false;
2023-03-12 18:50:22 +01:00
nameservers = [
# digital courage
"46.182.19.48"
"2a02:2970:1002::18"
];
2023-03-12 18:50:22 +01:00
usePredictableInterfaceNames = false;
useNetworkd = true;
};
2023-03-12 18:50:22 +01:00
systemd = {
network.enable = true;
network.networks =
lib.mapAttrs'
2024-07-28 21:08:02 +02:00
(
num: _:
lib.nameValuePair "eth${num}" {
matchConfig.Name = "eth${num}";
networkConfig = {
DHCP = "yes";
LLMNR = true;
IPv4LLRoute = true;
LLDP = true;
IPv6AcceptRA = true;
# used to have a stable address for zfs send
Address = "fd42:4492:6a6d:43:1::${num}/64";
};
dhcpConfig = {
UseHostname = false;
RouteMetric = 512;
};
ipv6AcceptRAConfig.Token = "::521a:c5ff:fefe:65d9";
2024-07-28 21:08:02 +02:00
}
)
{
"0" = { };
"1" = { };
"2" = { };
"3" = { };
};
};
2023-03-12 18:50:22 +01:00
imports = [
../machines/core/core.nix
../machines/core/nix.nix
];
documentation = {
enable = lib.mkDefault false;
doc.enable = lib.mkDefault false;
info.enable = lib.mkDefault false;
nixos.enable = lib.mkDefault false;
nixos.options.warningsAreErrors = false;
};
2023-03-12 18:50:22 +01:00
# no auto-updates
systemd.services.update-prefetch.enable = false;
2023-11-30 22:54:04 +01:00
# disable rebuilding
system.switch.enable = false;
2023-03-12 18:50:22 +01:00
environment.systemPackages = with pkgs; [
diskrsync
partclone
ntfsprogs
ntfs3g
];
systemd.services.sshd.wantedBy = lib.mkForce [ "multi-user.target" ];
users.extraUsers.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOFx6OLwL9MbkD3mnMsv+xrzZHN/rwCTgVs758SCLG0h felix@thinkman"
];
}