From d5ba9f617374aaa9552f63d34f21960c963fbbba Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Wed, 29 Jan 2020 08:50:07 -0700 Subject: [PATCH] flake.nix: define `pkgs` in flake Set the global package set via `hosts/default.nix` passed in from its definition in `flake.nix`. --- flake.nix | 13 ++++++++----- hosts/default.nix | 6 +++--- profiles/core.nix | 2 -- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index 27657db..0df02e3 100644 --- a/flake.nix +++ b/flake.nix @@ -6,19 +6,22 @@ inputs.nixpkgs.url = "github:nrdxp/nixpkgs/fork"; inputs.home.url = "github:nrdxp/home-manager/flakes"; - outputs = args@{ self, home, nixpkgs }: + outputs = inputs@{ self, home, nixpkgs }: let inherit (builtins) listToAttrs baseNameOf attrNames readDir; inherit (nixpkgs.lib) removeSuffix; + system = "x86_64-linux"; pkgs = import nixpkgs { - system = "x86_64-linux"; + inherit system; overlays = self.overlays; + config = { allowUnfree = true; }; }; - in { - nixosConfigurations = let configs = import ./hosts args; - in configs; + in { + nixosConfigurations = + let configs = import ./hosts (inputs // { inherit system pkgs; }); + in configs; overlay = import ./pkgs; diff --git a/hosts/default.nix b/hosts/default.nix index 53d4d83..4f90a2d 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,4 +1,4 @@ -args@{ home, nixpkgs, self, ... }: +inputs@{ home, nixpkgs, self, pkgs, system, ... }: let inherit (nixpkgs) lib; @@ -10,7 +10,7 @@ let config = hostName: lib.nixosSystem rec { - system = "x86_64-linux"; + inherit system; specialArgs.usr = { inherit utils; }; @@ -29,7 +29,7 @@ let system.configurationRevision = self.rev; - nixpkgs.overlays = self.overlays; + nixpkgs = { inherit pkgs; }; }; local = import "${toString ./.}/${hostName}.nix"; diff --git a/profiles/core.nix b/profiles/core.nix index 777f5d3..cce887b 100644 --- a/profiles/core.nix +++ b/profiles/core.nix @@ -119,8 +119,6 @@ in { }; - nixpkgs.config.allowUnfree = true; - security = { hideProcessInformation = true;