From 5efd50132edb72365d30347092371ab11d9355dd Mon Sep 17 00:00:00 2001 From: Malte Brandy Date: Thu, 2 Jun 2022 01:48:00 +0200 Subject: [PATCH] bump nixpkgs version --- Main.hs | 5 ++--- default.nix | 3 ++- nix/sources.json | 6 +++--- nix/sources.nix | 22 +++++++++++++++++++++- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Main.hs b/Main.hs index 6601dbdf..96c18fe0 100644 --- a/Main.hs +++ b/Main.hs @@ -16,7 +16,7 @@ import qualified Data.Time.Format as T import Relude hiding ( intercalate , zip ) -import System.Environment ( getArgs ) +import System.Environment () import System.FilePattern.Directory ( getDirectoryFiles ) import Text.Atom.Feed import Text.Atom.Feed.Export ( textFeed ) @@ -101,8 +101,7 @@ logFolder = "/home/maralorn/logs/" main :: IO () main = do now <- T.getCurrentTime - let getFiles = \t p -> - L.groupSortOn (\x -> (channel x, server x)) + let getFiles t p = L.groupSortOn (\x -> (channel x, server x)) . mapMaybe ((\x -> MP.parseMaybe (p x) x) . toText) <$> getDirectoryFiles (toString logFolder) diff --git a/default.nix b/default.nix index cad05055..7ebbb4d9 100644 --- a/default.nix +++ b/default.nix @@ -1,2 +1,3 @@ { pkgs ? import (import nix/sources.nix).nixpkgs {} }: -pkgs.haskellPackages.callCabal2nix "logfeed" ./. {} +with pkgs; with haskell.lib; with haskellPackages; +callCabal2nix "logfeed" ./. { purebred-email = doJailbreak (unmarkBroken (dontCheck purebred-email)); } diff --git a/nix/sources.json b/nix/sources.json index eea3facd..eadbed21 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": "", "owner": "NixOS", "repo": "nixpkgs", - "rev": "20887e4bbfdae3aed6bfa1f53ddf138ee325515e", - "sha256": "0hc79sv59appb7bynz5bzyqvrapyjdq63s79i649vxl93504kmnv", + "rev": "f1c167688a6f81f4a51ab542e5f476c8c595e457", + "sha256": "00ac3axj7jdfcajj3macdydf9w9bvqqvgrqkh1xxr3rfi9q2fz1v", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/20887e4bbfdae3aed6bfa1f53ddf138ee325515e.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/f1c167688a6f81f4a51ab542e5f476c8c595e457.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } } diff --git a/nix/sources.nix b/nix/sources.nix index 1938409d..9a01c8ac 100644 --- a/nix/sources.nix +++ b/nix/sources.nix @@ -31,8 +31,28 @@ let if spec ? branch then "refs/heads/${spec.branch}" else if spec ? tag then "refs/tags/${spec.tag}" else abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; + submodules = if spec ? submodules then spec.submodules else false; + submoduleArg = + let + nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0; + emptyArgWithWarning = + if submodules == true + then + builtins.trace + ( + "The niv input \"${name}\" uses submodules " + + "but your nix's (${builtins.nixVersion}) builtins.fetchGit " + + "does not support them" + ) + {} + else {}; + in + if nixSupportsSubmodules + then { inherit submodules; } + else emptyArgWithWarning; in - builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; }; + builtins.fetchGit + ({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg); fetch_local = spec: spec.path;