From d95050a7c2219e94c902231b954279f634f5bb7d Mon Sep 17 00:00:00 2001 From: Andrei Dziahel Date: Wed, 13 Dec 2023 17:31:14 +0100 Subject: [PATCH] nix: nix flake init 'srid/haskell-flake' --- flake.lock | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 70 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 167 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000000..5716f90226 --- /dev/null +++ b/flake.lock @@ -0,0 +1,97 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1701473968, + "narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "haskell-flake": { + "locked": { + "lastModified": 1701214938, + "narHash": "sha256-25PiqJK6iSX0CPZghcUCGCEvU9uMSNbCJ772NComipY=", + "owner": "srid", + "repo": "haskell-flake", + "rev": "abea026d35df050c27163f5193f96ef3a8b4ea6a", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "haskell-flake", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1679734080, + "narHash": "sha256-z846xfGLlon6t9lqUzlNtBOmsgQLQIZvR6Lt2dImk1M=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "dbf5322e93bcc6cfc52268367a8ad21c09d76fea", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "rev": "dbf5322e93bcc6cfc52268367a8ad21c09d76fea", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1701253981, + "narHash": "sha256-ztaDIyZ7HrTAfEEUt9AtTDNoCYxUdSd6NrRHaYOIxtk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e92039b55bcd58469325ded85d4f58dd5a4eaf58", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "postgresql-libpq": { + "flake": false, + "locked": { + "lastModified": 1672392728, + "narHash": "sha256-oDnnbUl/Hle2O3VpjKDVxXU881Tkhgs58iRMMBuFvvI=", + "owner": "postgrest", + "repo": "postgresql-libpq", + "rev": "890a0a16cf57dd401420fdc6c7d576fb696003bc", + "type": "github" + }, + "original": { + "owner": "postgrest", + "repo": "postgresql-libpq", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "haskell-flake": "haskell-flake", + "nixpkgs": "nixpkgs", + "postgresql-libpq": "postgresql-libpq" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000000..bdf983989b --- /dev/null +++ b/flake.nix @@ -0,0 +1,70 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/dbf5322e93bcc6cfc52268367a8ad21c09d76fea"; + flake-parts.url = "github:hercules-ci/flake-parts"; + haskell-flake.url = "github:srid/haskell-flake"; + postgresql-libpq = { + url = "github:postgrest/postgresql-libpq"; + flake = false; + }; + }; + outputs = inputs@{ self, nixpkgs, flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = nixpkgs.lib.systems.flakeExposed; + imports = [ inputs.haskell-flake.flakeModule ]; + + perSystem = { self', pkgs, ... }: { + + # Typically, you just want a single project named "default". But + # multiple projects are also possible, each using different GHC version. + haskellProjects.default = { + # The base package set representing a specific GHC version. + # By default, this is pkgs.haskellPackages. + # You may also create your own. See https://community.flake.parts/haskell-flake/package-set + # basePackages = pkgs.haskellPackages; + + # Extra package information. See https://community.flake.parts/haskell-flake/dependency + # + # Note that local packages are automatically included in `packages` + # (defined by `defaults.packages` option). + # + # packages = { + # aeson.source = "1.5.0.0"; # Hackage version override + # shower.source = inputs.shower; + # }; + # settings = { + # aeson = { + # check = false; + # }; + # relude = { + # haddock = false; + # broken = false; + # }; + # }; + packages = { + hasql-notifications.source = "0.2.0.6"; + hasql-pool.source = "0.10"; + postgrest = inputs.postgresql-libpq; + }; + settings = { + configurator-pg.broken = false; + fuzzyset.broken = false; + }; + + # devShell = { + # # Enabled by default + # enable = true; + # + # # Programs you want to make available in the shell. + # # Default programs can be disabled by setting to 'null' + # tools = hp: { fourmolu = hp.fourmolu; ghcid = null; }; + # + # hlsCheck.enable = true; + # }; + }; + + # haskell-flake doesn't set the default package, but you can do it here. + packages.default = self'.packages.postgrest; + }; + }; +}