1
1
mirror of https://github.com/nmattia/niv.git synced 2024-10-06 12:27:35 +03:00

Remove Unnecessary Uses of rec (#390)

* Remove Unnecessary Uses of `rec`

* Bump sources version

---------

Co-authored-by: Nicolas Mattia <nicolas@nmattia.com>
This commit is contained in:
Sivizius 2024-02-21 19:49:09 +01:00 committed by GitHub
parent 290965abaa
commit 67b245a356
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 9 additions and 7 deletions

View File

@ -3,8 +3,6 @@
}: }:
let let
files = pkgs.callPackage ./nix/files.nix { };
sourceByRegex = name: src: regexes: sourceByRegex = name: src: regexes:
builtins.path { builtins.path {
filter = path: type: filter = path: type:
@ -42,7 +40,7 @@ let
]; ];
haskellPackages = pkgs.haskellPackages.override { haskellPackages = pkgs.haskellPackages.override {
overrides = self: super: rec { overrides = self: super: {
niv = niv =
pkgs.haskell.lib.justStaticExecutables ( pkgs.haskell.lib.justStaticExecutables (

View File

@ -132,7 +132,7 @@ let
{ sourcesFile ? ./sources.json { sourcesFile ? ./sources.json
, sources ? builtins.fromJSON (builtins.readFile sourcesFile) , sources ? builtins.fromJSON (builtins.readFile sourcesFile)
, pkgs ? mkPkgs sources , pkgs ? mkPkgs sources
}: rec { }: {
# The sources, i.e. the attribute set of spec name to spec # The sources, i.e. the attribute set of spec name to spec
inherit sources; inherit sources;

View File

@ -1,6 +1,6 @@
{ stdenv, cmake, protozero, expat, zlib, bzip2, boost, sources }: { stdenv, cmake, protozero, expat, zlib, bzip2, boost, sources }:
stdenv.mkDerivation rec { stdenv.mkDerivation {
name = "libosmium"; name = "libosmium";
src = sources.libosmium; src = sources.libosmium;

View File

@ -186,7 +186,7 @@ let
, sources ? if sourcesFile == null then { } else builtins.fromJSON (builtins.readFile sourcesFile) , sources ? if sourcesFile == null then { } else builtins.fromJSON (builtins.readFile sourcesFile)
, system ? builtins.currentSystem , system ? builtins.currentSystem
, pkgs ? mkPkgs sources system , pkgs ? mkPkgs sources system
}: rec { }: {
# The sources, i.e. the attribute set of spec name to spec # The sources, i.e. the attribute set of spec name to spec
inherit sources; inherit sources;

View File

@ -1,6 +1,6 @@
{ sources, lib, python3Packages }: { sources, lib, python3Packages }:
python3Packages.buildPythonApplication rec { python3Packages.buildPythonApplication {
pname = "termtosvg"; pname = "termtosvg";
version = "0.0.0"; version = "0.0.0";

View File

@ -181,6 +181,8 @@ data SourcesNixVersion
| -- formatting fix | -- formatting fix
-- Apply statix suggestions -- Apply statix suggestions
V28 V28
| -- Remove unnecessary recs
V29
deriving stock (Bounded, Enum, Eq) deriving stock (Bounded, Enum, Eq)
-- | A user friendly version -- | A user friendly version
@ -214,6 +216,7 @@ sourcesVersionToText = \case
V26 -> "26" V26 -> "26"
V27 -> "27" V27 -> "27"
V28 -> "28" V28 -> "28"
V29 -> "29"
latestVersionMD5 :: T.Text latestVersionMD5 :: T.Text
latestVersionMD5 = sourcesVersionToMD5 maxBound latestVersionMD5 = sourcesVersionToMD5 maxBound
@ -254,6 +257,7 @@ sourcesVersionToMD5 = \case
V26 -> "937bff93370a064c9000f13cec5867f9" V26 -> "937bff93370a064c9000f13cec5867f9"
V27 -> "8031ba9d8fbbc7401c800d0b84278ec8" V27 -> "8031ba9d8fbbc7401c800d0b84278ec8"
V28 -> "26ed55356db7673935329210a4f8c4a5" V28 -> "26ed55356db7673935329210a4f8c4a5"
V29 -> "a8751de841ac5e0a60f4c2db7e8bbade"
-- | The MD5 sum of ./nix/sources.nix -- | The MD5 sum of ./nix/sources.nix
sourcesNixMD5 :: IO T.Text sourcesNixMD5 :: IO T.Text