-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f775f8e
commit f57dc49
Showing
5 changed files
with
170 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
root, | ||
inputs, | ||
... | ||
}: | ||
inputs.nixpkgs.lib.nixosSystem { | ||
system = "x86_64-linux"; | ||
|
||
extraModules = [ | ||
# Not sure why this has to be an extraModule instead of a regular module | ||
inputs.colmena.nixosModules.deploymentOptions | ||
]; | ||
|
||
modules = [root.nixosModules.machines.manganese.default]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
root, | ||
super, | ||
homelab, | ||
... | ||
}: _: { | ||
imports = [ | ||
# Disk layout | ||
super.disko | ||
|
||
# Hardware | ||
super.hardware | ||
|
||
# Basic packages I want on every system | ||
root.nixosModules.basic-packages | ||
root.nixosModules.basic-settings | ||
|
||
# Add server user | ||
root.nixosModules.users.server | ||
|
||
# Autosnapshot ZFS and send to NAS | ||
# root.nixosModules.core.zfs-backup | ||
# (_: { | ||
# gio.services.zfs_backup = { | ||
# enable = true; | ||
# syncToGallium = true; | ||
# datasets = [ | ||
# "tank/home" | ||
# "tank/nix" | ||
# "tank/root" | ||
# ]; | ||
# }; | ||
# }) | ||
|
||
({pkgs, ...}: { | ||
networking.hostId = "cf399625"; | ||
|
||
# ZFS snapshot browsing | ||
environment.systemPackages = [pkgs.httm]; | ||
|
||
# Load the deployment config from our homelab.toml | ||
inherit (homelab.machines.manganese) deployment; | ||
}) | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{inputs, ...}: { | ||
imports = [ | ||
inputs.disko.nixosModules.disko | ||
]; | ||
|
||
config = { | ||
disko.devices = { | ||
disk = { | ||
main = { | ||
type = "disk"; | ||
device = "/dev/disk/by-id/ata-SanDisk_SDSSDA120G_173948453212"; | ||
content = { | ||
type = "gpt"; | ||
partitions = { | ||
ESP = { | ||
size = "1G"; | ||
type = "EF00"; | ||
content = { | ||
type = "filesystem"; | ||
format = "vfat"; | ||
mountpoint = "/boot"; | ||
}; | ||
}; | ||
zfs = { | ||
size = "100%"; | ||
content = { | ||
type = "zfs"; | ||
pool = "tank"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
zpool = { | ||
tank = { | ||
type = "zpool"; | ||
postCreateHook = "zfs snapshot tank@blank"; | ||
rootFsOptions = { | ||
compression = "zstd"; | ||
mountpoint = "none"; | ||
}; | ||
|
||
datasets = { | ||
reserve = { | ||
type = "zfs_fs"; | ||
options = { | ||
mountpoint = "none"; | ||
reservation = "5G"; | ||
}; | ||
}; | ||
root = { | ||
type = "zfs_fs"; | ||
mountpoint = "/"; | ||
postCreateHook = "zfs snapshot tank/root@blank"; | ||
}; | ||
nix = { | ||
type = "zfs_fs"; | ||
mountpoint = "/nix"; | ||
}; | ||
home = { | ||
type = "zfs_fs"; | ||
mountpoint = "/home"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
_: { | ||
config, | ||
lib, | ||
... | ||
}: { | ||
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci"]; | ||
boot.initrd.kernelModules = []; | ||
boot.kernelModules = ["kvm-intel"]; | ||
boot.extraModulePackages = []; | ||
|
||
networking.useDHCP = lib.mkDefault true; | ||
|
||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; | ||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; | ||
|
||
time.timeZone = "America/Los_Angeles"; | ||
|
||
networking.hostName = "manganese"; | ||
|
||
boot.loader = { | ||
systemd-boot = { | ||
enable = true; | ||
consoleMode = "auto"; | ||
netbootxyz.enable = true; | ||
}; | ||
|
||
efi.canTouchEfiVariables = true; | ||
}; | ||
boot.zfs.forceImportRoot = false; | ||
boot.supportedFilesystems = ["zfs"]; | ||
boot.initrd.supportedFilesystems = ["zfs"]; | ||
} |