Skip to content

Commit

Permalink
fix(cvss): adapt nix setup
Browse files Browse the repository at this point in the history
  • Loading branch information
blackheaven committed Nov 17, 2023
1 parent 30ba2a2 commit 784e478
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
4 changes: 4 additions & 0 deletions code/cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
packages: */*.cabal

package hsec-tools
package cvss
3 changes: 3 additions & 0 deletions code/cvss/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 0.1

Introduction
3 changes: 0 additions & 3 deletions code/hsec-tools/cabal.project

This file was deleted.

15 changes: 9 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
toml-parser = {
url = github:glguy/toml-parser/eb7222d9d71aa00d0a37f85ff4cdef89d1ba743d; # v1.3.0.0
url = "github:glguy/toml-parser/eb7222d9d71aa00d0a37f85ff4cdef89d1ba743d"; # v1.3.0.0
flake = false;
};
};
Expand All @@ -19,13 +19,16 @@
jailbreakUnbreak = pkg:
pkgs.haskell.lib.doJailbreak (pkgs.haskell.lib.dontCheck (pkgs.haskell.lib.unmarkBroken pkg));

project = returnShellEnv:
cvss = pkgs.haskellPackages.callCabal2nix "cvss" ./code/cvss {};

hsec-tools = returnShellEnv:
pkgs.haskellPackages.developPackage {
inherit returnShellEnv;
name = "hsec-tools";
root = ./code/hsec-tools;
withHoogle = false;
overrides = self: super: with pkgs.haskell.lib; {
overrides = self: super: {
inherit cvss;
Cabal-syntax = super.Cabal-syntax_3_8_1_0;
toml-parser = jailbreakUnbreak (super.callCabal2nix "toml-parser" toml-parser { });
};
Expand All @@ -52,8 +55,8 @@
};
in
{

packages.hsec-tools = pkgs.haskell.lib.justStaticExecutables (project false);
packages.cvss = cvss;
packages.hsec-tools = pkgs.haskell.lib.justStaticExecutables (hsec-tools false);
packages.hsec-tools-image =
pkgs.dockerTools.buildImage {
name = "haskell/hsec-tools";
Expand Down Expand Up @@ -89,6 +92,6 @@
defaultPackage = self.packages.${system}.hsec-tools;

# Used by `nix develop` (dev shell)
devShell = project true;
devShell = hsec-tools true;
});
}

0 comments on commit 784e478

Please sign in to comment.