mirror of
https://github.com/nix-community/impermanence
synced 2024-11-10 05:44:17 +00:00
all: Line up lib inherits vertically
This commit is contained in:
parent
a65d7088db
commit
d144e365cf
3 changed files with 72 additions and 13 deletions
|
@ -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
26
lib.nix
|
@ -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
|
||||
;
|
||||
}
|
||||
|
|
52
nixos.nix
52
nixos.nix
|
@ -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 (
|
||||
|
|
Loading…
Reference in a new issue