From d83cd6b142ed75c65fb896acf727574c3cb4b725 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Sat, 6 Nov 2021 10:29:47 -0400 Subject: [PATCH] DRY nixpkgs config --- flake.nix | 4 +++- hosts/facade.nix | 1 - hosts/hetzner/ax101.nix | 1 - hosts/hetzner/ax61-nvme.nix | 5 ++--- hosts/thick.nix | 1 - hosts/thin.nix | 1 - 6 files changed, 5 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index 2454641..c531b46 100644 --- a/flake.nix +++ b/flake.nix @@ -24,14 +24,16 @@ outputs = inputs@{ self, home-manager, nixpkgs, ... }: let system = "x86_64-linux"; + # Add nixpkgs overlays and config here. They apply to system and home-manager builds. pkgs = import nixpkgs { inherit system; + config.allowUnfree = true; overlays = [ (import inputs.emacs-overlay) ]; }; mkComputer = configurationNix: extraModules: nixpkgs.lib.nixosSystem { - inherit system; + inherit system pkgs; # Arguments to pass to all modules. specialArgs = { inherit system inputs; }; modules = ( diff --git a/hosts/facade.nix b/hosts/facade.nix index 14ee59c..5933230 100644 --- a/hosts/facade.nix +++ b/hosts/facade.nix @@ -8,7 +8,6 @@ swapDevices = [{ device = "/swapfile"; size = 2048; }]; - nixpkgs.config.allowUnfree = true; nix = { package = pkgs.nixUnstable; extraOptions = '' diff --git a/hosts/hetzner/ax101.nix b/hosts/hetzner/ax101.nix index 6f1f8de..109945d 100644 --- a/hosts/hetzner/ax101.nix +++ b/hosts/hetzner/ax101.nix @@ -100,7 +100,6 @@ }; - nixpkgs.config.allowUnfree = true; nix = { package = pkgs.nixUnstable; extraOptions = '' diff --git a/hosts/hetzner/ax61-nvme.nix b/hosts/hetzner/ax61-nvme.nix index 14e9d35..626356c 100644 --- a/hosts/hetzner/ax61-nvme.nix +++ b/hosts/hetzner/ax61-nvme.nix @@ -9,7 +9,7 @@ boot.initrd.availableKernelModules = [ "nvme" "ahci" ]; boot.initrd.kernelModules = [ "dm-snapshot" ]; boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = []; + boot.extraModulePackages = [ ]; fileSystems."/" = { @@ -17,7 +17,7 @@ fsType = "ext4"; }; - swapDevices = []; + swapDevices = [ ]; nix.maxJobs = lib.mkDefault 32; powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; @@ -99,7 +99,6 @@ hostName = "ryzen9"; }; - nixpkgs.config.allowUnfree = true; nix = { package = pkgs.nixUnstable; extraOptions = '' diff --git a/hosts/thick.nix b/hosts/thick.nix index 033b7e7..ddc9241 100644 --- a/hosts/thick.nix +++ b/hosts/thick.nix @@ -51,7 +51,6 @@ Option "Xinerama" "off" ''; - nixpkgs.config.allowUnfree = true; nix = { package = pkgs.nixFlakes; extraOptions = '' diff --git a/hosts/thin.nix b/hosts/thin.nix index 596de73..c2c5de1 100644 --- a/hosts/thin.nix +++ b/hosts/thin.nix @@ -38,7 +38,6 @@ boot.kernelPackages = pkgs.linuxPackages_latest; boot.supportedFilesystems = [ "ntfs" ]; - nixpkgs.config.allowUnfree = true; nix = { package = pkgs.nixFlakes; extraOptions = ''