From d3e0802d380ecc751c6ed51415617c04f18254e7 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 16 Jan 2024 15:19:51 +0800 Subject: [PATCH] chore: reformat codebase --- apps/run-workflow-with-vm/configuration.nix | 2 +- modules/flake-parts/images.nix | 4 +- modules/flake-parts/setups/home-manager.nix | 70 +++++++++---------- modules/flake-parts/setups/nixos.nix | 24 +++---- .../programs/gnome-session/submodules.nix | 2 +- 5 files changed, 51 insertions(+), 51 deletions(-) diff --git a/apps/run-workflow-with-vm/configuration.nix b/apps/run-workflow-with-vm/configuration.nix index 47c39762..03186894 100644 --- a/apps/run-workflow-with-vm/configuration.nix +++ b/apps/run-workflow-with-vm/configuration.nix @@ -1,7 +1,7 @@ # A very basic NixOS VM configuration intended for testing out the given # workflow module. It's a good thing the baseline for the configuration is not # tedious to set up for simpler configs like this. -{ workflow, extraModules ? [] }: +{ workflow, extraModules ? [ ] }: let pkgs = import { }; diff --git a/modules/flake-parts/images.nix b/modules/flake-parts/images.nix index e1541673..624e4d6b 100644 --- a/modules/flake-parts/images.nix +++ b/modules/flake-parts/images.nix @@ -25,7 +25,7 @@ in options = { images = lib.mkOption { type = with lib.types; attrsOf package; - default = {}; + default = { }; description = '' An attribute set of NixOS configurations built as an image output supported by @@ -41,7 +41,7 @@ in lib.mapAttrs (k: v: v.images) (lib.filterAttrs - (k: v: v.images != {}) + (k: v: v.images != { }) config.allSystems ); diff --git a/modules/flake-parts/setups/home-manager.nix b/modules/flake-parts/setups/home-manager.nix index 11d5031f..2b4eebf1 100644 --- a/modules/flake-parts/setups/home-manager.nix +++ b/modules/flake-parts/setups/home-manager.nix @@ -73,7 +73,7 @@ let modules = lib.mkOption { type = with lib.types; listOf raw; - default = []; + default = [ ]; description = '' A list of NixOS modules specific for that host. ''; @@ -81,7 +81,7 @@ let overlays = lib.mkOption { type = with lib.types; listOf (functionTo raw); - default = []; + default = [ ]; example = lib.literalExpression '' [ inputs.neovim-nightly-overlay.overlays.default @@ -154,7 +154,7 @@ in options.setups.home-manager = { sharedModules = lib.mkOption { type = with lib.types; listOf raw; - default = []; + default = [ ]; description = '' A list of modules to be shared by all of the declarative home-manager setups. @@ -168,7 +168,7 @@ in standaloneConfigModules = lib.mkOption { type = with lib.types; listOf raw; - default = []; + default = [ ]; internal = true; description = '' A list of modules to be added alongside the shared home-manager modules @@ -182,7 +182,7 @@ in configs = lib.mkOption { type = with lib.types; attrsOf (submodule configType); - default = {}; + default = { }; description = '' An attribute set of metadata for the declarative home-manager setups. ''; @@ -208,7 +208,7 @@ in }; }; - config = lib.mkIf (cfg.configs != {}) { + config = lib.mkIf (cfg.configs != { }) { flake = let # A quick data structure we can pass through multiple build pipelines. @@ -221,14 +221,14 @@ in let name = "${username}-${system}"; in - lib.nameValuePair name (mkHome { - inherit (metadata) nixpkgs-branch home-manager-branch; - inherit system; - extraModules = - cfg.sharedModules - ++ cfg.standaloneConfigModules - ++ metadata.modules; - }) + lib.nameValuePair name (mkHome { + inherit (metadata) nixpkgs-branch home-manager-branch; + inherit system; + extraModules = + cfg.sharedModules + ++ cfg.standaloneConfigModules + ++ metadata.modules; + }) ) metadata.systems); in @@ -238,27 +238,27 @@ in cfg.configs; in { - homeConfigurations = - lib.concatMapAttrs - (name: configs: - lib.mapAttrs' - (system: config: lib.nameValuePair "${name}-${system}" config) - configs) - pureHomeManagerConfigs; + homeConfigurations = + lib.concatMapAttrs + (name: configs: + lib.mapAttrs' + (system: config: lib.nameValuePair "${name}-${system}" config) + configs) + pureHomeManagerConfigs; - deploy.nodes = - let - validConfigs = - lib.filterAttrs - (name: _: cfg.configs.${name}.deploy != null) - pureHomeManagerConfigs; - in - lib.concatMapAttrs - (name: configs: - lib.mapAttrs' - (system: config: lib.nameValuePair "home-manager-${name}-${system}" - (cfg.configs.${name}.deploy.profiles { inherit name config system; }))) - validConfigs; - }; + deploy.nodes = + let + validConfigs = + lib.filterAttrs + (name: _: cfg.configs.${name}.deploy != null) + pureHomeManagerConfigs; + in + lib.concatMapAttrs + (name: configs: + lib.mapAttrs' + (system: config: lib.nameValuePair "home-manager-${name}-${system}" + (cfg.configs.${name}.deploy.profiles { inherit name config system; }))) + validConfigs; + }; }; } diff --git a/modules/flake-parts/setups/nixos.nix b/modules/flake-parts/setups/nixos.nix index afd71f23..0fa2f2eb 100644 --- a/modules/flake-parts/setups/nixos.nix +++ b/modules/flake-parts/setups/nixos.nix @@ -46,7 +46,7 @@ let extraModules = extraModules'; }; in - image.config.system.build.${image.config.formatAttr}; + image.config.system.build.${image.config.formatAttr}; deployNodeType = { config, lib, ... }: { freeformType = with lib.types; attrsOf anything; @@ -114,7 +114,7 @@ let modules = lib.mkOption { type = with lib.types; listOf raw; - default = []; + default = [ ]; description = '' A list of NixOS modules specific for that host. ''; @@ -122,7 +122,7 @@ let overlays = lib.mkOption { type = with lib.types; listOf (functionTo raw); - default = []; + default = [ ]; example = lib.literalExpression '' [ inputs.neovim-nightly-overlay.overlays.default @@ -211,7 +211,7 @@ in options.setups.nixos = { sharedModules = lib.mkOption { type = with lib.types; listOf raw; - default = []; + default = [ ]; description = '' A list of modules to be shared by all of the declarative NixOS setups. ''; @@ -219,7 +219,7 @@ in configs = lib.mkOption { type = with lib.types; attrsOf (submodule configType); - default = {}; + default = { }; description = '' An attribute set of metadata for the declarative NixOS setups. This will then be used for related flake outputs such as @@ -273,7 +273,7 @@ in }; }; - config = lib.mkIf (cfg.configs != {}) { + config = lib.mkIf (cfg.configs != { }) { setups.nixos.sharedModules = [ { home-manager.useUserPackages = lib.mkDefault true; @@ -294,11 +294,11 @@ in lib.listToAttrs (builtins.map (system: - lib.nameValuePair system (mkHost { - nixpkgs-branch = metadata.nixpkgs-branch; - extraModules = cfg.sharedModules ++ metadata.modules; - inherit system; - }) + lib.nameValuePair system (mkHost { + nixpkgs-branch = metadata.nixpkgs-branch; + extraModules = cfg.sharedModules ++ metadata.modules; + inherit system; + }) ) metadata.systems); in @@ -337,7 +337,7 @@ in let validImages = lib.filterAttrs (host: metadata: - metadata.formats != null && (lib.elem system metadata.systems)) + metadata.formats != null && (lib.elem system metadata.systems)) cfg.configs; in lib.mapAttrs' diff --git a/modules/nixos/programs/gnome-session/submodules.nix b/modules/nixos/programs/gnome-session/submodules.nix index 3f5f45be..c657686d 100644 --- a/modules/nixos/programs/gnome-session/submodules.nix +++ b/modules/nixos/programs/gnome-session/submodules.nix @@ -389,7 +389,7 @@ rec { if (lib.elem name validDesktopNames) || (lib.hasPrefix "X-" name) then name else - "X-${name}") + "X-${name}") names; example = [ "GNOME" "Garden" ]; };