numtide / nixos-facter-modules

A series of NixOS modules to be used in conjunction with https://github.com/numtide/nixos-facter [maintainer=@numtide]
https://numtide.github.io/nixos-facter-modules/
MIT License
48 stars 5 forks source link

feat: capture the config values being set by facter modules #9

Closed brianmcgee closed 3 months ago

brianmcgee commented 3 months ago

Adds two new config values:

{
  boot = {
    initrd = {
      availableKernelModules = {
        "<facter>/modules/nixos/boot.nix" = [
          "uhci_hcd"
          "ata_piix"
          "virtio_pci"
          "virtio_blk"
        ];
        "<facter>/modules/nixos/virtualisation.nix" = [
          "virtio_net"
          "virtio_pci"
          "virtio_mmio"
          "virtio_blk"
          "virtio_scsi"
          "9p"
          "9pnet_virtio"
        ];
      };
      kernelModules = {
        "<facter>/modules/nixos/virtualisation.nix" = [
          "virtio_balloon"
          "virtio_console"
          "virtio_rng"
          "virtio_gpu"
        ];
      };
    };
    isContainer = { "<facter>/modules/nixos/virtualisation.nix" = false; };
    kernelModules = {
      "<facter>/modules/nixos/virtualisation.nix" = [ ];
    };
  };
  hardware = {
    parallels = {
      enable = { "<facter>/modules/nixos/virtualisation.nix" = false; };
    };
  };
  nixpkgs = {
    config = {
      "<facter>/modules/nixos/virtualisation.nix" = {
        allowUnfreePredicate = {
          _type = "if";
          condition = false;
          content = «lambda @ /nix/store/mdi0c47ynn0w0gvnwc3hnrszb22wd9hv-source/modules/nixos/virtualisation.nix:93:9»;
        };
      };
    };
    hostPlatform = {
      "<facter>/hosts/basic/config.nix" = "x86_64-linux";
      "<facter>/modules/nixos/system.nix" = "x86_64-linux";
    };
  };
  virtualisation = {
    hypervGuest = {
      enable = { "<facter>/modules/nixos/virtualisation.nix" = false; };
    };
    virtualbox = {
      guest = {
        enable = { "<facter>/modules/nixos/virtualisation.nix" = false; };
      };
    };
  };
}