jag

snake_c

public

Small snake game in C

Star0
Watch0
96e537edae6d1395366a3373a36ff008ef48c423
2
ssh://git@git.jaglekon.de:30/jag/snake_c.git
flake.nixNix52 lines1.1 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
        -I${jag-parse-lib}/include \
38
        -L${jag-parse-lib}/lib \
39
        -ljag_parse \
40
        -I${jag-write-lib}/include \
41
        -L${jag-write-lib}/lib \
42
        -ljag_write \
43
        -o snake
44
      '';
45
46
      installPhase = ''
47
        mkdir -p $out/bin
48
        install snake $out/bin
49
      '';
50
    };
51
  };
52
}