2023-07-17 19:23:00 +02:00
|
|
|
{ config, ... }:
|
|
|
|
let
|
|
|
|
device = "/dev/sda";
|
2023-07-17 19:31:40 +02:00
|
|
|
disko = import ./partitions.nix {
|
2023-07-18 13:04:04 +02:00
|
|
|
disks = [ device ];
|
2023-07-17 19:31:40 +02:00
|
|
|
};
|
2023-07-17 19:23:00 +02:00
|
|
|
in
|
|
|
|
{
|
2023-07-17 16:50:07 +02:00
|
|
|
imports = [
|
|
|
|
../common/global
|
|
|
|
../common/users/adrielus.nix
|
|
|
|
../common/optional/slambda.nix
|
|
|
|
|
|
|
|
./hardware-configuration.nix
|
2023-07-17 19:31:40 +02:00
|
|
|
disko
|
2023-07-17 16:50:07 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
# Set the name of this machine!
|
|
|
|
networking.hostName = "lapetus";
|
|
|
|
|
2023-07-17 19:44:54 +02:00
|
|
|
# ID required by zfs.
|
|
|
|
networking.hostId = "08357db3";
|
|
|
|
|
2023-07-18 15:16:57 +02:00
|
|
|
# Set machine id for log continuity
|
|
|
|
environment.etc.machine-id.text = "d9571439c8a34e34b89727b73bad3587";
|
|
|
|
|
2023-07-17 16:50:07 +02:00
|
|
|
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
2023-07-17 19:23:00 +02:00
|
|
|
system.stateVersion = "23.05";
|
2023-07-17 16:50:07 +02:00
|
|
|
|
2023-07-17 18:40:39 +02:00
|
|
|
# Configure ZFS
|
|
|
|
boot.supportedFilesystems = [ "zfs" ];
|
|
|
|
boot.zfs.extraPools = [ "zroot" ];
|
|
|
|
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
|
2023-07-18 00:48:23 +02:00
|
|
|
boot.kernelParams = [ "nohibernate" ];
|
2023-07-17 18:40:39 +02:00
|
|
|
|
|
|
|
# We use non-legacy mountpoints
|
|
|
|
# See [this wiki link](https://nixos.wiki/wiki/ZFS)
|
|
|
|
# systemd.services.zfs-mount.enable = false;
|
|
|
|
|
|
|
|
# Roll back to blank snapshot on boot
|
|
|
|
# boot.initrd.postDeviceCommands = lib.mkAfter ''
|
|
|
|
# zfs rollback -r zroot@blank
|
|
|
|
# '';
|
|
|
|
|
2023-07-17 19:54:27 +02:00
|
|
|
# {{{ FileSystems
|
|
|
|
fileSystems =
|
2023-07-17 19:53:24 +02:00
|
|
|
let zfs = { neededForBoot = true; options = [ "zfsutil" ]; };
|
|
|
|
in
|
|
|
|
{
|
|
|
|
"/" = zfs;
|
|
|
|
"/nix" = zfs;
|
|
|
|
"/persist/data" = zfs;
|
|
|
|
"/persist/state" = zfs;
|
|
|
|
"/persist/local/cache" = zfs;
|
2023-07-18 00:48:23 +02:00
|
|
|
"/boot".neededForBoot = true;
|
2023-07-17 19:53:24 +02:00
|
|
|
};
|
|
|
|
# }}}
|
|
|
|
|
2023-07-17 16:50:07 +02:00
|
|
|
# Boot
|
2023-07-18 00:48:23 +02:00
|
|
|
boot.loader.systemd-boot.enable = true;
|
2023-07-17 16:50:07 +02:00
|
|
|
}
|