nix: Remove unecessary module handling
Who would have thought, someone thought about this before me :shockedpikachu:
This commit is contained in:
parent
3af998440f
commit
8ae219fb83
|
@ -1,7 +1,9 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
recursiveMerge = import ./recursiveMerge.nix;
|
||||
getModule = name: import (./modules + "/${name}.nix") { inherit config pkgs; };
|
||||
loadModules = modules: recursiveMerge ((map getModule) modules);
|
||||
in
|
||||
loadModules [ "common" "desktop" "battery" "wireless" ]
|
||||
{
|
||||
imports = [
|
||||
./modules/common.nix
|
||||
./modules/desktop.nix
|
||||
./modules/battery.nix
|
||||
./modules/wireless.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
let
|
||||
|
||||
pkgs = import <nixpkgs> { };
|
||||
# Somehow, if fed the pkgs from a nix-build, it creates an infinite recursion, hence the search path
|
||||
lib = pkgs.lib;
|
||||
|
||||
recursiveMerge = with lib; attrList:
|
||||
let f = attrPath:
|
||||
zipAttrsWith (n: values:
|
||||
if tail values == [ ]
|
||||
then head values
|
||||
else if all isList values
|
||||
then unique (concatLists values)
|
||||
else if all isAttrs values
|
||||
then f (attrPath ++ [ n ]) values
|
||||
else last values
|
||||
);
|
||||
in f [ ] attrList;
|
||||
|
||||
|
||||
in
|
||||
|
||||
recursiveMerge
|
Loading…
Reference in a new issue