summaryrefslogtreecommitdiff
path: root/lib/depot-tools.nix
diff options
context:
space:
mode:
authorKleidi Bujari <mail@4kb.net>2026-10-03 19:56:13 -0700
committerKleidi Bujari <mail@4kb.net>2026-10-03 20:59:26 -0700
commit0d15a4d19f7925be328c2d24214a11e5ac541c40 (patch)
treeff75c552989cec4651f941126628a3702f6c6bcf /lib/depot-tools.nix
parent16918d62b34b7e4d7817837057b88acb44e4f63c (diff)
downloaddepot-0d15a4d19f7925be328c2d24214a11e5ac541c40.tar.gz
depot-0d15a4d19f7925be328c2d24214a11e5ac541c40.tar.bz2
depot-0d15a4d19f7925be328c2d24214a11e5ac541c40.zip
nixfmt formatting pass
Diffstat (limited to 'lib/depot-tools.nix')
-rw-r--r--lib/depot-tools.nix68
1 files changed, 37 insertions, 31 deletions
diff --git a/lib/depot-tools.nix b/lib/depot-tools.nix
index 7c2fc6b..8e5a16e 100644
--- a/lib/depot-tools.nix
+++ b/lib/depot-tools.nix
@@ -1,7 +1,8 @@
-{ inputs
-, systems
-, nixpkgs ? inputs.nixpkgs
-, ...
+{
+ inputs,
+ systems,
+ nixpkgs ? inputs.nixpkgs,
+ ...
}:
let
@@ -27,30 +28,25 @@ let
# Get paths to directories
onlyDirs = filterAttrs (_name: type: type == "directory") entries;
- dirPaths = mapAttrs
- (name: type: {
- path = path + "/${name}";
- inherit type;
- })
- onlyDirs;
+ dirPaths = mapAttrs (name: type: {
+ path = path + "/${name}";
+ inherit type;
+ }) onlyDirs;
# Get paths to nix files, where the name is the basename of the file without the .nix extension
- nixPaths = removeAttrs
- (mapAttrs'
- (
- name: type:
- let
- nixName = match "(.*)\\.nix" name;
- in
- {
- name = if type == "directory" || nixName == null then "__junk" else (head nixName);
- value = {
- path = path + "/${name}";
- type = type;
- };
- }
- )
- entries) [ "__junk" ];
+ nixPaths = removeAttrs (mapAttrs' (
+ name: type:
+ let
+ nixName = match "(.*)\\.nix" name;
+ in
+ {
+ name = if type == "directory" || nixName == null then "__junk" else (head nixName);
+ value = {
+ path = path + "/${name}";
+ type = type;
+ };
+ }
+ ) entries) [ "__junk" ];
combined = dirPaths // nixPaths;
in
@@ -61,9 +57,9 @@ let
system:
let
# Resolve the packages for each input.
- perSystem = mapAttrs
- (_: flake: flake.legacyPackages.${system} or { } // flake.packages.${system} or { })
- inputs;
+ perSystem = mapAttrs (
+ _: flake: flake.legacyPackages.${system} or { } // flake.packages.${system} or { }
+ ) inputs;
# Handle nixpkgs specially.
pkgs =
@@ -78,7 +74,17 @@ let
flake = inputs.self;
in
- makeScope callPackageWith (_: { inherit inputs perSystem flake pkgs system; })
+ makeScope callPackageWith (_: {
+ inherit
+ inputs
+ perSystem
+ flake
+ pkgs
+ system
+ ;
+ })
);
in
-{ inherit importDir systemArgs; }
+{
+ inherit importDir systemArgs;
+}