mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-01-11 22:30:25 +01:00
71 lines
2.0 KiB
Nix
71 lines
2.0 KiB
Nix
{myvars, ...}:
|
||
#############################################################
|
||
#
|
||
# Ai - my main computer, with NixOS + I5-13600KF + RTX 4090 GPU, for gaming & daily use.
|
||
#
|
||
#############################################################
|
||
let
|
||
hostName = "ai"; # Define your hostname.
|
||
|
||
inherit (myvars.networking) mainGateway mainGateway6 nameservers;
|
||
inherit (myvars.networking.hostsAddr.${hostName}) iface ipv4 ipv6;
|
||
ipv4WithMask = "${ipv4}/24";
|
||
ipv6WithMask = "${ipv6}/64";
|
||
in {
|
||
imports = [
|
||
./netdev-mount.nix
|
||
# Include the results of the hardware scan.
|
||
./hardware-configuration.nix
|
||
./nvidia.nix
|
||
./ai
|
||
|
||
./preservation.nix
|
||
./secureboot.nix
|
||
];
|
||
|
||
networking = {
|
||
inherit hostName;
|
||
|
||
# we use networkd instead
|
||
networkmanager.enable = false; # provides nmcli/nmtui for wifi adjustment
|
||
useDHCP = false;
|
||
};
|
||
|
||
networking.useNetworkd = true;
|
||
systemd.network.enable = true;
|
||
|
||
systemd.network.networks."10-${iface}" = {
|
||
matchConfig.Name = [iface];
|
||
networkConfig = {
|
||
Address = [
|
||
ipv4WithMask
|
||
ipv6WithMask
|
||
];
|
||
DNS = nameservers;
|
||
DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA.
|
||
IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC)
|
||
LinkLocalAddressing = "ipv6";
|
||
};
|
||
routes = [
|
||
{
|
||
Destination = "0.0.0.0/0";
|
||
Gateway = mainGateway;
|
||
}
|
||
{
|
||
Destination = "::/0";
|
||
Gateway = mainGateway6;
|
||
GatewayOnLink = true; # it's a gateway on local link.
|
||
}
|
||
];
|
||
linkConfig.RequiredForOnline = "routable";
|
||
};
|
||
|
||
# This value determines the NixOS release from which the default
|
||
# settings for stateful data, like file locations and database versions
|
||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||
# this value at the release version of the first install of this system.
|
||
# Before changing this value read the documentation for this option
|
||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||
system.stateVersion = "25.05"; # Did you read the comment?
|
||
}
|