Skip to content

Commit

Permalink
Remove Unnecessary Uses of rec (#390)
Browse files Browse the repository at this point in the history
* Remove Unnecessary Uses of `rec`

* Bump sources version

---------

Co-authored-by: Nicolas Mattia <nicolas@nmattia.com>
  • Loading branch information
sivizius and nmattia committed Feb 21, 2024
1 parent 290965a commit 67b245a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
4 changes: 1 addition & 3 deletions default.nix
Expand Up @@ -3,8 +3,6 @@
}:

let
files = pkgs.callPackage ./nix/files.nix { };

sourceByRegex = name: src: regexes:
builtins.path {
filter = path: type:
Expand Down Expand Up @@ -42,7 +40,7 @@ let
];

haskellPackages = pkgs.haskellPackages.override {
overrides = self: super: rec {
overrides = self: super: {

niv =
pkgs.haskell.lib.justStaticExecutables (
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp-libosmium/nix/sources.nix
Expand Up @@ -132,7 +132,7 @@ let
{ sourcesFile ? ./sources.json
, sources ? builtins.fromJSON (builtins.readFile sourcesFile)
, pkgs ? mkPkgs sources
}: rec {
}: {
# The sources, i.e. the attribute set of spec name to spec
inherit sources;

Expand Down
2 changes: 1 addition & 1 deletion examples/cpp-libosmium/overlay/libosmium.nix
@@ -1,6 +1,6 @@
{ stdenv, cmake, protozero, expat, zlib, bzip2, boost, sources }:

stdenv.mkDerivation rec {
stdenv.mkDerivation {
name = "libosmium";
src = sources.libosmium;

Expand Down
2 changes: 1 addition & 1 deletion nix/sources.nix
Expand Up @@ -186,7 +186,7 @@ let
, sources ? if sourcesFile == null then { } else builtins.fromJSON (builtins.readFile sourcesFile)
, system ? builtins.currentSystem
, pkgs ? mkPkgs sources system
}: rec {
}: {
# The sources, i.e. the attribute set of spec name to spec
inherit sources;

Expand Down
2 changes: 1 addition & 1 deletion nix/termtosvg.nix
@@ -1,6 +1,6 @@
{ sources, lib, python3Packages }:

python3Packages.buildPythonApplication rec {
python3Packages.buildPythonApplication {
pname = "termtosvg";
version = "0.0.0";

Expand Down
4 changes: 4 additions & 0 deletions src/Niv/Sources.hs
Expand Up @@ -181,6 +181,8 @@ data SourcesNixVersion
| -- formatting fix
-- Apply statix suggestions
V28
| -- Remove unnecessary recs
V29
deriving stock (Bounded, Enum, Eq)

-- | A user friendly version
Expand Down Expand Up @@ -214,6 +216,7 @@ sourcesVersionToText = \case
V26 -> "26"
V27 -> "27"
V28 -> "28"
V29 -> "29"

latestVersionMD5 :: T.Text
latestVersionMD5 = sourcesVersionToMD5 maxBound
Expand Down Expand Up @@ -254,6 +257,7 @@ sourcesVersionToMD5 = \case
V26 -> "937bff93370a064c9000f13cec5867f9"
V27 -> "8031ba9d8fbbc7401c800d0b84278ec8"
V28 -> "26ed55356db7673935329210a4f8c4a5"
V29 -> "a8751de841ac5e0a60f4c2db7e8bbade"

-- | The MD5 sum of ./nix/sources.nix
sourcesNixMD5 :: IO T.Text
Expand Down

0 comments on commit 67b245a

Please sign in to comment.