[NixOS] Provide inputs as a specialArgs

This commit is contained in:
Ivan Malison 2021-08-20 14:45:29 -06:00
parent e97c2b2fce
commit dcddbd8c92
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8
3 changed files with 22 additions and 30 deletions

View File

@ -28,7 +28,7 @@
url = github:IvanMalison/notifications-tray-icon/master; url = github:IvanMalison/notifications-tray-icon/master;
}; };
}; };
outputs = { outputs = inputs@{
self, nix, nixpkgs, nixos-hardware, home-manager, taffybar, xmonad, self, nix, nixpkgs, nixos-hardware, home-manager, taffybar, xmonad,
xmonad-contrib, notifications-tray-icon xmonad-contrib, notifications-tray-icon
}: }:
@ -56,30 +56,29 @@
nixos-hardware.nixosModules.raspberry-pi-4 nixos-hardware.nixosModules.raspberry-pi-4
]; ];
}); });
mkNixosConfig = args@{ system ? "x86_64-linux", baseModules ? [ forAll ], modules ? [], specialArgs ? {}, ... }:
nixpkgs.lib.nixosSystem (args // {
inherit system;
modules = baseModules ++ modules;
specialArgs = { inherit inputs; } // specialArgs;
});
in in
{ {
nixosConfigurations = { nixosConfigurations = {
ivanm-dfinity-razer = nixpkgs.lib.nixosSystem { ivanm-dfinity-razer = mkNixosConfig {
system = "x86_64-linux"; modules = [ ./machines/ivanm-dfinity-razer.nix ];
modules = [ forAll ./machines/ivanm-dfinity-razer.nix ];
}; };
ryzen-shine = nixpkgs.lib.nixosSystem { ryzen-shine = mkNixosConfig {
system = "x86_64-linux"; modules = [ ./machines/ryzen-shine.nix ];
modules = [ forAll ./machines/ryzen-shine.nix ];
}; };
adele = nixpkgs.lib.nixosSystem { adele = mkNixosConfig {
system = "x86_64-linux"; modules = [ ./machines/adele.nix ];
modules = [ forAll ./machines/adele.nix ({ ... }: {
imports = [
nixos-hardware.nixosModules.dell-xps-17-9700-intel
];
})];
}; };
biskcomp = nixpkgs.lib.nixosSystem { biskcomp = mkNixosConfig {
system = "aarch64-linux"; system = "aarch64-linux";
modules = [ forAll piHardware ./machines/biskcomp.nix ]; modules = [ forAll piHardware ./machines/biskcomp.nix ];
}; };
air-gapped-pi = nixpkgs.lib.nixosSystem { air-gapped-pi = mkNixosConfig {
system = "aarch64-linux"; system = "aarch64-linux";
modules = [ forAll piHardware ./machines/air-gapped-pi.nix ]; modules = [ forAll piHardware ./machines/air-gapped-pi.nix ];
}; };

View File

@ -1,29 +1,18 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }: { config, lib, pkgs, inputs, ... }:
{ {
imports = [ imports = [
../full.nix ../full.nix
../base.nix ../base.nix
inputs.nixos-hardware.nixosModules.dell-xps-17-9700-intel
]; ];
hardware.enableRedistributableFirmware = true; hardware.enableRedistributableFirmware = true;
boot.kernelPatches = [{
name = "enable-soundwire-drivers";
patch = null;
extraConfig = ''
SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES y
SND_SOC_INTEL_SOUNDWIRE_SOF_MACH m
SND_SOC_RT1308 m
'';
ignoreConfigErrors = true;
}];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];

View File

@ -1,6 +1,10 @@
{ config, pkgs, ... }: { config, pkgs, inputs, ... }:
{ {
imports = [
inputs.nixos-hardware.nixosModules.raspberry-pi-4
];
hardware.raspberry-pi."4".fkms-3d.enable = true; hardware.raspberry-pi."4".fkms-3d.enable = true;
boot = { boot = {