forked from pub-solar/os
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:
parent
5b5d072851
commit
e93ac2f790
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
];
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue