2023-02-18 15:24:54 +00:00
|
|
|
# The Swan
|
|
|
|
# System configuration for my home NAS server
|
|
|
|
|
|
|
|
{ inputs, globals, overlays, ... }:
|
|
|
|
|
|
|
|
with inputs;
|
|
|
|
|
|
|
|
nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
specialArgs = { };
|
|
|
|
modules = [
|
2023-03-20 03:36:15 +00:00
|
|
|
globals
|
2023-02-18 15:24:54 +00:00
|
|
|
home-manager.nixosModules.home-manager
|
2023-02-25 14:45:49 +00:00
|
|
|
disko.nixosModules.disko
|
2023-06-03 15:12:04 +00:00
|
|
|
../../modules/common
|
|
|
|
../../modules/nixos
|
2023-02-18 15:24:54 +00:00
|
|
|
{
|
2023-06-03 15:12:04 +00:00
|
|
|
# Hardeware
|
2023-02-18 15:24:54 +00:00
|
|
|
server = true;
|
2023-02-27 02:50:24 +00:00
|
|
|
networking.hostName = "swan";
|
|
|
|
|
2023-06-03 15:12:04 +00:00
|
|
|
boot.initrd.availableKernelModules =
|
|
|
|
[ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
|
2023-06-04 16:14:11 +00:00
|
|
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
|
|
|
hardware.enableRedistributableFirmware = true;
|
2023-06-03 15:12:04 +00:00
|
|
|
powerManagement.cpuFreqGovernor = "powersave";
|
|
|
|
hardware.cpu.intel.updateMicrocode = true;
|
2023-02-26 13:23:31 +00:00
|
|
|
|
2023-06-03 15:12:04 +00:00
|
|
|
# ZFS
|
2023-02-27 02:50:24 +00:00
|
|
|
zfs.enable = true;
|
2023-06-03 15:12:04 +00:00
|
|
|
# head -c 8 /etc/machine-id
|
|
|
|
networking.hostId = "600279f4"; # Random ID required for ZFS
|
2023-02-27 00:53:51 +00:00
|
|
|
disko = {
|
|
|
|
enableConfig = true;
|
2023-02-27 01:49:46 +00:00
|
|
|
devices = (import ../../disks/root.nix { disk = "/dev/nvme0n1"; });
|
|
|
|
# // (import ../../disks/zfs.nix {
|
|
|
|
# pool = "tank";
|
|
|
|
# disks = [ "/dev/sda" "/dev/sdb" "/dev/sdc" ];
|
|
|
|
# });
|
2023-02-27 00:53:51 +00:00
|
|
|
};
|
2023-02-27 02:50:24 +00:00
|
|
|
boot.zfs.extraPools = [ "tank" ];
|
2023-02-26 13:23:31 +00:00
|
|
|
|
2023-02-18 15:24:54 +00:00
|
|
|
gui.enable = false;
|
|
|
|
theme = { colors = (import ../../colorscheme/gruvbox).dark; };
|
|
|
|
nixpkgs.overlays = overlays;
|
2023-02-27 02:50:24 +00:00
|
|
|
neovim.enable = true;
|
2023-02-18 15:24:54 +00:00
|
|
|
caddy.enable = true;
|
2023-04-16 20:59:52 +00:00
|
|
|
cloudflare.enable = true;
|
2023-04-29 16:00:31 +00:00
|
|
|
cloudflareTunnel.enable = true;
|
2023-02-28 04:27:10 +00:00
|
|
|
streamServer = "stream.masu.rs";
|
2023-03-01 04:54:48 +00:00
|
|
|
nextcloudServer = "cloud.masu.rs";
|
2023-03-04 01:04:02 +00:00
|
|
|
bookServer = "books.masu.rs";
|
2023-03-12 13:24:16 +00:00
|
|
|
arrServer = "download.masu.rs";
|
2023-04-16 20:33:16 +00:00
|
|
|
transmissionServer = "download.masu.rs";
|
2023-02-28 05:05:04 +00:00
|
|
|
samba.enable = true;
|
2023-02-18 15:24:54 +00:00
|
|
|
|
2023-02-28 02:02:45 +00:00
|
|
|
backup.s3 = {
|
|
|
|
endpoint = "s3.us-west-002.backblazeb2.com";
|
|
|
|
bucket = "noahmasur-backup";
|
|
|
|
accessKeyId = "0026b0e73b2e2c80000000005";
|
|
|
|
};
|
|
|
|
|
2023-02-18 15:24:54 +00:00
|
|
|
# Disable passwords, only use SSH key
|
|
|
|
publicKey =
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
|
|
|
|
|
|
|
|
# Clone dotfiles
|
|
|
|
dotfiles.enable = true;
|
|
|
|
|
2023-02-25 14:45:49 +00:00
|
|
|
# services.nfs.server.enable = true;
|
2023-02-18 15:24:54 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|