-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.nix
More file actions
66 lines (56 loc) · 1.76 KB
/
default.nix
File metadata and controls
66 lines (56 loc) · 1.76 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
{ nixpkgs ? null }:
# This is an example of what downstream consumers of ainglenix should do
# This is also used to dogfood as many commands as possible for ainglenix
# For example the release process for ainglenix uses this file
let
# point this to your local config.nix file for this project
# example.config.nix shows and documents a lot of the options
config = import ./config.nix;
# START AINIX IMPORT BOILERPLATE
ainglenixPath = config.ainglenix.pathFn {};
ainglenix = config.ainglenix.importFn {};
# END AINIX IMPORT BOILERPLATE
overlays = [
(self: super: {
inherit ainglenix ainglenixPath;
aiToplevelDir = builtins.toString ./.;
nixEnvPrefixEval = ''
if [[ -n "$NIX_ENV_PREFIX" ]]; then
# don't touch it
:
elif test -d "${builtins.toString self.aiToplevelDir}" &&
test -w "${builtins.toString self.aiToplevelDir}"; then
export NIX_ENV_PREFIX="${builtins.toString self.aiToplevelDir}"
elif test -d "$HOME" && test -w "$HOME"; then
export NIX_ENV_PREFIX="$HOME/.cache/aingle-dev"
mkdir -p "$NIX_ENV_PREFIX"
else
export NIX_ENV_PREFIX="$(${self.coreutils}/bin/mktemp -d)"
fi
'';
inherit (ainglenix.pkgs.callPackage ./nix/rust.nix { }) aiRustPlatform;
})
];
nixpkgs' = import (nixpkgs.path or ainglenix.pkgs.path) { inherit overlays; };
inherit (nixpkgs') callPackage;
pkgs = callPackage ./nix/pkgs/default.nix { };
in
{
inherit
ainglenix
pkgs
;
# TODO: refactor when we start releasing again
# releaseHooks = callPackages ./nix/release {
# inherit
# config
# nixpkgs
# ;
# };
shells = callPackage ./nix/shells.nix {
inherit
ainglenix
pkgs
;
};
}