commit 70a95412c56b2c6b7f5f2f6f303360209142c43f
parent fd94a983ed38b999e44048e18c573a4d1ef810c1
Author: Vincent Demeester <vincent@sbr.pm>
Date: Mon, 29 Jun 2020 18:06:29 +0200
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>
Diffstat:
2 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/Makefile b/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
diff --git a/nix/sources.nix b/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); }