configs/fileserver/configuration.nix~
Geir Okkenhaug Jerstad fd398a7226 fileserver
2024-05-20 14:43:35 +02:00

94 lines
2.3 KiB
Nix
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Kernel
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
# Use the Grub boot loader.
boot.loader.grub = {
enable = true;
zfsSupport = true;
efiSupport = true;
efiInstallAsRemovable = true;
mirroredBoots = [
{ devices = [ "nodev" ]; path = "/boot"; }
];
};
boot.supportedFilesystems = [ "zfs" ];
boot.loader.grub.memtest86.enable = true;
zramSwap = {
enable = true;
algorithm = "zstd";
};
# ZFS
services.zfs.autoScrub.enable = true;
services.zfs.trim.enable = true;
# Firmware
services.fwupd.enable = true;
hardware.firmware = with pkgs; [ firmwareLinuxNonfree ];
hardware.enableAllFirmware = true;
hardware.enableRedistributableFirmware = true;
# enable unfree
nixpkgs.config.allowUnfree = true;
# Network
networking.hostName = "files";
services.tailscale.enable = true;
networking.networkmanager.enable = true;
networking.hostId = "8425e349";
# TimeZone
time.timeZone = "Europe/Oslo";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "no";
};
users.users.geir= {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
packages = with pkgs; [
tree fastfetch kitty
];
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
emacs zfs
wget curl git
];
# Enable services
services.openssh.enable = true;
services.nfs.server.enable = true;
services.nfs.server.exports = ''
/mnt/storage 10.0.0.0/24(rw,fsid=0,no_subtree_check) 100.64.0.0/10(rw,fsid=0,no_subtree_check)
'';
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ 2049 ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
networking.firewall.enable = false;
system.stateVersion = "23.11";
}