nix-config/hosts/storage-ng/default.nix

113 lines
2.2 KiB
Nix
Raw Normal View History

2021-11-11 16:20:45 +01:00
{ hostRegistry, config, pkgs, lib, strings, ... }:
let
eth0 = "ens18";
in
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
2021-11-11 16:20:45 +01:00
# ../../lib
2021-02-15 07:55:44 +01:00
# ../../lib/hq.nix
2021-11-11 16:20:45 +01:00
# ../../lib/shared.nix
];
c3d2 = {
users.k-ot = true;
isInHq = true;
mapHqHosts = true;
hq.interface = eth0;
};
2021-11-11 16:20:45 +01:00
boot.loader.grub = {
enable = true;
2021-11-11 16:20:45 +01:00
version = 2;
efiSupport = true;
devices = [ "nodev" ];
};
2021-11-11 16:20:45 +01:00
boot.loader.efi.canTouchEfiVariables = true;
systemd.enableEmergencyMode = false;
networking = {
hostName = "storage-ng";
# usePredictableInterfacenames = false;
2021-10-31 19:00:03 +01:00
interfaces."${eth0}" = {
ipv4.addresses = [{
2021-11-11 16:20:45 +01:00
address = hostRegistry.hosts.${config.networking.hostName}.ip4;
prefixLength = 24;
}];
ipv6.addresses = [{
2021-11-11 16:20:45 +01:00
address = hostRegistry.hosts.${config.networking.hostName}.ip6;
prefixLength = 64;
}];
};
2021-11-11 16:20:45 +01:00
defaultGateway.address = "172.22.99.4";
defaultGateway.interface = eth0;
};
environment.systemPackages = with pkgs; [
screen
zsh
lftp
lsof
psmisc
2021-10-02 19:31:56 +02:00
git-annex
mpv
iotop
];
services.ceph = {
enable = false;
client.enable = true;
};
# fixme, we need a floating ip here
# correct is floating ip 172.22.99.21
# does not exist yet
2021-11-11 16:20:45 +01:00
# TODO: where, exactly?
# secretfile does not work :(
fileSystems."/mnt/cephfs" = {
device = "172.22.99.13:6789:/";
fsType = "ceph";
options = [
"name=storage2"
"secret=AQAvRhxcaCK0IxAAnoe00oiopcpQeKZgL02RWw=="
"noatime,_netdev"
"noauto"
"x-systemd.automount"
"x-systemd.device-timeout=175"
"users"
];
};
programs.bash.enableCompletion = true;
programs.mtr.enable = true;
# programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
2020-11-11 20:50:46 +01:00
services.openssh = {
2021-02-22 11:45:12 +01:00
enable = true;
allowSFTP = true;
2020-11-11 20:50:46 +01:00
};
services.atftpd = {
enable = true;
root = "/mnt/cephfs/c3d2/tftp";
};
/* # Open ports in the firewall.
networking.firewall.allowedTCPPorts = [
23
];
networking.firewall.allowedUDPPorts = [
69
];
*/
networking.firewall.enable = false;
system.stateVersion = "19.03"; # Did you read the comment?
}