diff --git a/ci.nix b/ci.nix index 8917988..b8ab27b 100644 --- a/ci.nix +++ b/ci.nix @@ -5,7 +5,7 @@ with import { }; with lib; let - pkgs = (import ./pkgs {}) // { recurseForDerivations = true; }; + pkgs = (import ./pkgs { }) // { recurseForDerivations = true; }; isCacheable = p: !(p.preferLocalBuild or false); shouldRecurseForDerivations = p: isAttrs p && p.recurseForDerivations or false; @@ -16,7 +16,7 @@ let else if isDerivation p then [ p ] else [ ]; in - concatMap f (attrValues s); + concatMap f (attrValues s); cachePkgs = filter isCacheable (flattenPkgs pkgs); diff --git a/modules/build/activation.nix b/modules/build/activation.nix index ca864e4..7ea6940 100644 --- a/modules/build/activation.nix +++ b/modules/build/activation.nix @@ -18,15 +18,17 @@ let pkgs.findutils pkgs.gnugrep pkgs.gnused - pkgs.ncurses # For `tput`. + pkgs.ncurses # For `tput`. config.nix.package ]; mkActivationCmds = activation: concatStringsSep "\n" ( - mapAttrsToList (name: value: '' - noteEcho "Activating ${name}" - ${value} - '') activation + mapAttrsToList + (name: value: '' + noteEcho "Activating ${name}" + ${value} + '') + activation ); activationScript = pkgs.writeScript "activation-script" '' @@ -79,7 +81,7 @@ in build = { activation = mkOption { - default = {}; + default = { }; type = types.attrs; description = '' Activation scripts for the nix-on-droid environment. @@ -87,7 +89,7 @@ in }; activationBefore = mkOption { - default = {}; + default = { }; type = types.attrs; description = '' Activation scripts for the nix-on-droid environment that @@ -96,7 +98,7 @@ in }; activationAfter = mkOption { - default = {}; + default = { }; type = types.attrs; description = '' Activation scripts for the nix-on-droid environment that diff --git a/modules/build/config.nix b/modules/build/config.nix index e0a1e8e..276ec85 100644 --- a/modules/build/config.nix +++ b/modules/build/config.nix @@ -38,7 +38,7 @@ with lib; extraProotOptions = mkOption { type = types.listOf types.string; - default = []; + default = [ ]; description = "Extra options passed to proot, e.g., extra bind mounts."; }; }; diff --git a/modules/default.nix b/modules/default.nix index 3a78ef3..e5367bd 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -14,9 +14,9 @@ let defaultConfigFile = "${builtins.getEnv "HOME"}/.config/nixpkgs/nix-on-droid.nix"; configModule = - if config != null then config + if config != null then config else if builtins.pathExists defaultConfigFile then defaultConfigFile - else if pkgs.config ? nix-on-droid then pkgs.config.nix-on-droid + else if pkgs.config ? nix-on-droid then pkgs.config.nix-on-droid else throw "No config file found! Create one in ~/.config/nixpkgs/nix-on-droid.nix"; rawModule = evalModules { @@ -38,7 +38,7 @@ let failedAssertions = map (x: x.message) (filter (x: !x.assertion) rawModule.config.assertions); module = - if failedAssertions != [] + if failedAssertions != [ ] then throw "\nFailed assertions:\n${concatMapStringsSep "\n" (x: "- ${x}") failedAssertions}" else showWarnings rawModule.config.warnings rawModule; in diff --git a/modules/environment/ca.nix b/modules/environment/ca.nix index 09b6417..2d6b0b7 100644 --- a/modules/environment/ca.nix +++ b/modules/environment/ca.nix @@ -12,9 +12,7 @@ in ###### interface - options = { - - }; + options = { }; ###### implementation diff --git a/modules/environment/etc/default.nix b/modules/environment/etc/default.nix index fb1fbee..447ecda 100644 --- a/modules/environment/etc/default.nix +++ b/modules/environment/etc/default.nix @@ -19,7 +19,7 @@ let targets = map (x: x.target) etc'; }; - fileType = types.submodule ( + fileType = types.submodule ( { name, config, ... }: { options = { @@ -58,7 +58,8 @@ let target = mkDefault name; source = mkIf (config.text != null) ( let name' = "etc-" + baseNameOf name; - in mkDefault (pkgs.writeText name' config.text)); + in mkDefault (pkgs.writeText name' config.text) + ); }; } @@ -74,7 +75,7 @@ in environment = { etc = mkOption { type = types.loaOf fileType; - default = {}; + default = { }; example = literalExample '' { example-configuration-file = { diff --git a/modules/environment/networking.nix b/modules/environment/networking.nix index a0f8f70..61a46cc 100644 --- a/modules/environment/networking.nix +++ b/modules/environment/networking.nix @@ -8,9 +8,7 @@ with lib; ###### interface - options = { - - }; + options = { }; ###### implementation diff --git a/modules/environment/nix.nix b/modules/environment/nix.nix index 57983e3..9c82558 100644 --- a/modules/environment/nix.nix +++ b/modules/environment/nix.nix @@ -39,7 +39,7 @@ in nixPath = mkOption { type = types.listOf types.str; - default = []; + default = [ ]; description = '' The default Nix expression search path, used by the Nix evaluator to look up paths enclosed in angle brackets @@ -108,7 +108,7 @@ in substituters = mkOption { type = types.listOf types.str; - default = []; + default = [ ]; description = '' A list of URLs of substituters. The official NixOS and nix-on-droid substituters are added by default. @@ -117,7 +117,7 @@ in trustedPublicKeys = mkOption { type = types.listOf types.str; - default = []; + default = [ ]; description = '' A list of public keys. When paths are copied from another Nix store (such as a binary cache), they must be signed with one of these keys. The official NixOS @@ -165,7 +165,7 @@ in }; } - (mkIf (cfg.nixPath != []) { + (mkIf (cfg.nixPath != [ ]) { environment.sessionVariables.NIX_PATH = concatStringsSep ":" cfg.nixPath; }) ]; diff --git a/modules/environment/path.nix b/modules/environment/path.nix index 0c0df0f..c987e90 100644 --- a/modules/environment/path.nix +++ b/modules/environment/path.nix @@ -17,7 +17,7 @@ in environment = { packages = mkOption { type = types.listOf types.package; - default = []; + default = [ ]; description = "List of packages to be installed as user packages."; }; @@ -46,7 +46,7 @@ in pkgs.bashInteractive pkgs.cacert pkgs.coreutils - pkgs.less # since nix tools really want a pager available, #27 + pkgs.less # since nix tools really want a pager available, #27 config.nix.package ]; diff --git a/modules/environment/session-init.nix b/modules/environment/session-init.nix index 7ab1776..b726909 100644 --- a/modules/environment/session-init.nix +++ b/modules/environment/session-init.nix @@ -50,7 +50,7 @@ in options = { environment.sessionVariables = mkOption { - default = {}; + default = { }; type = types.attrs; example = { EDITOR = "emacs"; GS_OPTIONS = "-sPAPERSIZE=a4"; }; description = '' diff --git a/modules/environment/shell.nix b/modules/environment/shell.nix index d79c95c..b899e4f 100644 --- a/modules/environment/shell.nix +++ b/modules/environment/shell.nix @@ -8,9 +8,7 @@ with lib; ###### interface - options = { - - }; + options = { }; ###### implementation diff --git a/modules/home-manager.nix b/modules/home-manager.nix index c0b9267..de8b92c 100644 --- a/modules/home-manager.nix +++ b/modules/home-manager.nix @@ -66,7 +66,7 @@ in sharedModules = mkOption { type = with types; - # TODO: use types.raw once this PR is merged: https://github.com/NixOS/nixpkgs/pull/132448 + # TODO: use types.raw once this PR is merged: https://github.com/NixOS/nixpkgs/pull/132448 listOf (mkOptionType { name = "submodule"; inherit (submodule { }) check; diff --git a/modules/nixpkgs/options.nix b/modules/nixpkgs/options.nix index f23ad6c..cffb9da 100644 --- a/modules/nixpkgs/options.nix +++ b/modules/nixpkgs/options.nix @@ -28,23 +28,25 @@ let optionalAttrs (lhs ? packageOverrides) { packageOverrides = pkgs: optCall lhs.packageOverrides pkgs // - optCall (attrByPath ["packageOverrides"] ({}) rhs) pkgs; + optCall (attrByPath [ "packageOverrides" ] ({ }) rhs) pkgs; } // optionalAttrs (lhs ? perlPackageOverrides) { perlPackageOverrides = pkgs: optCall lhs.perlPackageOverrides pkgs // - optCall (attrByPath ["perlPackageOverrides"] ({}) rhs) pkgs; + optCall (attrByPath [ "perlPackageOverrides" ] ({ }) rhs) pkgs; }; configType = mkOptionType { name = "nixpkgs-config"; description = "nixpkgs config"; check = x: - let traceXIfNot = c: - if c x then true - else lib.traceSeqN 1 x false; - in traceXIfNot isConfig; - merge = args: fold (def: mergeConfig def.value) {}; + let + traceXIfNot = c: + if c x then true + else lib.traceSeqN 1 x false; + in + traceXIfNot isConfig; + merge = args: fold (def: mergeConfig def.value) { }; }; overlayType = mkOptionType { @@ -161,7 +163,7 @@ in assertions = [ { - assertion = isFlake -> config.nixpkgs.config == null && (config.nixpkgs.overlays == null || config.nixpkgs.overlays == []); + assertion = isFlake -> config.nixpkgs.config == null && (config.nixpkgs.overlays == null || config.nixpkgs.overlays == [ ]); message = "In a flake setup, the options nixpkgs.* should not be used. Instead, rely on the provided flake " + "outputs and pass in the necessary nixpkgs object."; } diff --git a/modules/time.nix b/modules/time.nix index d36572c..67ef512 100644 --- a/modules/time.nix +++ b/modules/time.nix @@ -13,7 +13,7 @@ let cfg = config.time; tzdir = "${pkgs.tzdata}/share/zoneinfo"; - nospace = str: filter (c: c == " ") (stringToCharacters str) == []; + nospace = str: filter (c: c == " ") (stringToCharacters str) == [ ]; timezoneType = types.nullOr (types.addCheck types.str nospace) // { description = "null or string without spaces"; }; in diff --git a/modules/user.nix b/modules/user.nix index 6735cf7..ac80d80 100644 --- a/modules/user.nix +++ b/modules/user.nix @@ -7,7 +7,7 @@ with lib; let cfg = config.user; - idsDerivation = pkgs.runCommandLocal "ids.nix" {} '' + idsDerivation = pkgs.runCommandLocal "ids.nix" { } '' cat > $out <