From 784e4785756e0ea6f67b20afcce6a0201c4a6c9e Mon Sep 17 00:00:00 2001 From: Gautier DI FOLCO Date: Fri, 17 Nov 2023 23:26:26 +0100 Subject: [PATCH] fix(cvss): adapt nix setup --- code/cabal.project | 4 ++++ code/cvss/CHANGELOG.md | 3 +++ code/hsec-tools/cabal.project | 3 --- flake.nix | 15 +++++++++------ 4 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 code/cabal.project create mode 100644 code/cvss/CHANGELOG.md delete mode 100644 code/hsec-tools/cabal.project diff --git a/code/cabal.project b/code/cabal.project new file mode 100644 index 00000000..f056bc19 --- /dev/null +++ b/code/cabal.project @@ -0,0 +1,4 @@ +packages: */*.cabal + +package hsec-tools +package cvss diff --git a/code/cvss/CHANGELOG.md b/code/cvss/CHANGELOG.md new file mode 100644 index 00000000..9a309d74 --- /dev/null +++ b/code/cvss/CHANGELOG.md @@ -0,0 +1,3 @@ +# 0.1 + +Introduction diff --git a/code/hsec-tools/cabal.project b/code/hsec-tools/cabal.project deleted file mode 100644 index efb189c9..00000000 --- a/code/hsec-tools/cabal.project +++ /dev/null @@ -1,3 +0,0 @@ -packages: *.cabal ../cvss/cvss.cabal - -package hsec-tools diff --git a/flake.nix b/flake.nix index 9dc77944..866b0364 100644 --- a/flake.nix +++ b/flake.nix @@ -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; }; }; @@ -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 { }); }; @@ -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"; @@ -89,6 +92,6 @@ defaultPackage = self.packages.${system}.hsec-tools; # Used by `nix develop` (dev shell) - devShell = project true; + devShell = hsec-tools true; }); }