From be4b612b23817abb6c99e92ad80cf77be4f7a582 Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Fri, 9 Apr 2021 19:22:08 -0600 Subject: [PATCH] treewide: format with nixpkgs-fmt --- extern/default.nix | 3 +- flake.nix | 45 +++++++++++++++--------------- lib/attrs.nix | 4 +-- lib/devos/mkHomeConfigurations.nix | 4 +-- lib/mkFlake/default.nix | 5 ++-- lib/mkFlake/evalArgs.nix | 25 +++++++++-------- tests/lib.nix | 2 +- tests/profiles/t/default.nix | 1 + users/modules/module-list.nix | 2 +- 9 files changed, 48 insertions(+), 43 deletions(-) diff --git a/extern/default.nix b/extern/default.nix index 66f4e782..4ca9df6b 100644 --- a/extern/default.nix +++ b/extern/default.nix @@ -25,6 +25,5 @@ ]; # passed to all home-manager modules - userSpecialArgs = { - }; + userSpecialArgs = { }; } diff --git a/flake.nix b/flake.nix index 71d449b9..dbb30bf3 100644 --- a/flake.nix +++ b/flake.nix @@ -28,26 +28,27 @@ pkgs.inputs.nixpkgs.follows = "nixos"; }; - outputs = inputs@{ deploy, nixos, nur, self, utils, ... }: - let - lib = import ./lib { inherit self nixos inputs; }; - in - lib.mkFlake { - inherit self; - hosts = ./hosts; - packages = import ./pkgs; - suites = import ./suites; - extern = import ./extern; - overrides = import ./overrides; - overlays = ./overlays; - profiles = ./profiles; - userProfiles = ./users/profiles; - modules = import ./modules/module-list.nix; - userModules = import ./users/modules/module-list.nix; - } // { - inherit lib; - defaultTemplate = self.templates.flk; - templates.flk.path = ./.; - templates.flk.description = "flk template"; - }; + outputs = inputs@{ deploy, nixos, nur, self, utils, ... }: + let + lib = import ./lib { inherit self nixos inputs; }; + in + lib.mkFlake + { + inherit self; + hosts = ./hosts; + packages = import ./pkgs; + suites = import ./suites; + extern = import ./extern; + overrides = import ./overrides; + overlays = ./overlays; + profiles = ./profiles; + userProfiles = ./users/profiles; + modules = import ./modules/module-list.nix; + userModules = import ./users/modules/module-list.nix; + } // { + inherit lib; + defaultTemplate = self.templates.flk; + templates.flk.path = ./.; + templates.flk.description = "flk template"; + }; } diff --git a/lib/attrs.nix b/lib/attrs.nix index 63df32cb..50c72d22 100644 --- a/lib/attrs.nix +++ b/lib/attrs.nix @@ -37,9 +37,9 @@ rec { let # Everything that nix flake check requires for the packages output filter = (n: v: with v; let platforms = meta.hydraPlatforms or meta.platforms or [ ]; in - lib.isDerivation v && !meta.broken && builtins.elem system platforms); + lib.isDerivation v && !meta.broken && builtins.elem system platforms); in - lib.filterAttrs filter packages; + lib.filterAttrs filter packages; safeReadDir = path: lib.optionalAttrs (builtins.pathExists path) (builtins.readDir path); } diff --git a/lib/devos/mkHomeConfigurations.nix b/lib/devos/mkHomeConfigurations.nix index ab843938..c0588e29 100644 --- a/lib/devos/mkHomeConfigurations.nix +++ b/lib/devos/mkHomeConfigurations.nix @@ -4,9 +4,9 @@ with lib; let mkHomes = host: config: mapAttrs' (user: v: nameValuePair "${user}@${host}" v) - config.config.system.build.homes; + config.config.system.build.homes; hmConfigs = mapAttrs mkHomes self.nixosConfigurations; in -foldl recursiveUpdate {} (attrValues hmConfigs) +foldl recursiveUpdate { } (attrValues hmConfigs) diff --git a/lib/mkFlake/default.nix b/lib/mkFlake/default.nix index 4ff3cd45..b2864a1a 100644 --- a/lib/mkFlake/default.nix +++ b/lib/mkFlake/default.nix @@ -43,7 +43,8 @@ let tests = nixos.lib.optionalAttrs (system == "x86_64-linux") (import "${self}/tests" { inherit self pkgs; }); deployHosts = nixos.lib.filterAttrs - (n: _: self.nixosConfigurations.${n}.config.nixpkgs.system == system) self.deploy.nodes; + (n: _: self.nixosConfigurations.${n}.config.nixpkgs.system == system) + self.deploy.nodes; deployChecks = deploy.lib.${system}.deployChecks { nodes = deployHosts; }; in nixos.lib.recursiveUpdate tests deployChecks; @@ -56,5 +57,5 @@ let }; }); in - outputs // systemOutputs +outputs // systemOutputs diff --git a/lib/mkFlake/evalArgs.nix b/lib/mkFlake/evalArgs.nix index 658ac6d4..29d04bc6 100644 --- a/lib/mkFlake/evalArgs.nix +++ b/lib/mkFlake/evalArgs.nix @@ -10,7 +10,7 @@ let inputAttrs = with types; functionTo attrs; moduleType = with types; anything // { - inherit (submodule {}) check; + inherit (submodule { }) check; description = "valid module"; }; in @@ -36,7 +36,7 @@ let check = builtins.isFunction; description = "Nixpkgs overlay"; }; - default = (final: prev: {}); + default = (final: prev: { }); defaultText = "(final: prev: {})"; description = '' Overlay for custom packages that will be included in treewide 'pkgs'. @@ -47,7 +47,7 @@ let }; modules = mkOption { type = listOf moduleType; - default = []; + default = [ ]; apply = dev.pathsToImportedAttrs; description = '' list of modules to include in confgurations and export in 'nixosModules' output @@ -55,7 +55,7 @@ let }; userModules = mkOption { type = listOf moduleType; - default = []; + default = [ ]; apply = dev.pathsToImportedAttrs; description = '' list of modules to include in home-manager configurations and export in @@ -78,7 +78,7 @@ let }; suites = let - defaults = { user = {}; system = {}; }; + defaults = { user = { }; system = { }; }; in mkOption { type = inputAttrs; @@ -107,8 +107,11 @@ let extern = let defaults = { - modules = []; overlays = []; specialArgs = {}; - userModules = []; userSpecialArgs = {}; + modules = [ ]; + overlays = [ ]; + specialArgs = { }; + userModules = [ ]; + userSpecialArgs = { }; }; in mkOption { @@ -138,7 +141,7 @@ let }; overrides = mkOption rec { type = attrs; - default = { modules = []; disabledModules = []; packages = _: _: _: {}; }; + default = { modules = [ ]; disabledModules = [ ]; packages = _: _: _: { }; }; defaultText = "{ modules = []; disabledModules = []; packages = {}; }"; apply = x: default // x; description = "attrset of packages and modules that will be pulled from nixpkgs master"; @@ -146,6 +149,6 @@ let }; }; in - nixos.lib.evalModules { - modules = [ argOpts args ]; - } +nixos.lib.evalModules { + modules = [ argOpts args ]; +} diff --git a/tests/lib.nix b/tests/lib.nix index 900cb57a..e2151571 100644 --- a/tests/lib.nix +++ b/tests/lib.nix @@ -92,7 +92,7 @@ lib.runTests { system = { bar = [ profiles.foo.default ]; allProfiles = [ profiles.foo.default profiles.t.default ]; - allUsers = []; + allUsers = [ ]; }; }; }; diff --git a/tests/profiles/t/default.nix b/tests/profiles/t/default.nix index e69de29b..8b137891 100644 --- a/tests/profiles/t/default.nix +++ b/tests/profiles/t/default.nix @@ -0,0 +1 @@ + diff --git a/users/modules/module-list.nix b/users/modules/module-list.nix index fe51488c..1e3ec721 100644 --- a/users/modules/module-list.nix +++ b/users/modules/module-list.nix @@ -1 +1 @@ -[] +[ ]