Hey all!
I have NixOS installed on my laptop right now (I installed it 1 or 2 years ago using the graphical installer).
I now want to follow through the Linux From Scratch book. To achieve this, I need to create a new 10GB or so partition, but the problem is that when I installed Nix OS, I installed it so that it occupies my entire disc.
I suppose what I have to do now is to shrink my root partition (I only have 1 root and 1 boot partition), but because there is stuff declared on my hardware-configuration.nix
, I am not sure if I can just go ahead and do it.
My hardware file is shown below:
# 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, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/1a97cc33-ed66-45a1-bd7f-6c31224cde48";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/B801-CD48";
fsType = "vfat";
};
swapDevices = [ ];
# 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.eno2.useDHCP = lib.mkDefault true;
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
So. my question is, should I just shrink my root partition by like 20/30 GB, and then re-run nixos-generate-config
, and this will pick up all the changed that I made? Or is there a better way to do this?
Thanks, and sorry if this is a noob question.