-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
44 lines (41 loc) · 1.47 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
{
description = "at-cli, a lightweight, cross-platform, fast and beautiful command line interface for https://atcoder.jp";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
poetry2nix.url = "github:nix-community/poetry2nix";
};
outputs = { nixpkgs, poetry2nix, ...}: let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
overlays = [ poetry2nix.overlays.default ];
};
app = pkgs.poetry2nix.mkPoetryApplication {
projectDir = pkgs.stdenv.mkDerivation {
name = "atcli-core";
# TODO: This is DIRTY, fix it.
src = pkgs.nix-gitignore.gitignoreSource (pkgs.lib.cleanSource ./.) (pkgs.lib.cleanSource ./.);
buildInputs = with pkgs; [ tree python3 python311Packages.babel ];
buildPhase = ''
source $stdenv/setup
mkdir -p $out
cp . $out -r
python3 $out/scripts/build-mo.py
'';
};
};
in {
devShells."${system}" = {
default = pkgs.mkShell {
packages = with pkgs; [ poetry ];
};
};
packages."${system}".default = pkgs.writeShellApplication {
name = "atcli";
runtimeInputs = [ app.dependencyEnv ];
text = ''
python -m atcodercli "$@"
'';
};
};
}