Add disk layout

This commit is contained in:
Nicolas Jeannerod 2024-10-01 13:56:15 +02:00
parent 5c70db44d2
commit 3d70d1519c
Signed by: Niols
GPG key ID: 35DB9EC8886E1CB8
2 changed files with 46 additions and 22 deletions

View file

@ -2,9 +2,10 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
snf.url = "git+https://git.fediversity.eu/fediversity/simple-nixos-fediverse.git"; snf.url = "git+https://git.fediversity.eu/fediversity/simple-nixos-fediverse.git";
disko.url = "github:nix-community/disko";
}; };
outputs = { self, nixpkgs, snf }: outputs = { self, nixpkgs, snf, disko }:
let let
vmName = "vm02186"; vmName = "vm02186";
@ -14,11 +15,16 @@
modules = [ modules = [
./procolix-configuration.nix ./procolix-configuration.nix
./hardware-configuration.nix
./gitea-runner.nix ./gitea-runner.nix
## Hardware configuration
disko.nixosModules.default
./hardware-configuration.nix
]; ];
}; };
## An ISO that will prepare the machine, format it, and install the above
## configuration in an automated way.
isoInstallers.${vmName} = snf.mkInstaller nixpkgs self.nixosConfigurations.${vmName}; isoInstallers.${vmName} = snf.mkInstaller nixpkgs self.nixosConfigurations.${vmName};
}; };
} }

View file

@ -1,30 +1,48 @@
# Do not modify this file! It was generated by nixos-generate-config { lib, modulesPath, ... }:
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
imports = imports = [ (modulesPath + "/profiles/qemu-guest.nix")];
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ "dm-snapshot" ]; boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = disko.devices.disk.main = {
{ device = "/dev/disk/by-uuid/833ac0f9-ad8c-45ae-a9bf-5844e378c44a"; device = "/dev/sda";
fsType = "ext4"; type = "disk";
content = {
type = "gpt";
partitions = {
MBR = {
priority = 0;
size = "1M";
type = "EF02";
};
ESP = {
priority = 1;
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
priority = 2;
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
}; };
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/B4D5-3AF9";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's