treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:
nix-build ci -A fmt.check
This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).
This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).
Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).
If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
This commit is contained in:
@@ -4,7 +4,12 @@
|
||||
# also to reconfigure instances. However, we can't rename it because
|
||||
# existing "configuration.nix" files on EC2 instances refer to it.)
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib) mkDefault mkIf;
|
||||
@@ -28,18 +33,22 @@ in
|
||||
|
||||
boot.growPartition = true;
|
||||
|
||||
fileSystems."/" = mkIf (!cfg.zfs.enable) (lib.mkDefault {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
autoResize = true;
|
||||
});
|
||||
fileSystems."/" = mkIf (!cfg.zfs.enable) (
|
||||
lib.mkDefault {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
autoResize = true;
|
||||
}
|
||||
);
|
||||
|
||||
fileSystems."/boot" = mkIf (cfg.efi || cfg.zfs.enable) (lib.mkDefault {
|
||||
# The ZFS image uses a partition labeled ESP whether or not we're
|
||||
# booting with EFI.
|
||||
device = "/dev/disk/by-label/ESP";
|
||||
fsType = "vfat";
|
||||
});
|
||||
fileSystems."/boot" = mkIf (cfg.efi || cfg.zfs.enable) (
|
||||
lib.mkDefault {
|
||||
# The ZFS image uses a partition labeled ESP whether or not we're
|
||||
# booting with EFI.
|
||||
device = "/dev/disk/by-label/ESP";
|
||||
fsType = "vfat";
|
||||
}
|
||||
);
|
||||
|
||||
services.zfs.expandOnBoot = mkIf cfg.zfs.enable "all";
|
||||
|
||||
@@ -50,13 +59,19 @@ in
|
||||
];
|
||||
boot.initrd.kernelModules = [ "xen-blkfront" ];
|
||||
boot.initrd.availableKernelModules = [ "nvme" ];
|
||||
boot.kernelParams = [ "console=ttyS0,115200n8" "random.trust_cpu=on" ];
|
||||
boot.kernelParams = [
|
||||
"console=ttyS0,115200n8"
|
||||
"random.trust_cpu=on"
|
||||
];
|
||||
|
||||
# Prevent the nouveau kernel module from being loaded, as it
|
||||
# interferes with the nvidia/nvidia-uvm modules needed for CUDA.
|
||||
# Also blacklist xen_fbfront to prevent a 30 second delay during
|
||||
# boot.
|
||||
boot.blacklistedKernelModules = [ "nouveau" "xen_fbfront" ];
|
||||
boot.blacklistedKernelModules = [
|
||||
"nouveau"
|
||||
"xen_fbfront"
|
||||
];
|
||||
|
||||
boot.loader.grub.device = if cfg.efi then "nodev" else "/dev/xvda";
|
||||
boot.loader.grub.efiSupport = cfg.efi;
|
||||
@@ -71,7 +86,7 @@ in
|
||||
systemd.services.fetch-ec2-metadata = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
after = ["network-online.target"];
|
||||
after = [ "network-online.target" ];
|
||||
path = [ pkgs.curl ];
|
||||
script = builtins.readFile ./ec2-metadata-fetcher.sh;
|
||||
serviceConfig.Type = "oneshot";
|
||||
|
||||
Reference in New Issue
Block a user