all: Line up lib inherits vertically

This commit is contained in:
talyz 2022-11-13 18:16:57 +01:00
parent a65d7088db
commit d144e365cf
No known key found for this signature in database
GPG key ID: 2DED2151F4671A2B
3 changed files with 72 additions and 13 deletions

View file

@ -11,7 +11,12 @@ let
isBindfs = v: (getDirMethod v) == "bindfs";
isSymlink = v: (getDirMethod v) == "symlink";
inherit (pkgs.callPackage ./lib.nix { }) splitPath dirListToPath concatPaths sanitizeName;
inherit (pkgs.callPackage ./lib.nix { })
splitPath
dirListToPath
concatPaths
sanitizeName
;
mount = "${pkgs.util-linux}/bin/mount";
unmountScript = mountPoint: tries: sleep: ''

26
lib.nix
View file

@ -1,8 +1,20 @@
{ lib }:
let
inherit (lib) filter concatMap concatStringsSep hasPrefix head
replaceStrings optionalString removePrefix foldl' elem;
inherit (lib.strings) sanitizeDerivationName;
inherit (lib)
filter
concatMap
concatStringsSep
hasPrefix
head
replaceStrings
optionalString
removePrefix
foldl'
elem
;
inherit (lib.strings)
sanitizeDerivationName
;
# ["/home/user/" "/.screenrc"] -> ["home" "user" ".screenrc"]
splitPath = paths:
@ -47,5 +59,11 @@ let
result.duplicates;
in
{
inherit splitPath dirListToPath concatPaths sanitizeName duplicates;
inherit
splitPath
dirListToPath
concatPaths
sanitizeName
duplicates
;
}

View file

@ -1,14 +1,40 @@
{ pkgs, config, lib, ... }:
let
inherit (lib) attrNames attrValues zipAttrsWith flatten mkOption
mkDefault mapAttrsToList types foldl' unique concatMapStrings
listToAttrs escapeShellArg escapeShellArgs recursiveUpdate all
filter filterAttrs concatStringsSep concatMapStringsSep isString
catAttrs optional literalExpression;
inherit (lib)
attrNames
attrValues
zipAttrsWith
flatten
mkOption
mkDefault
mapAttrsToList
types
foldl'
unique
concatMapStrings
listToAttrs
escapeShellArg
escapeShellArgs
recursiveUpdate
all
filter
filterAttrs
concatStringsSep
concatMapStringsSep
isString
catAttrs
optional
literalExpression
;
inherit (pkgs.callPackage ./lib.nix { }) splitPath dirListToPath
concatPaths sanitizeName duplicates;
inherit (pkgs.callPackage ./lib.nix { })
splitPath
dirListToPath
concatPaths
sanitizeName
duplicates
;
cfg = config.environment.persistence;
users = config.users.users;
@ -43,7 +69,17 @@ in
default = { };
type =
let
inherit (types) attrsOf bool listOf submodule path either str;
inherit (types)
attrsOf
bool
listOf
submodule
nullOr
path
either
str
coercedTo
;
in
attrsOf (
submodule (