mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
chore: nf-fmt-nix
This commit is contained in:
parent
7486517713
commit
9903866044
160 changed files with 4570 additions and 3019 deletions
62
modules/system/extern/files.nix
vendored
62
modules/system/extern/files.nix
vendored
|
|
@ -1,13 +1,21 @@
|
|||
let
|
||||
fileModule = {config, name, gensokyo-zone, lib, ...}: let
|
||||
fileModule = {
|
||||
config,
|
||||
name,
|
||||
gensokyo-zone,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.modules) mkOptionDefault;
|
||||
inherit (lib.strings) hasPrefix removePrefix;
|
||||
in {
|
||||
options = with lib.types; {
|
||||
enable = mkEnableOption "external file" // {
|
||||
default = true;
|
||||
};
|
||||
enable =
|
||||
mkEnableOption "external file"
|
||||
// {
|
||||
default = true;
|
||||
};
|
||||
path = mkOption {
|
||||
type = str;
|
||||
default = name;
|
||||
|
|
@ -35,25 +43,33 @@ let
|
|||
relativeSource = let
|
||||
flakeRoot = toString gensokyo-zone.self + "/";
|
||||
sourcePath = toString config.source;
|
||||
in mkOptionDefault (
|
||||
if hasPrefix flakeRoot sourcePath then removePrefix flakeRoot sourcePath
|
||||
else null
|
||||
);
|
||||
in
|
||||
mkOptionDefault (
|
||||
if hasPrefix flakeRoot sourcePath
|
||||
then removePrefix flakeRoot sourcePath
|
||||
else null
|
||||
);
|
||||
};
|
||||
};
|
||||
in {config, gensokyo-zone, lib, ...}: let
|
||||
inherit (lib.options) mkOption;
|
||||
in {
|
||||
options.extern = with lib.types; {
|
||||
files = mkOption {
|
||||
type = attrsOf (submoduleWith {
|
||||
modules = [ fileModule ];
|
||||
specialArgs = {
|
||||
inherit gensokyo-zone;
|
||||
system = config;
|
||||
};
|
||||
});
|
||||
default = { };
|
||||
in
|
||||
{
|
||||
config,
|
||||
gensokyo-zone,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkOption;
|
||||
in {
|
||||
options.extern = with lib.types; {
|
||||
files = mkOption {
|
||||
type = attrsOf (submoduleWith {
|
||||
modules = [fileModule];
|
||||
specialArgs = {
|
||||
inherit gensokyo-zone;
|
||||
system = config;
|
||||
};
|
||||
});
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue