treewide: format with nixpkgs-fmt

This commit is contained in:
Timothy DeHerrera 2021-04-09 19:22:08 -06:00
parent 3daa990728
commit be4b612b23
No known key found for this signature in database
GPG key ID: 8985725DB5B0C122
9 changed files with 48 additions and 43 deletions

3
extern/default.nix vendored
View file

@ -25,6 +25,5 @@
]; ];
# passed to all home-manager modules # passed to all home-manager modules
userSpecialArgs = { userSpecialArgs = { };
};
} }

View file

@ -28,26 +28,27 @@
pkgs.inputs.nixpkgs.follows = "nixos"; pkgs.inputs.nixpkgs.follows = "nixos";
}; };
outputs = inputs@{ deploy, nixos, nur, self, utils, ... }: outputs = inputs@{ deploy, nixos, nur, self, utils, ... }:
let let
lib = import ./lib { inherit self nixos inputs; }; lib = import ./lib { inherit self nixos inputs; };
in in
lib.mkFlake { lib.mkFlake
inherit self; {
hosts = ./hosts; inherit self;
packages = import ./pkgs; hosts = ./hosts;
suites = import ./suites; packages = import ./pkgs;
extern = import ./extern; suites = import ./suites;
overrides = import ./overrides; extern = import ./extern;
overlays = ./overlays; overrides = import ./overrides;
profiles = ./profiles; overlays = ./overlays;
userProfiles = ./users/profiles; profiles = ./profiles;
modules = import ./modules/module-list.nix; userProfiles = ./users/profiles;
userModules = import ./users/modules/module-list.nix; modules = import ./modules/module-list.nix;
} // { userModules = import ./users/modules/module-list.nix;
inherit lib; } // {
defaultTemplate = self.templates.flk; inherit lib;
templates.flk.path = ./.; defaultTemplate = self.templates.flk;
templates.flk.description = "flk template"; templates.flk.path = ./.;
}; templates.flk.description = "flk template";
};
} }

View file

@ -37,9 +37,9 @@ rec {
let let
# Everything that nix flake check requires for the packages output # Everything that nix flake check requires for the packages output
filter = (n: v: with v; let platforms = meta.hydraPlatforms or meta.platforms or [ ]; in 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 in
lib.filterAttrs filter packages; lib.filterAttrs filter packages;
safeReadDir = path: lib.optionalAttrs (builtins.pathExists path) (builtins.readDir path); safeReadDir = path: lib.optionalAttrs (builtins.pathExists path) (builtins.readDir path);
} }

View file

@ -4,9 +4,9 @@ with lib;
let let
mkHomes = host: config: mkHomes = host: config:
mapAttrs' (user: v: nameValuePair "${user}@${host}" v) mapAttrs' (user: v: nameValuePair "${user}@${host}" v)
config.config.system.build.homes; config.config.system.build.homes;
hmConfigs = mapAttrs mkHomes self.nixosConfigurations; hmConfigs = mapAttrs mkHomes self.nixosConfigurations;
in in
foldl recursiveUpdate {} (attrValues hmConfigs) foldl recursiveUpdate { } (attrValues hmConfigs)

View file

@ -43,7 +43,8 @@ let
tests = nixos.lib.optionalAttrs (system == "x86_64-linux") tests = nixos.lib.optionalAttrs (system == "x86_64-linux")
(import "${self}/tests" { inherit self pkgs; }); (import "${self}/tests" { inherit self pkgs; });
deployHosts = nixos.lib.filterAttrs 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; }; deployChecks = deploy.lib.${system}.deployChecks { nodes = deployHosts; };
in in
nixos.lib.recursiveUpdate tests deployChecks; nixos.lib.recursiveUpdate tests deployChecks;
@ -56,5 +57,5 @@ let
}; };
}); });
in in
outputs // systemOutputs outputs // systemOutputs

View file

@ -10,7 +10,7 @@ let
inputAttrs = with types; functionTo attrs; inputAttrs = with types; functionTo attrs;
moduleType = with types; anything // { moduleType = with types; anything // {
inherit (submodule {}) check; inherit (submodule { }) check;
description = "valid module"; description = "valid module";
}; };
in in
@ -36,7 +36,7 @@ let
check = builtins.isFunction; check = builtins.isFunction;
description = "Nixpkgs overlay"; description = "Nixpkgs overlay";
}; };
default = (final: prev: {}); default = (final: prev: { });
defaultText = "(final: prev: {})"; defaultText = "(final: prev: {})";
description = '' description = ''
Overlay for custom packages that will be included in treewide 'pkgs'. Overlay for custom packages that will be included in treewide 'pkgs'.
@ -47,7 +47,7 @@ let
}; };
modules = mkOption { modules = mkOption {
type = listOf moduleType; type = listOf moduleType;
default = []; default = [ ];
apply = dev.pathsToImportedAttrs; apply = dev.pathsToImportedAttrs;
description = '' description = ''
list of modules to include in confgurations and export in 'nixosModules' output list of modules to include in confgurations and export in 'nixosModules' output
@ -55,7 +55,7 @@ let
}; };
userModules = mkOption { userModules = mkOption {
type = listOf moduleType; type = listOf moduleType;
default = []; default = [ ];
apply = dev.pathsToImportedAttrs; apply = dev.pathsToImportedAttrs;
description = '' description = ''
list of modules to include in home-manager configurations and export in list of modules to include in home-manager configurations and export in
@ -78,7 +78,7 @@ let
}; };
suites = suites =
let let
defaults = { user = {}; system = {}; }; defaults = { user = { }; system = { }; };
in in
mkOption { mkOption {
type = inputAttrs; type = inputAttrs;
@ -107,8 +107,11 @@ let
extern = extern =
let let
defaults = { defaults = {
modules = []; overlays = []; specialArgs = {}; modules = [ ];
userModules = []; userSpecialArgs = {}; overlays = [ ];
specialArgs = { };
userModules = [ ];
userSpecialArgs = { };
}; };
in in
mkOption { mkOption {
@ -138,7 +141,7 @@ let
}; };
overrides = mkOption rec { overrides = mkOption rec {
type = attrs; type = attrs;
default = { modules = []; disabledModules = []; packages = _: _: _: {}; }; default = { modules = [ ]; disabledModules = [ ]; packages = _: _: _: { }; };
defaultText = "{ modules = []; disabledModules = []; packages = {}; }"; defaultText = "{ modules = []; disabledModules = []; packages = {}; }";
apply = x: default // x; apply = x: default // x;
description = "attrset of packages and modules that will be pulled from nixpkgs master"; description = "attrset of packages and modules that will be pulled from nixpkgs master";
@ -146,6 +149,6 @@ let
}; };
}; };
in in
nixos.lib.evalModules { nixos.lib.evalModules {
modules = [ argOpts args ]; modules = [ argOpts args ];
} }

View file

@ -92,7 +92,7 @@ lib.runTests {
system = { system = {
bar = [ profiles.foo.default ]; bar = [ profiles.foo.default ];
allProfiles = [ profiles.foo.default profiles.t.default ]; allProfiles = [ profiles.foo.default profiles.t.default ];
allUsers = []; allUsers = [ ];
}; };
}; };
}; };

View file

@ -0,0 +1 @@

View file

@ -1 +1 @@
[] [ ]