inherit nixpkgs.lib

This commit is contained in:
Sean Buckley 2022-12-19 23:55:11 -05:00
parent 83a41cbe92
commit fa00ab3f0e

View file

@ -4,6 +4,7 @@
outputs = { self, nixpkgs, impermanence, ... }: outputs = { self, nixpkgs, impermanence, ... }:
let let
inherit (nixpkgs) lib;
mypkgs = pkgs: mypkgs = pkgs:
let let
@ -13,14 +14,14 @@
in in
if p.meta.available then p else pkgs.emptyDirectory; if p.meta.available then p else pkgs.emptyDirectory;
in in
(nixpkgs.lib.mapAttrs' (lib.mapAttrs'
(name: type: { (name: type: {
name = nixpkgs.lib.removeSuffix ".nix" name; name = lib.removeSuffix ".nix" name;
value = pkg (./pkgs + "/${name}"); value = pkg (./pkgs + "/${name}");
}) })
(builtins.readDir ./pkgs)); (builtins.readDir ./pkgs));
forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" ]; forAllSystems = lib.genAttrs [ "x86_64-linux" ];
pins = { pins = {
nix.registry.nixpkgs.to = { nix.registry.nixpkgs.to = {
@ -42,9 +43,9 @@
inherit (impermanence.nixosModules) impermanence; inherit (impermanence.nixosModules) impermanence;
pkgs.nixpkgs.overlays = [ (_: mypkgs) ]; pkgs.nixpkgs.overlays = [ (_: mypkgs) ];
} // } //
nixpkgs.lib.mapAttrs' lib.mapAttrs'
(name: type: { (name: type: {
name = nixpkgs.lib.removeSuffix ".nix" name; name = lib.removeSuffix ".nix" name;
value = import (./modules + "/${name}"); value = import (./modules + "/${name}");
}) })
(builtins.readDir ./modules); (builtins.readDir ./modules);
@ -59,7 +60,7 @@
nixosModules = mods // { default.imports = builtins.attrValues mods; }; nixosModules = mods // { default.imports = builtins.attrValues mods; };
nixosConfigurations = builtins.mapAttrs nixosConfigurations = builtins.mapAttrs
(_: nixpkgs.lib.nixosSystem) (_: lib.nixosSystem)
(import ./hosts self.nixosModules.default); (import ./hosts self.nixosModules.default);
apps = forAllSystems (system: apps = forAllSystems (system: