Skip to content

Commit bc01cc7

Browse files
authored
Migrate to 1.2 (#14)
1 parent eb740d2 commit bc01cc7

File tree

6 files changed

+58
-68
lines changed

6 files changed

+58
-68
lines changed

.ghci

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
:set -XNoImplicitPrelude
2-
:def source readFile
3-
:source build/ihp-lib/applicationGhciConfig
4-
import IHP.Prelude
2+
:def loadFromIHP \file -> (System.Environment.getEnv "IHP_LIB") >>= (\ihpLib -> readFile (ihpLib <> "/" <> file))
3+
:loadFromIHP applicationGhciConfig
4+
import IHP.Prelude

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ del
1818
static/prod.*
1919
Config/client_session_key.aes
2020

21+
2122
# Ignore locally checked out IHP version
2223
IHP
24+
.devenv*
25+
devenv.local.nix
26+
.direnv
27+
.env
2328
static/app.css

Makefile

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
ifneq ($(wildcard IHP/.*),)
2-
IHP = IHP/lib/IHP
3-
else
4-
IHP = $(shell dirname $$(which RunDevServer))/../lib/IHP
5-
endif
6-
71
# CSS_FILES += ${IHP}/static/vendor/bootstrap.min.css
82
CSS_FILES += ${IHP}/static/vendor/flatpickr.min.css
93
CSS_FILES += static/app.css

default.nix

+9-28
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,9 @@
1-
let
2-
ihp = builtins.fetchGit {
3-
url = "https://github.com/digitallyinduced/ihp.git";
4-
ref = "refs/tags/v1.0.1";
5-
# If changing to a specific `rev` Execute:
6-
# nix-shell --run 'make build/ihp-lib's
7-
# rev = "05f1eafbe897dfdbf8a77e5bd0673b1857f4e8c2";
8-
};
9-
haskellEnv = import "${ihp}/NixSupport/default.nix" {
10-
ihp = ihp;
11-
haskellDeps = p: with p; [
12-
cabal-install
13-
base
14-
wai
15-
text
16-
hlint
17-
p.ihp
18-
];
19-
otherDeps = p: with p; [
20-
# Native dependencies, e.g. imagemagick
21-
nodejs
22-
# For testing concurrent requests.
23-
parallel
24-
];
25-
projectPath = ./.;
26-
};
27-
in
28-
haskellEnv
1+
# For backwards compatibility using flake.nix
2+
(import
3+
(
4+
fetchTarball {
5+
url = "https://github.com/edolstra/flake-compat/archive/35bb57c0c8d8b62bbfd284272c928ceb64ddbde9.tar.gz";
6+
sha256 = "sha256:1prd9b1xx8c0sfwnyzkspplh30m613j42l1k789s521f4kv4c2z2";
7+
}
8+
)
9+
{ src = ./.; }).defaultNix

flake.nix

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
inputs = {
3+
# Here you can adjust the IHP version of your project
4+
# You can find new releases at https://github.com/digitallyinduced/ihp/releases
5+
ihp.url = "github:digitallyinduced/ihp/v1.2";
6+
nixpkgs.follows = "ihp/nixpkgs";
7+
flake-parts.follows = "ihp/flake-parts";
8+
devenv.follows = "ihp/devenv";
9+
systems.follows = "ihp/systems";
10+
};
11+
12+
outputs = inputs@{ ihp, flake-parts, systems, ... }:
13+
flake-parts.lib.mkFlake { inherit inputs; } {
14+
15+
systems = import systems;
16+
imports = [ ihp.flakeModules.default ];
17+
18+
perSystem = { pkgs, ... }: {
19+
ihp = {
20+
enable = true;
21+
projectPath = ./.;
22+
packages = with pkgs; [
23+
# Native dependencies, e.g. imagemagick
24+
nodejs
25+
# For testing concurrent requests.
26+
parallel
27+
];
28+
haskellPackages = p: with p; [
29+
# Haskell dependencies go here
30+
p.ihp
31+
cabal-install
32+
base
33+
wai
34+
text
35+
hlint
36+
];
37+
};
38+
};
39+
40+
};
41+
}

start

-31
This file was deleted.

0 commit comments

Comments
 (0)