mirror of
https://github.com/CHN-beta/nixos.git
synced 2024-10-23 07:08:45 +08:00
45 lines
1.5 KiB
Nix
45 lines
1.5 KiB
Nix
inputs:
|
||
{
|
||
config =
|
||
{
|
||
nixos =
|
||
{
|
||
system =
|
||
{
|
||
nixpkgs.march = "broadwell";
|
||
networking.networkd.static =
|
||
{
|
||
br0 = { ip = "192.168.1.12"; mask = 24; gateway = "192.168.1.1"; dns = "192.168.1.1"; };
|
||
eno2 = { ip = "192.168.178.3"; mask = 24; };
|
||
};
|
||
cluster.nodeType = "worker";
|
||
fileSystems.mount =
|
||
{
|
||
nfs."192.168.178.1:/home" = "/home";
|
||
btrfs."/dev/disk/by-partlabel/srv1-node2-nodatacow" =
|
||
{ "/nix/nodatacow" = "/nix/nodatacow"; "/nix/backups" = "/nix/backups"; };
|
||
};
|
||
};
|
||
services =
|
||
{
|
||
xray.client.enable = true;
|
||
beesd.instances.root = { device = "/"; hashTableSizeMB = 256; threads = 4; };
|
||
};
|
||
packages.packages._prebuildPackages =
|
||
[ inputs.topInputs.self.nixosConfigurations.srv1-node0.config.system.build.toplevel ];
|
||
virtualization.kvmHost = { enable = true; gui = true; };
|
||
};
|
||
specialisation.no-share-home.configuration =
|
||
{
|
||
nixos.system.fileSystems.mount.nfs = inputs.lib.mkForce null;
|
||
system.nixos.tags = [ "no-share-home" ];
|
||
};
|
||
boot.initrd.systemd.network.networks."10-eno2" = inputs.config.systemd.network.networks."10-eno2";
|
||
# make slurm sub process to be able to communicate with the master
|
||
networking.firewall.trustedInterfaces = [ "eno2" ];
|
||
# add a bridge for kvm
|
||
# 设置桥接之后,不能再给eno1配置ip,需要转而给 br0 配置ip
|
||
networking.bridges.br0.interfaces = [ "eno1" ];
|
||
};
|
||
}
|