From c0fd2b96a5288a2d11b92a34717c0ac82a1b633e Mon Sep 17 00:00:00 2001 From: Martin Puppe Date: Sat, 31 Jul 2021 16:58:29 +0200 Subject: [PATCH] Formatting (nixfmt) --- default.nix | 13 ++++--------- dist.nix | 9 +++------ helpers.nix | 6 +++--- meta.nix | 14 +++++++------- module.nix | 5 ++--- shell.nix | 26 +++++++++++++------------- 6 files changed, 32 insertions(+), 41 deletions(-) diff --git a/default.nix b/default.nix index 2d6c28f..09c4ee8 100644 --- a/default.nix +++ b/default.nix @@ -1,13 +1,8 @@ -{pkgs ? import { - inherit system; -}, system ? builtins.currentSystem}: +{ pkgs ? import { inherit system; }, system ? builtins.currentSystem +}: -let - derivations = import ./node2nix.nix { - inherit pkgs system; - }; -in -derivations // { +let derivations = import ./node2nix.nix { inherit pkgs system; }; +in derivations // { package = derivations.package.overrideAttrs (oldAttrs: rec { # Puppeteer (a dependency for testing) would try to download Chromium # during installation. Downloading Chromium would not work though because diff --git a/dist.nix b/dist.nix index 1cd2c03..efbae55 100644 --- a/dist.nix +++ b/dist.nix @@ -1,14 +1,11 @@ -{pkgs ? import { - inherit system; -}, system ? builtins.currentSystem}: +{ pkgs ? import { inherit system; }, system ? builtins.currentSystem +}: let financier = (import ./default.nix { inherit pkgs system; }).package; meta = import ./meta.nix; -in - -pkgs.stdenv.mkDerivation { +in pkgs.stdenv.mkDerivation { inherit (meta) version; pname = "financier-dist"; src = "${financier}/lib/node_modules/financier"; diff --git a/helpers.nix b/helpers.nix index 2b6030e..c109e48 100644 --- a/helpers.nix +++ b/helpers.nix @@ -1,4 +1,4 @@ { - fetchFinancier = { fetchgit, meta ? import ./meta.nix }: - fetchgit { inherit (meta) url rev sha256; }; -} \ No newline at end of file + fetchFinancier = { fetchgit, meta ? import ./meta.nix }: + fetchgit { inherit (meta) url rev sha256; }; +} diff --git a/meta.nix b/meta.nix index c297a57..142267b 100644 --- a/meta.nix +++ b/meta.nix @@ -1,9 +1,9 @@ rec { - version = "1.7.3"; - nodeVersion = "12"; + version = "1.7.3"; + nodeVersion = "12"; - # Arguments for fetchgit - url = "https://gitlab.com/mpuppe/financier.git"; - rev = "83367cae265af4a036a05766c6f80ea22d1cc1ec"; - sha256 = "0h7222j9fk4b3fkc7c6gbhl0xranpl5swapkwibb0aba0g6fykfg"; -} \ No newline at end of file + # Arguments for fetchgit + url = "https://gitlab.com/mpuppe/financier.git"; + rev = "83367cae265af4a036a05766c6f80ea22d1cc1ec"; + sha256 = "0h7222j9fk4b3fkc7c6gbhl0xranpl5swapkwibb0aba0g6fykfg"; +} diff --git a/module.nix b/module.nix index 9fb1661..5d421ee 100644 --- a/module.nix +++ b/module.nix @@ -3,9 +3,8 @@ with lib; let cfg = config.services.financier; financier-dist = import ./dist.nix { inherit pkgs system; }; -in -{ - imports = []; +in { + imports = [ ]; options.services.financier = { enable = mkEnableOption "Financier"; diff --git a/shell.nix b/shell.nix index 58e59c0..87bf638 100644 --- a/shell.nix +++ b/shell.nix @@ -1,14 +1,14 @@ -{ pkgs ? import {} }: +{ pkgs ? import { } }: let - meta = import ./meta.nix; - src = (import ./helpers.nix).fetchFinancier { inherit (pkgs) fetchgit; inherit meta; }; -in -pkgs.mkShell { - shellHook = '' - export FINANCIER_SRC="${src}" - export FINANCIER_NODE_VERSION="${meta.nodeVersion}" - ''; - buildInputs = with pkgs; [ - nodePackages.node2nix - ]; -} \ No newline at end of file + meta = import ./meta.nix; + src = (import ./helpers.nix).fetchFinancier { + inherit (pkgs) fetchgit; + inherit meta; + }; +in pkgs.mkShell { + shellHook = '' + export FINANCIER_SRC="${src}" + export FINANCIER_NODE_VERSION="${meta.nodeVersion}" + ''; + buildInputs = with pkgs; [ nodePackages.node2nix ]; +}