From 2e0b85417ac2fb603df1b4fe6aade163c31314b1 Mon Sep 17 00:00:00 2001 From: "D. Scott Boggs" Date: Tue, 19 Dec 2023 08:21:54 -0500 Subject: [PATCH] initial template --- .broadcastignore | 1 + common | 1 + configuration.nix | 57 +++++++++++++++++++++++++++++++++++++++++++++++ zfs-config.nix | 10 +++++++++ 4 files changed, 69 insertions(+) create mode 100644 .broadcastignore create mode 120000 common create mode 100644 configuration.nix create mode 100644 zfs-config.nix diff --git a/.broadcastignore b/.broadcastignore new file mode 100644 index 0000000..6b8710a --- /dev/null +++ b/.broadcastignore @@ -0,0 +1 @@ +.git diff --git a/common b/common new file mode 120000 index 0000000..60d3b0a --- /dev/null +++ b/common @@ -0,0 +1 @@ +../common \ No newline at end of file diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..edff3b1 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,57 @@ +{ pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ./zfs-config.nix + ./common + ./common/sites/fill-me-in + ]; + + boot.loader = { + grub = { + # Use the GRUB 2 boot loader. + enable = true; + version = 2; + # efiSupport = true; + # efiInstallAsRemovable = false; + # Define on which hard drive you want to install Grub. + device = fill-me-in; # or "nodev" for efi only + }; + # efi.efiSysMountPoint = "/boot/efi"; # (part of the generated default) + }; + + networking = { + hostName = fill-me-in; # Define your hostname. + hostId = fill-me-in; # required by ZFS + # Open ports in the firewall. + firewall.allowedTCPPorts = [ 22 ]; + # firewall.allowedUDPPorts = [ ... ]; + # Pick only one of the below networking options. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + # networkmanager.enable = true; # Easiest to use and most distros use this by default. + }; + + # Set your time zone. + time.timeZone = "UTC"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + console = { + # keyMap = "us"; + useXkbConfig = true; # use xkbOptions in tty. + }; + + services.xserver.layout = "us"; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = fill-me-in; # Did you read the comment? +} + + diff --git a/zfs-config.nix b/zfs-config.nix new file mode 100644 index 0000000..a691ba4 --- /dev/null +++ b/zfs-config.nix @@ -0,0 +1,10 @@ + +{ config, pkgs, ... }: +{ + boot = { + kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; + extraModulePackages = [ config.boot.kernelPackages.zfs ]; + kernelModules = [ "zfs" ]; + }; + environment.systemPackages = [ pkgs.zfs ]; +}