flake.nix: name flake inputs

The flake inputs can now be arbitrarily referenced from
hosts/default.nix as they are all passed into it. Any input not
declared at the top of hosts/default.nix can still be referenced
as args.<input>.
This commit is contained in:
Timothy DeHerrera 2020-01-03 18:27:52 -07:00
parent 5b5d072851
commit e93ac2f790
No known key found for this signature in database
GPG key ID: 8985725DB5B0C122
2 changed files with 10 additions and 14 deletions

View file

@ -6,7 +6,7 @@
inputs.nixpkgs.url = "github:nrdxp/nixpkgs/fork";
inputs.home.url = "github:nrdxp/home-manager/flakes";
outputs = { self, home, nixpkgs }: let
outputs = args@{ self, home, nixpkgs }: let
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = self.overlays;
@ -14,11 +14,7 @@
in
{
nixosConfigurations = let
configs = import ./hosts {
inherit nixpkgs;
flake = self;
home = home.nixosModules.home-manager;
};
configs = import ./hosts args;
in
configs;

View file

@ -1,4 +1,4 @@
{ home, nixpkgs, flake, ... }:
args@{ home, nixpkgs, self, ... }:
let
utils = import ../lib/utils.nix { lib = nixpkgs.lib; };
@ -11,7 +11,7 @@ let
;
config = self:
config = this:
nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
@ -19,24 +19,24 @@ let
core = ../profiles/core.nix;
global = {
networking.hostName = self;
networking.hostName = this;
nix.nixPath = [
"nixpkgs=${nixpkgs}"
"nixos-config=/etc/nixos/configuration.nix"
];
system.configurationRevision = flake.rev;
system.configurationRevision = self.rev;
nixpkgs.overlays = flake.overlays;
nixpkgs.overlays = self.overlays;
};
local = import "${toString ./.}/${self}.nix";
local = import "${toString ./.}/${this}.nix";
in
attrValues flake.nixosModules ++ [
attrValues self.nixosModules ++ [
core
global
local
home
home.nixosModules.home-manager
];
};