summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2026-06-21 22:53:05 -0500
committerTim Keller <tjk@tjkeller.xyz>2026-06-21 22:53:05 -0500
commit6d109a9f958a00a4f3fc537d213067e5777ab120 (patch)
tree86771ee71eb9b7466877f61b60cb9b78c0e16627
parent560f5a04cecb2903bba56e154882b0b220a2f578 (diff)
downloadnixos-6d109a9f958a00a4f3fc537d213067e5777ab120.tar.xz
nixos-6d109a9f958a00a4f3fc537d213067e5777ab120.zip
backup server config and gnome profile. fix bootloader for grubHEADmaster
-rw-r--r--archetypes/profiles/default.nix13
-rw-r--r--archetypes/profiles/gnome/default.nix13
-rw-r--r--archetypes/profiles/zfs/default.nix2
-rw-r--r--flake.nix1
-rw-r--r--hosts/sweetiepc/configuration.nix13
-rw-r--r--hosts/sweetiepc/hardware-configuration.nix38
-rw-r--r--nixos/bootloader.nix19
7 files changed, 80 insertions, 19 deletions
diff --git a/archetypes/profiles/default.nix b/archetypes/profiles/default.nix
index ef5d87b..1664484 100644
--- a/archetypes/profiles/default.nix
+++ b/archetypes/profiles/default.nix
@@ -1,10 +1,11 @@
{
imports = [
- ./btrfs
- ./cuda
- ./desktop
- ./headless
- ./pi
- ./zfs
+ ./gnome # 700
+ ./cuda # 800
+ ./zfs # 810
+ ./btrfs # 820
+ ./pi # 900
+ ./headless # 910
+ ./desktop # 920
];
}
diff --git a/archetypes/profiles/gnome/default.nix b/archetypes/profiles/gnome/default.nix
new file mode 100644
index 0000000..6b7184b
--- /dev/null
+++ b/archetypes/profiles/gnome/default.nix
@@ -0,0 +1,13 @@
+{ lib, pkgs, ... }: let
+ mkGnome = lib.mkOverride 700;
+
+ nixosConfig = {
+ services.displayManager.gdm.enable = mkGnome true;
+ services.desktopManager.gnome.enable = mkGnome true;
+ services.tlp.enable = mkGnome false; # Conflicts with power-profiles-daemon
+ };
+
+ homeConfig = {};
+in {
+ imports = [ (lib._mkProfileArchetype "gnome" nixosConfig homeConfig) ];
+}
diff --git a/archetypes/profiles/zfs/default.nix b/archetypes/profiles/zfs/default.nix
index 4841231..00f3c0b 100644
--- a/archetypes/profiles/zfs/default.nix
+++ b/archetypes/profiles/zfs/default.nix
@@ -8,6 +8,8 @@
mode = mkZfs "efi";
};
+ boot.supportedFilesystems = [ "zfs" ];
+
services.zfs = {
trim.enable = mkZfs true;
autoSnapshot.enable = mkZfs true;
diff --git a/flake.nix b/flake.nix
index f304765..e73ab18 100644
--- a/flake.nix
+++ b/flake.nix
@@ -98,6 +98,7 @@ rec {
"libreX60"
"optiplex"
"poweredge"
+ "sweetiepc"
];
aarch64-linux = [
"piframe"
diff --git a/hosts/sweetiepc/configuration.nix b/hosts/sweetiepc/configuration.nix
index 5c6b427..d2bf172 100644
--- a/hosts/sweetiepc/configuration.nix
+++ b/hosts/sweetiepc/configuration.nix
@@ -1,6 +1,9 @@
{ config, lib, pkgs, home-manager, ... }: {
# Setup bootloader
- boot._loader.enable = true;
+ boot._loader = {
+ enable = true;
+ loader = "grub";
+ };
# Enable common options
_archetypes = {
@@ -10,6 +13,8 @@
home.users.timmy.enable = true;
};
zfs.enable = true;
+ btrfs.enable = true;
+ gnome.enable = true;
};
collections = {
desktop = {
@@ -18,6 +23,9 @@
};
};
+ # Import zfs pools
+ boot.zfs.extraPools = [ "geminus" "quattuor" ];
+
# Enable user timmy
_users.timmy = {
enable = true;
@@ -34,5 +42,8 @@
};
};
+ # Without this, "ZFS requires networking.hostId to be set" will be raised
+ networking.hostId = "fdde503a";
+
system.stateVersion = "26.05";
}
diff --git a/hosts/sweetiepc/hardware-configuration.nix b/hosts/sweetiepc/hardware-configuration.nix
new file mode 100644
index 0000000..5ed162c
--- /dev/null
+++ b/hosts/sweetiepc/hardware-configuration.nix
@@ -0,0 +1,38 @@
+# Do not modify this file! It was generated by ‘nixos-generate-config’
+# and may be overwritten by future invocations. Please make changes
+# to /etc/nixos/configuration.nix instead.
+{ config, lib, pkgs, modulesPath, ... }:
+
+{
+ imports =
+ [ (modulesPath + "/installer/scan/not-detected.nix")
+ ];
+
+ boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ "kvm-intel" ];
+ boot.extraModulePackages = [ ];
+
+ fileSystems."/" =
+ { device = "/dev/disk/by-uuid/91572803-436d-4f43-b41f-dfba2103752e";
+ fsType = "btrfs";
+ options = [ "subvol=@" ];
+ };
+
+ fileSystems."/home" =
+ { device = "/dev/disk/by-uuid/91572803-436d-4f43-b41f-dfba2103752e";
+ fsType = "btrfs";
+ options = [ "subvol=@home" ];
+ };
+
+ fileSystems."/boot" =
+ { device = "/dev/disk/by-uuid/F618-D6C2";
+ fsType = "vfat";
+ options = [ "fmask=0022" "dmask=0022" ];
+ };
+
+ swapDevices = [ ];
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+ hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}
diff --git a/nixos/bootloader.nix b/nixos/bootloader.nix
index e2921bf..333f584 100644
--- a/nixos/bootloader.nix
+++ b/nixos/bootloader.nix
@@ -24,18 +24,13 @@ in {
};
config = let
- usingEfi = cfg.mode == "efi";
+ usingEfi = cfg.mode == "efi";
usingBios = cfg.mode == "bios";
+ usingGrub = cfg.loader == "grub";
+ usingSystemdBoot = cfg.loader == "systemd-boot";
in lib.mkIf cfg.enable {
- assertions = [
- {
- assertion = cfg.loader != "grub" || !cfg.grub.zfsSupport || usingEfi;
- message = "zfsSupport option requires using efi boot mode";
- }
- ];
-
boot.loader = {
- grub = lib.mkIf (cfg.loader == "grub") {
+ grub = lib.mkIf usingGrub {
enable = true;
# bios
device = lib.mkIf usingBios cfg.grub.biosDevice;
@@ -51,14 +46,14 @@ in {
enableCryptodisk = true;
memtest86.enable = cfg.memtest86.enable;
};
- systemd-boot = lib.mkIf (cfg.loader == "systemd-boot") {
+ systemd-boot = lib.mkIf usingSystemdBoot {
enable = true;
editor = false;
memtest86.enable = cfg.memtest86.enable;
};
efi = lib.mkIf usingEfi {
- efiSysMountPoint = lib.mkIf (cfg.loader == "grub") "/boot/efi";
- canTouchEfiVariables = true;
+ efiSysMountPoint = lib.mkIf usingGrub "/boot/efi";
+ canTouchEfiVariables = lib.mkIf usingSystemdBoot true;
};
};
};