nixos-config/aplysia.nix

91 lines
1.8 KiB
Nix
Raw Normal View History

2017-08-05 07:17:30 +00:00
{ config, pkgs, ... }:
{
imports =
[
./common-headless.nix
];
boot.supportedFilesystems = ["zfs"];
2017-08-05 08:27:17 +00:00
boot.loader.grub = {
enable = true;
version = 2;
zfsSupport = true;
mirroredBoots = [
{ devices = [ "/dev/sda" ]; path = "/boota"; }
{ devices = [ "/dev/sdb" ]; path = "/bootb"; }
{ devices = [ "/dev/sdc" ]; path = "/bootc"; }
{ devices = [ "/dev/sdd" ]; path = "/bootd"; }
{ devices = [ "/dev/sde" ]; path = "/boote"; }
{ devices = [ "/dev/sdf" ]; path = "/bootf"; }
];
};
networking = {
hostName = "aplysia";
hostId = "34a820f1";
};
2017-08-05 07:17:30 +00:00
services.openssh.enable = true;
users.extraUsers.gebner = {
isNormalUser = true;
2017-08-05 08:27:17 +00:00
extraGroups = ["wheel" "transmission"];
2017-08-05 07:17:30 +00:00
};
2017-08-05 07:18:11 +00:00
2017-08-05 07:17:30 +00:00
boot.kernelPackages = pkgs.lib.mkOverride 10 pkgs.linuxPackages;
system.stateVersion = "17.03";
2017-08-05 08:27:17 +00:00
fileSystems."/mnt/aplysia" = pkgs.lib.mkOverride 10 {
device = "aplysia/export";
fsType = "zfs";
};
services.samba = {
enable = true;
extraConfig = ''
passdb backend = tdbsam
unix password sync = no
'';
shares = {
export = {
"guest ok" = "no";
"read only" = "no";
2017-08-05 08:27:17 +00:00
path = "/mnt/aplysia";
};
};
};
2017-08-05 08:43:25 +00:00
services.transmission = {
enable = true;
settings = {
download-dir = "/mnt/aplysia/torrents";
incomplete-dir = "/mnt/aplysia/torrents";
peer-port = 51413;
2017-08-05 08:43:25 +00:00
};
};
2017-08-05 08:27:17 +00:00
networking.firewall = {
2017-08-05 08:43:25 +00:00
allowedTCPPorts = [
445 139 # samba
config.services.transmission.settings.peer-port
2017-08-05 08:43:25 +00:00
];
allowedUDPPorts = [
137 138 # samba
];
2017-08-05 08:27:17 +00:00
};
2017-08-05 08:43:25 +00:00
environment.systemPackages = with pkgs; [
transmission
samba
];
2017-08-05 15:46:35 +00:00
# hdd spindown
powerManagement.powerUpCommands = ''
${pkgs.hdparm}/bin/hdparm -B127 -S100 /dev/sd{a,b,c,d,e,f}
'';
2017-08-05 07:17:30 +00:00
}