mirror of
https://github.com/nix-community/home-manager.git
synced 2024-12-14 11:57:55 +00:00
lib: remove top-level with lib
This commit is contained in:
parent
71902bc913
commit
3ccddfc48d
10 changed files with 23 additions and 24 deletions
|
@ -9,9 +9,8 @@
|
||||||
|
|
||||||
{ lib }:
|
{ lib }:
|
||||||
|
|
||||||
with lib;
|
let inherit (lib) all any filterAttrs mapAttrs mapAttrsToList toposort;
|
||||||
|
in rec {
|
||||||
rec {
|
|
||||||
|
|
||||||
emptyDag = { };
|
emptyDag = { };
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{ homeDirectory, lib, pkgs }:
|
{ homeDirectory, lib, pkgs }:
|
||||||
|
|
||||||
with lib;
|
let
|
||||||
|
inherit (lib) hasPrefix hm literalExpression mkDefault mkIf mkOption removePrefix types;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
# Constructs a type suitable for a `home.file` like option. The
|
# Constructs a type suitable for a `home.file` like option. The
|
||||||
# target path may be either absolute or relative, in which case it
|
# target path may be either absolute or relative, in which case it
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
|
|
||||||
{ lib }:
|
{ lib }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
inherit (lib)
|
||||||
|
concatMapStringsSep concatStrings escape hasPrefix head replaceStrings;
|
||||||
|
|
||||||
mkPrimitive = t: v: {
|
mkPrimitive = t: v: {
|
||||||
_type = "gvariant";
|
_type = "gvariant";
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
{ lib }:
|
{ lib }:
|
||||||
|
|
||||||
with lib;
|
let
|
||||||
|
inherit (lib)
|
||||||
{
|
genList length lowerChars replaceStrings stringToCharacters upperChars;
|
||||||
|
in {
|
||||||
# Figures out a valid Nix store name for the given path.
|
# Figures out a valid Nix store name for the given path.
|
||||||
storeFileName = path:
|
storeFileName = path:
|
||||||
let
|
let
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
{ dag, lib }:
|
{ dag, lib }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
inherit (lib)
|
||||||
|
concatStringsSep defaultFunctor fixedWidthNumber imap1 isAttrs isList length
|
||||||
|
listToAttrs mapAttrs mkIf mkOption mkOptionType nameValuePair stringLength
|
||||||
|
types warn;
|
||||||
|
|
||||||
isDagEntry = e: isAttrs e && (e ? data) && (e ? after) && (e ? before);
|
isDagEntry = e: isAttrs e && (e ? data) && (e ? after) && (e ? before);
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
{ lib, dag ? import ./dag.nix { inherit lib; }
|
{ lib, dag ? import ./dag.nix { inherit lib; }
|
||||||
, gvariant ? import ./gvariant.nix { inherit lib; } }:
|
, gvariant ? import ./gvariant.nix { inherit lib; } }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
inherit (lib)
|
||||||
|
all concatMap foldl' getFiles getValues head isFunction literalExpression
|
||||||
|
mergeAttrs mergeDefaultOption mergeOneOption mergeOptions mkOption
|
||||||
|
mkOptionType showFiles showOption types;
|
||||||
|
|
||||||
typesDag = import ./types-dag.nix { inherit dag lib; };
|
typesDag = import ./types-dag.nix { inherit dag lib; };
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) concatStringsSep hm mkMerge mkOption types;
|
||||||
|
|
||||||
dag = lib.hm.dag;
|
dag = lib.hm.dag;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) concatStringsSep hm mkOption types;
|
||||||
|
|
||||||
dag = lib.hm.dag;
|
dag = lib.hm.dag;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
let inherit (lib) concatStringsSep hm mapAttrsToList mkMerge mkOption types;
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
options.examples = mkOption { type = types.attrsOf hm.types.gvariant; };
|
options.examples = mkOption { type = types.attrsOf hm.types.gvariant; };
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) concatStringsSep hm mkMerge mkOption types;
|
||||||
|
|
||||||
dag = lib.hm.dag;
|
dag = lib.hm.dag;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue