jag

snake_c

public

Small snake game in C

Star0
Watch0
f47b31cfbecf3f569566b9977e522083fc9bc485
2
ssh://git@git.jaglekon.de:30/jag/snake_c.git
flake.nixNix53 lines1.2 KB
1
{
2
  description = "Jaglekon's Sanake_Game";
3
4
  inputs = {
5
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6
7
    jag-parse.url = "git+https://codeberg.org/Jaglekon/jag_parse.git";
8
9
    jag-write.url = "git+https://codeberg.org/Jaglekon/jag_write.git";
10
  };
11
12
  outputs = {
13
    self,
14
    jag-parse,
15
    jag-write,
16
    nixpkgs,
17
  }: let
18
    system = "x86_64-linux";
19
    pkgs = import nixpkgs {inherit system;};
20
    jag-parse-lib = jag-parse.packages.${system}.default;
21
    jag-write-lib = jag-write.packages.${system}.default;
22
  in {
23
    packages.${system}.default = pkgs.stdenv.mkDerivation {
24
      pname = "snake";
25
      version = "1.0.0";
26
27
      src = ./source/.;
28
29
      buildPhase = ''
30
        $CC \
31
        main.c \
32
        draw.c \
33
        logic.c \
34
        parameters.c \
35
        settings_file/settings_file.c \
36
        animation/animation.c \
37
        read_input/read_input.c \
38
        -I${jag-parse-lib}/include \
39
        -L${jag-parse-lib}/lib \
40
        -ljag_parse \
41
        -I${jag-write-lib}/include \
42
        -L${jag-write-lib}/lib \
43
        -ljag_write \
44
        -o snake
45
      '';
46
47
      installPhase = ''
48
        mkdir -p $out/bin
49
        install snake $out/bin
50
      '';
51
    };
52
  };
53
}