-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathflake.nix
61 lines (58 loc) · 1.94 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
52
53
54
55
56
57
58
59
60
61
{
inputs = {
lifesaver.url = "github:slice/lifesaver/nine-nines";
nix-filter.url = "github:numtide/nix-filter";
nixpkgs.follows = "lifesaver/nixpkgs";
};
outputs = { lifesaver, flake-utils, nix-filter, nixpkgs, ... }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in (pkgs.lib.attrsets.recursiveUpdate (lifesaver.lib.${system}.mkFlake
({ python, pkgs, ... }: {
name = "dogbot";
path = ./.;
propagatedBuildInputs = with python.pkgs; [
asyncpg
hypercorn
(python.pkgs.callPackage ./nix/quart.nix { })
python-dateutil
geopy
pillow
timezonefinder
];
pythonPackageOptions.format = "pyproject";
hardConfig = {
bot_class = "dog.bot:Dogbot";
config_class = "dog.config:DogConfig";
extensions_path = "./dog/ext";
};
loadList = [
"dog.ext.admin"
"dog.ext.gatekeeper"
"dog.ext.info"
"dog.ext.mod"
"dog.ext.profile"
"dog.ext.quoting"
"dog.ext.shortlinks"
"dog.ext.time"
"dog.ext.utility"
];
})) {
packages.web = nixpkgs.legacyPackages.${system}.buildNpmPackage rec {
name = "dogbot-web";
version = "0.0.0";
npmDepsHash = "sha256-t903c1mov02Pec7p/IGsSlIOHlN36aaCBllGxcD/4ao=";
postInstall = ''
echo "replacing $out with create-react-app build artifacts"
mv -v $out/lib/node_modules/dogbot-web/build/* $out/
echo "removing $out/lib"
rm -r $out/lib
'';
src = nix-filter.lib {
root = ./web;
include =
[ "src" "public" ./web/package.json ./web/package-lock.json ];
};
};
}));
}