[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;
};
};
outputs = {
outputs = inputs@{
self, nix, nixpkgs, nixos-hardware, home-manager, taffybar, xmonad,
xmonad-contrib, notifications-tray-icon
}:
@ -56,30 +56,29 @@
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
{
nixosConfigurations = {
ivanm-dfinity-razer = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ forAll ./machines/ivanm-dfinity-razer.nix ];
ivanm-dfinity-razer = mkNixosConfig {
modules = [ ./machines/ivanm-dfinity-razer.nix ];
};
ryzen-shine = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ forAll ./machines/ryzen-shine.nix ];
ryzen-shine = mkNixosConfig {
modules = [ ./machines/ryzen-shine.nix ];
};
adele = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ forAll ./machines/adele.nix ({ ... }: {
imports = [
nixos-hardware.nixosModules.dell-xps-17-9700-intel
];
})];
adele = mkNixosConfig {
modules = [ ./machines/adele.nix ];
};
biskcomp = nixpkgs.lib.nixosSystem {
biskcomp = mkNixosConfig {
system = "aarch64-linux";
modules = [ forAll piHardware ./machines/biskcomp.nix ];
};
air-gapped-pi = nixpkgs.lib.nixosSystem {
air-gapped-pi = mkNixosConfig {
system = "aarch64-linux";
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
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }:
{ config, lib, pkgs, inputs, ... }:
{
imports = [
../full.nix
../base.nix
inputs.nixos-hardware.nixosModules.dell-xps-17-9700-intel
];
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.kernelPackages = pkgs.linuxPackages_latest;
boot.initrd.kernelModules = [ ];
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;
boot = {