Try to have a working filesystem

This commit is contained in:
Théo Barnouin 2024-09-10 10:46:49 +02:00
parent bb2c6e7de3
commit 8a9335f5ae
2 changed files with 41 additions and 25 deletions

View file

@ -2,8 +2,8 @@
{ imports =
[ # Include the results of the hardware scan.
# ./hardware-configuration.nix
];
./hardware-configuration.nix
];
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];

View file

@ -1,33 +1,49 @@
# 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, ... }:
{ lib, system, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot = {
# use latest kernel
# kernelPackages = pkgs.linuxPackages_latest;
supportedFilesystems = [ "ext4" "btrfs" "xfs" "fat" "vfat" "cifs" "nfs" ];
growPartition = true;
kernelModules = [ "kvm-intel" ];
kernelParams = lib.mkForce [ ];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
loader = {
grub = {
enable = true;
device = "nodev";
efiSupport = true;
efiInstallAsRemovable = true;
};
timeout = lib.mkForce 3;
};
fileSystems."/" =
{ device = "/dev/disk/by-uuid/cd191c1d-d2d7-44ae-8a9a-75ad7d8228a4";
initrd = {
availableKernelModules = [ "9p" "9pnet_virtio" "ata_piix" "uhci_hcd" "virtio_blk" "virtio_mmio" "virtio_net" "virtio_pci" "virtio_scsi" ];
kernelModules = [ "virtio_balloon" "virtio_console" "virtio_rng" ];
};
tmp.cleanOnBoot = true;
};
fileSystems = {
"/" = {
device = "/dev/disk/by-label/nixos";
autoResize = true;
fsType = "ext4";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/335e1191-f20f-4afc-bc2b-b156cf8dc2c2"; }
];
"/boot" = {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
};
# 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
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
services.fstrim = {
enable = true;
interval = "weekly";
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
nixpkgs.hostPlatform = lib.mkDefault system;
}