nixos-config/aplysia.nix

98 lines
2.1 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
2018-01-05 17:46:33 +00:00
users.extraUsers.gebner.extraGroups = ["transmission"];
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";
};
fileSystems."/boota".options = [ "nofail" ];
fileSystems."/bootb".options = [ "nofail" ];
fileSystems."/bootc".options = [ "nofail" ];
fileSystems."/bootd".options = [ "nofail" ];
fileSystems."/boote".options = [ "nofail" ];
fileSystems."/bootf".options = [ "nofail" ];
2017-08-05 08:27:17 +00:00
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";
speed-limit-down = 5000;
speed-limit-down-enabled = true;
speed-limit-up = 800;
speed-limit-up-enabled = true;
2018-03-25 10:38:56 +00:00
peer-port = 51415;
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
}