This repository was archived by the owner on Oct 12, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
71 lines (64 loc) · 2.54 KB
/
flake.nix
File metadata and controls
71 lines (64 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
description = "Flake for haskell version tracking-expenses";
inputs = {
haskellNix.url = "github:input-output-hk/haskell.nix";
nixpkgs.follows = "haskellNix/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, haskellNix, ... }:
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system:
let
overlays = [ haskellNix.overlay
(final: prev: {
# This overlay adds our project to pkgs
extraPkgconfigMappings = prev.haskell-nix.extraPkgconfigMappings // {
# String pkgconfig-depends names are mapped to lists of Nixpkgs
# package names
"z" = [ "zlib" ];
};
tracking-expenses =
final.haskell-nix.project' {
src = ./.;
compiler-nix-name = "ghc966";
# This is used by `nix develop .` to open a shell for use with
# `cabal`, `hlint` and `haskell-language-sgit@github.com:freexploit/HaskellNet-SSL.giterver`
shell.tools = {
cabal = {};
haskell-language-server = {};
};
# Non-Haskell shell tools go here
shell.buildInputs = with pkgs; [nixpkgs-fmt arion nodePackages.graphqurl zlib pkg-config graphqurl ormolu hasura-cli ];
# This adds `js-unknown-ghcjs-cabal` to the shell.
# shell.crossPlatforms = p: [p.ghcjs];
};
})
];
pkgs = import nixpkgs { inherit system overlays; inherit (haskellNix) config; };
flake = pkgs.tracking-expenses.flake {};
defaultPackage = flake.packages."tracking-expenses:exe:tracking-expenses";
in flake // {
# Built by `nix build .`
packages = {
default = defaultPackage;
container_image = pkgs.dockerTools.buildLayeredImage {
name = "tracking-expenses";
tag = "latest";
created = builtins.substring 0 8 self.lastModifiedDate;
contents = [
pkgs.dockerTools.binSh
pkgs.dockerTools.caCertificates
pkgs.dockerTools.usrBinEnv
pkgs.coreutils
pkgs.fakeNss
defaultPackage
];
config = {
Labels = {
"org.opencontainers.image.source"="https://github.com/freexploit/tracking_expenses";
};
Cmd = ["${defaultPackage}/bin/tracking-expenses"];
};
};
};
});
}