flake.nix: remove unused specialArgs

This commit is contained in:
colin 2023-01-03 14:18:57 +00:00
parent 618e9bd2fa
commit 01e44c1f7f
2 changed files with 21 additions and 1 deletions

View File

@ -54,7 +54,6 @@
in (nixosSystem {
# by default the local system is the same as the target, employing emulation when they differ
system = target;
specialArgs = { inherit mobile-nixos home-manager impermanence; };
modules = [
./modules
(import ./hosts/instantiate.nix name)

21
modules/lib/default.nix Normal file
View File

@ -0,0 +1,21 @@
{ lib, utils, ... }:
rec {
path = {
# split the string path into a list of string components.
# root directory "/" becomes the empty list [].
# implicitly performs normalization so that:
# split "a//b/" => ["a" "b"]
# split "/a/b" => ["a" "b"]
split = str: builtins.filter (seg: (builtins.isString seg) && seg != "" ) (builtins.split "/" str);
# return a string path, with leading slash but no trailing slash
joinAbs = comps: "/" + (builtins.concatStringsSep "/" comps);
concat = paths: path.joinAbs (builtins.concatLists (builtins.map path.split paths));
# normalize the given path
norm = str: path.joinAbs (path.split str);
# return the parent directory. doesn't care about leading/trailing slashes.
# the parent of "/" is "/".
parent = str: path.norm (builtins.dirOf (path.norm str));
hasParent = str: (path.parent str) != (path.norm str);
};
}