-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
51 lines (51 loc) · 2.05 KB
/
flake.nix
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
## Use "use flake" in .envrc
## $ echo "use flake" > .envrc
{
description = "Website of Léo Colisson";
###### Inputs
inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
inputs.flake-utils.url = "github:numtide/flake-utils";
# uikit is used as a CSS framework (similar to bootstrap)
inputs.uikit-src = {
url = "github:uikit/uikit/v3.5.9";
flake = false;
};
###### Outputs
outputs = { self, nixpkgs, flake-utils, uikit-src }:
# See https://github.com/numtide/flake-utils
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
haskellPackages' = pkgs.callPackage ./hpkgs.nix { };
colissonWebsite = pkgs.callPackage ./website.nix {
# We need to add some libraries, including uikit (bootstrap-like css framework)
# linkFarm creates a folder with a subfolder uikit pointing to the sources of uikit.
sassLoadPath = [{
name = "uikit";
path = "${uikit-src}";
}];
haskellPackages = haskellPackages';
};
in
rec {
# Packages that are created by this lib
# It is what "nix build .#name" will compile
# For example "nix build .#mysatsolver"
packages = flake-utils.lib.flattenTree { inherit colissonWebsite; };
# What package "nix build ." will compile by default:
defaultPackage = colissonWebsite.colissonStaticWebsite;
# The apps can be run directly via "nix run .#name-of-the-app"
# Example: "nix run .#mysatsolver"
apps.colissonExecutable = flake-utils.lib.mkApp {
drv = packages.colissonExecutable;
# Customize the path of the binary to run
exePath = "/bin/site";
};
# What "nix run ." will run by default (you can give arguments like
# "nix run . -- my args goes here")
defaultApp = apps.colissonExecutable;
# Run the shell with "nix develop"
devShell = colissonWebsite.shell;
});
}