nix #11

Manually merged
geoffrey merged 113 commits from nix into main 2023-12-09 21:43:01 +01:00
2 changed files with 8 additions and 29 deletions
Showing only changes of commit 8ae219fb83 - Show all commits

View file

@ -1,7 +1,9 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let {
recursiveMerge = import ./recursiveMerge.nix; imports = [
getModule = name: import (./modules + "/${name}.nix") { inherit config pkgs; }; ./modules/common.nix
loadModules = modules: recursiveMerge ((map getModule) modules); ./modules/desktop.nix
in ./modules/battery.nix
loadModules [ "common" "desktop" "battery" "wireless" ] ./modules/wireless.nix
];
}

View file

@ -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