Commit 70a95412c56b

Vincent Demeester <vincent@sbr.pm>
2020-06-29 18:06:29
Makefile: update pre-commit ๐Ÿ™ƒ
- Remove update-docs (`docs/` is deprecated and we are going to use org tangle) - Fix fmt (update the folder/files formatted), and use `-` to ignore errors ๐Ÿ˜… Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent fd94a98
Changed files (2)
nix/sources.nix
@@ -1,7 +1,5 @@
 # This file has been generated by Niv.
-
 let
-
   #
   # The fetchers. fetch_<type> fetches specs of type <type>.
   #
@@ -51,20 +49,20 @@ let
   mkPkgs = sources:
     let
       sourcesNixpkgs =
-        import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) {};
+        import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { };
       hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
       hasThisAsNixpkgsPath = <nixpkgs> == ./.;
     in
-      if builtins.hasAttr "nixpkgs" sources
-      then sourcesNixpkgs
-      else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then
-        import <nixpkgs> {}
-      else
-        abort
-          ''
-            Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
-            add a package called "nixpkgs" to your sources.json.
-          '';
+    if builtins.hasAttr "nixpkgs" sources
+    then sourcesNixpkgs
+    else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then
+      import <nixpkgs> { }
+    else
+      abort
+        ''
+          Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
+          add a package called "nixpkgs" to your sources.json.
+        '';
 
   # The actual fetching function.
   fetch = pkgs: name: spec:
@@ -92,31 +90,33 @@ let
     let
       inherit (builtins) lessThan nixVersion fetchTarball;
     in
-      if lessThan nixVersion "1.12" then
-        fetchTarball { inherit url; }
-      else
-        fetchTarball attrs;
+    if lessThan nixVersion "1.12" then
+      fetchTarball { inherit url; }
+    else
+      fetchTarball attrs;
 
   # fetchurl version that is compatible between all the versions of Nix
   builtins_fetchurl = { url, sha256 }@attrs:
     let
       inherit (builtins) lessThan nixVersion fetchurl;
     in
-      if lessThan nixVersion "1.12" then
-        fetchurl { inherit url; }
-      else
-        fetchurl attrs;
+    if lessThan nixVersion "1.12" then
+      fetchurl { inherit url; }
+    else
+      fetchurl attrs;
 
   # Create the final "sources" from the config
   mkSources = config:
-    mapAttrs (
-      name: spec:
-        if builtins.hasAttr "outPath" spec
-        then abort
-          "The values in sources.json should not have an 'outPath' attribute"
-        else
-          spec // { outPath = fetch config.pkgs name spec; }
-    ) config.sources;
+    mapAttrs
+      (
+        name: spec:
+          if builtins.hasAttr "outPath" spec
+          then abort
+            "The values in sources.json should not have an 'outPath' attribute"
+          else
+            spec // { outPath = fetch config.pkgs name spec; }
+      )
+      config.sources;
 
   # The "config" used by the fetchers
   mkConfig =
@@ -131,4 +131,4 @@ let
       inherit pkgs;
     };
 in
-mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }
+mkSources (mkConfig { }) // { __functor = _: settings: mkSources (mkConfig settings); }
Makefile
@@ -65,11 +65,11 @@ install-hooks:
 	if [ -e .git ]; then nix-shell -p git --run 'git config core.hooksPath .githooks'; fi
 
 .PHONY: pre-commit
-pre-commit: README.md fmt update-docs
+pre-commit: README.md fmt
 
 .PHONY: fmt
 fmt:
-	nixpkgs-fmt *.nix lib machines modules overlays/*.nix overlays/emacs pkgs tmp tools
+	-nixpkgs-fmt *.nix nix lib overlays pkgs systems tools users
 
 # Cleaning
 .PHONY: clean