aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Dybiec <pawel@dybiec.info>2023-10-02 19:13:56 +0100
committerPaweł Dybiec <pawel@dybiec.info>2023-10-02 19:13:56 +0100
commitba05edc9e66321e28346ddde393956469c76b8d8 (patch)
tree81029894908ea7080d5d892aceb280b70bfa336f
parentYearly update (diff)
Flakeify
-rw-r--r--default.nix11
-rw-r--r--dybiec-info.cabal2
-rw-r--r--flake.lock60
-rw-r--r--flake.nix45
-rw-r--r--release.nix4
5 files changed, 106 insertions, 16 deletions
diff --git a/default.nix b/default.nix
deleted file mode 100644
index 37bc31f..0000000
--- a/default.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{ mkDerivation, base, hakyll, lib }:
-mkDerivation {
- pname = "dybiec-info";
- version = "0.1.0.0";
- src = ./.;
- isLibrary = false;
- isExecutable = true;
- executableHaskellDepends = [ base hakyll ];
- license = "unknown";
- mainProgram = "site";
-}
diff --git a/dybiec-info.cabal b/dybiec-info.cabal
index 5447fdb..7c2eac3 100644
--- a/dybiec-info.cabal
+++ b/dybiec-info.cabal
@@ -11,5 +11,5 @@ homepage: https://git.dybiec.info/website
executable site
main-is: site.hs
build-depends: base == 4.*
- , hakyll == 4.15.*
+ , hakyll == 4.16.*
ghc-options: -threaded
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..6a88238
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,60 @@
+{
+ "nodes": {
+ "flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
+ "locked": {
+ "lastModified": 1692799911,
+ "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1692976428,
+ "narHash": "sha256-uefE4anjrZewcXqT9gbvbbLgEaKtuNdJPg8/MZSEUmA=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "9ce6dcf311dfdb3ce2d8181e9e0bd0c7db71148b",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "nixpkgs": "nixpkgs"
+ }
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..952ae3f
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,45 @@
+# SPDX-FileCopyrightText: 2021 Serokell <https://serokell.io/>
+#
+# SPDX-License-Identifier: CC0-1.0
+
+{
+ description = "My haskell application";
+
+ 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 = "dybiec-info";
+ in
+ {
+ packages.${packageName} =
+ haskellPackages.callCabal2nix packageName self rec {
+
+ # Dependency overrides go here
+ };
+
+ packages.default = self.packages.${system}.${packageName};
+ defaultPackage = self.packages.${system}.default;
+
+ devShells.default = pkgs.mkShell {
+ buildInputs = with pkgs; [
+ haskellPackages.haskell-language-server # you must build it with your ghc to work
+ ghcid
+ cabal-install
+ ];
+ inputsFrom = map (__getAttr "env") (__attrValues self.packages.${system});
+ };
+ devShell = self.devShells.${system}.default;
+ });
+}
diff --git a/release.nix b/release.nix
deleted file mode 100644
index d993916..0000000
--- a/release.nix
+++ /dev/null
@@ -1,4 +0,0 @@
-let
- pkgs = import <nixpkgs> { };
-in
- pkgs.haskellPackages.callPackage ./default.nix { }