separate grub/systemd configs.

This commit is contained in:
Joseph Hanson 2024-07-07 02:50:07 -05:00
parent 00f37912b9
commit 3d0033b8b2
Signed by: jahanson
SSH key fingerprint: SHA256:vy6dKBECV522aPAwklFM3ReKAVB086rT3oWwiuiFG7o
3 changed files with 62 additions and 2 deletions

51
configuration-systemd.nix Normal file
View file

@ -0,0 +1,51 @@
# This is a small config that can be used to bootstrap a system with ZFS.
{ config, lib, modulesPath, ... }:
{
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
];
# Generate a hostId for ZFS
# head -c4 /dev/urandom | od -A none -t x4
networking.hostId = "f35c6293";
networking.hostName = "MiniNix";
boot = {
initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
initrd.kernelModules = [ ];
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
loader = {
systemd-boot.enable = true;
efi = {
canTouchEfiVariables = true;
};
};
};
fileSystems."/" = {
device = "zroot/root";
fsType = "zfs";
};
fileSystems."/nix" = {
device = "zroot/nix";
fsType = "zfs";
};
fileSystems."/var" = {
device = "zroot/var";
fsType = "zfs";
};
fileSystems."/home" = {
device = "zroot/home";
fsType = "zfs";
};
swapDevices = [ ];
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
system.stateVersion = "24.05";
}

View file

@ -14,11 +14,20 @@
outputs = { self, nixpkgs, disko, ... }@inputs: { outputs = { self, nixpkgs, disko, ... }@inputs: {
nixosConfigurations = { nixosConfigurations = {
"mini-x86" = nixpkgs.lib.nixosSystem { "mini-x86-grub" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };
modules = [ modules = [
./configuration.nix ./configuration-grub.nix
disko.nixosModules.disko
(import ./disko-nixos.nix { disks = [ "/dev/nvme0n1" ]; })
];
};
"mini-x86-systemd" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./configuration-systemd.nix
disko.nixosModules.disko disko.nixosModules.disko
(import ./disko-nixos.nix { disks = [ "/dev/nvme0n1" ]; }) (import ./disko-nixos.nix { disks = [ "/dev/nvme0n1" ]; })
]; ];