From 64f6955508b8ef11a970c325e251a9d5216548d2 Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Wed, 9 Jun 2021 01:24:05 +0900 Subject: [PATCH] Add flake.nix --- flake.lock | 42 ++++++++++++++++++++++++++++++++++++++++++ flake.nix | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..255d040 --- /dev/null +++ b/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1622445595, + "narHash": "sha256-m+JRe6Wc5OZ/mKw2bB3+Tl0ZbtyxxxfnAWln8Q5qs+Y=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "7d706970d94bc5559077eb1a6600afddcd25a7c8", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1623167903, + "narHash": "sha256-m1JHo/kfsA+wcbZeYa0Ri96MSUZ3pR5PSLFfOq3+OME=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f2f583eceb7b6ab9a7f0c9b14dfaac9d0b059a10", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5959c90 --- /dev/null +++ b/flake.nix @@ -0,0 +1,37 @@ +{ + description = "Translates a plain text description of a relational database schema to a graphical entity-relationship diagram"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + + haskellPackages = pkgs.haskellPackages; + + jailbreakUnbreak = pkg: + pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; })); + + packageName = "erd"; + in { + packages.${packageName} = + haskellPackages.callCabal2nix packageName self rec { + # Dependency overrides go here + }; + + defaultPackage = self.packages.${system}.${packageName}; + + devShell = pkgs.mkShell { + buildInputs = with haskellPackages; [ + haskell-language-server + ghcid + cabal-install + ]; + inputsFrom = builtins.attrValues self.packages.${system}; + }; + }); +}