mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 04:05:40 +03:00
treewide: format all inactive Nix files
After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-builda08b3a4d19
.tar.gz \ --argstr baseRevb32a094368
result/bin/apply-formatting $NIXPKGS_PATH
This commit is contained in:
parent
b32a094368
commit
4f0dadbf38
21293 changed files with 701351 additions and 428307 deletions
|
@ -1,4 +1,8 @@
|
|||
{ lib, systemdUtils, pkgs }:
|
||||
{
|
||||
lib,
|
||||
systemdUtils,
|
||||
pkgs,
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (systemdUtils.lib)
|
||||
|
@ -57,105 +61,196 @@ let
|
|||
submodule
|
||||
;
|
||||
|
||||
initrdStorePathModule = { config, ... }: {
|
||||
options = {
|
||||
enable = (mkEnableOption "copying of this file and symlinking it") // { default = true; };
|
||||
|
||||
target = mkOption {
|
||||
type = nullOr path;
|
||||
description = ''
|
||||
Path of the symlink.
|
||||
'';
|
||||
default = null;
|
||||
};
|
||||
|
||||
source = mkOption {
|
||||
type = path;
|
||||
description = "Path of the source file.";
|
||||
};
|
||||
|
||||
dlopen = {
|
||||
usePriority = mkOption {
|
||||
type = enum [ "required" "recommended" "suggested" ];
|
||||
default = "recommended";
|
||||
description = ''
|
||||
Priority of dlopen ELF notes to include. "required" is
|
||||
minimal, "recommended" includes "required", and
|
||||
"suggested" includes "recommended".
|
||||
|
||||
See: https://systemd.io/ELF_DLOPEN_METADATA/
|
||||
'';
|
||||
initrdStorePathModule =
|
||||
{ config, ... }:
|
||||
{
|
||||
options = {
|
||||
enable = (mkEnableOption "copying of this file and symlinking it") // {
|
||||
default = true;
|
||||
};
|
||||
|
||||
features = mkOption {
|
||||
type = listOf singleLineStr;
|
||||
default = [ ];
|
||||
target = mkOption {
|
||||
type = nullOr path;
|
||||
description = ''
|
||||
Features to enable via dlopen ELF notes. These will be in
|
||||
addition to anything included via 'usePriority',
|
||||
regardless of their priority.
|
||||
Path of the symlink.
|
||||
'';
|
||||
default = null;
|
||||
};
|
||||
|
||||
source = mkOption {
|
||||
type = path;
|
||||
description = "Path of the source file.";
|
||||
};
|
||||
|
||||
dlopen = {
|
||||
usePriority = mkOption {
|
||||
type = enum [
|
||||
"required"
|
||||
"recommended"
|
||||
"suggested"
|
||||
];
|
||||
default = "recommended";
|
||||
description = ''
|
||||
Priority of dlopen ELF notes to include. "required" is
|
||||
minimal, "recommended" includes "required", and
|
||||
"suggested" includes "recommended".
|
||||
|
||||
See: https://systemd.io/ELF_DLOPEN_METADATA/
|
||||
'';
|
||||
};
|
||||
|
||||
features = mkOption {
|
||||
type = listOf singleLineStr;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Features to enable via dlopen ELF notes. These will be in
|
||||
addition to anything included via 'usePriority',
|
||||
regardless of their priority.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
units = attrsOf (submodule ({ name, config, ... }: {
|
||||
options = concreteUnitOptions;
|
||||
config = {
|
||||
name = mkDefault name;
|
||||
unit = mkDefault (makeUnit name config);
|
||||
};
|
||||
}));
|
||||
units = attrsOf (
|
||||
submodule (
|
||||
{ name, config, ... }:
|
||||
{
|
||||
options = concreteUnitOptions;
|
||||
config = {
|
||||
name = mkDefault name;
|
||||
unit = mkDefault (makeUnit name config);
|
||||
};
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
services = attrsOf (submodule [ stage2ServiceOptions unitConfig stage2ServiceConfig ]);
|
||||
initrdServices = attrsOf (submodule [ stage1ServiceOptions unitConfig stage1ServiceConfig ]);
|
||||
services = attrsOf (submodule [
|
||||
stage2ServiceOptions
|
||||
unitConfig
|
||||
stage2ServiceConfig
|
||||
]);
|
||||
initrdServices = attrsOf (submodule [
|
||||
stage1ServiceOptions
|
||||
unitConfig
|
||||
stage1ServiceConfig
|
||||
]);
|
||||
|
||||
targets = attrsOf (submodule [ stage2CommonUnitOptions unitConfig targetConfig ]);
|
||||
initrdTargets = attrsOf (submodule [ stage1CommonUnitOptions unitConfig targetConfig ]);
|
||||
targets = attrsOf (submodule [
|
||||
stage2CommonUnitOptions
|
||||
unitConfig
|
||||
targetConfig
|
||||
]);
|
||||
initrdTargets = attrsOf (submodule [
|
||||
stage1CommonUnitOptions
|
||||
unitConfig
|
||||
targetConfig
|
||||
]);
|
||||
|
||||
sockets = attrsOf (submodule [ stage2SocketOptions unitConfig socketConfig]);
|
||||
initrdSockets = attrsOf (submodule [ stage1SocketOptions unitConfig socketConfig ]);
|
||||
sockets = attrsOf (submodule [
|
||||
stage2SocketOptions
|
||||
unitConfig
|
||||
socketConfig
|
||||
]);
|
||||
initrdSockets = attrsOf (submodule [
|
||||
stage1SocketOptions
|
||||
unitConfig
|
||||
socketConfig
|
||||
]);
|
||||
|
||||
timers = attrsOf (submodule [ stage2TimerOptions unitConfig timerConfig ]);
|
||||
initrdTimers = attrsOf (submodule [ stage1TimerOptions unitConfig timerConfig ]);
|
||||
timers = attrsOf (submodule [
|
||||
stage2TimerOptions
|
||||
unitConfig
|
||||
timerConfig
|
||||
]);
|
||||
initrdTimers = attrsOf (submodule [
|
||||
stage1TimerOptions
|
||||
unitConfig
|
||||
timerConfig
|
||||
]);
|
||||
|
||||
paths = attrsOf (submodule [ stage2PathOptions unitConfig pathConfig ]);
|
||||
initrdPaths = attrsOf (submodule [ stage1PathOptions unitConfig pathConfig ]);
|
||||
paths = attrsOf (submodule [
|
||||
stage2PathOptions
|
||||
unitConfig
|
||||
pathConfig
|
||||
]);
|
||||
initrdPaths = attrsOf (submodule [
|
||||
stage1PathOptions
|
||||
unitConfig
|
||||
pathConfig
|
||||
]);
|
||||
|
||||
slices = attrsOf (submodule [ stage2SliceOptions unitConfig sliceConfig ]);
|
||||
initrdSlices = attrsOf (submodule [ stage1SliceOptions unitConfig sliceConfig ]);
|
||||
slices = attrsOf (submodule [
|
||||
stage2SliceOptions
|
||||
unitConfig
|
||||
sliceConfig
|
||||
]);
|
||||
initrdSlices = attrsOf (submodule [
|
||||
stage1SliceOptions
|
||||
unitConfig
|
||||
sliceConfig
|
||||
]);
|
||||
|
||||
mounts = listOf (submodule [ stage2MountOptions unitConfig mountConfig ]);
|
||||
initrdMounts = listOf (submodule [ stage1MountOptions unitConfig mountConfig ]);
|
||||
mounts = listOf (submodule [
|
||||
stage2MountOptions
|
||||
unitConfig
|
||||
mountConfig
|
||||
]);
|
||||
initrdMounts = listOf (submodule [
|
||||
stage1MountOptions
|
||||
unitConfig
|
||||
mountConfig
|
||||
]);
|
||||
|
||||
automounts = listOf (submodule [ stage2AutomountOptions unitConfig automountConfig ]);
|
||||
initrdAutomounts = attrsOf (submodule [ stage1AutomountOptions unitConfig automountConfig ]);
|
||||
automounts = listOf (submodule [
|
||||
stage2AutomountOptions
|
||||
unitConfig
|
||||
automountConfig
|
||||
]);
|
||||
initrdAutomounts = attrsOf (submodule [
|
||||
stage1AutomountOptions
|
||||
unitConfig
|
||||
automountConfig
|
||||
]);
|
||||
|
||||
initrdStorePath = listOf (coercedTo
|
||||
(oneOf [ singleLineStr package ])
|
||||
(source: { inherit source; })
|
||||
(submodule initrdStorePathModule));
|
||||
initrdStorePath = listOf (
|
||||
coercedTo (oneOf [
|
||||
singleLineStr
|
||||
package
|
||||
]) (source: { inherit source; }) (submodule initrdStorePathModule)
|
||||
);
|
||||
|
||||
initrdContents = attrsOf (submodule ({ config, options, name, ... }: {
|
||||
imports = [ initrdStorePathModule ];
|
||||
options = {
|
||||
text = mkOption {
|
||||
default = null;
|
||||
type = nullOr lines;
|
||||
description = "Text of the file.";
|
||||
};
|
||||
};
|
||||
initrdContents = attrsOf (
|
||||
submodule (
|
||||
{
|
||||
config,
|
||||
options,
|
||||
name,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ initrdStorePathModule ];
|
||||
options = {
|
||||
text = mkOption {
|
||||
default = null;
|
||||
type = nullOr lines;
|
||||
description = "Text of the file.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
target = mkDefault name;
|
||||
source = mkIf (config.text != null) (
|
||||
let name' = "initrd-" + baseNameOf name;
|
||||
in mkDerivedConfig options.text (pkgs.writeText name')
|
||||
);
|
||||
};
|
||||
}));
|
||||
config = {
|
||||
target = mkDefault name;
|
||||
source = mkIf (config.text != null) (
|
||||
let
|
||||
name' = "initrd-" + baseNameOf name;
|
||||
in
|
||||
mkDerivedConfig options.text (pkgs.writeText name')
|
||||
);
|
||||
};
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue