jag

snake_c

public

Small snake game in C

Star0
Watch0
ssh://git@git.jaglekon.de:30/jag/snake_c.git
flake.nixNix67 lines1.3 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://git.jaglekon.de/jag/jagParse_c";
8
9
    jag-write.url = "git+https://git.jaglekon.de/jag/jagWrite_c";
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.1";
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
    devShells.${system}.default = pkgs.mkShell {
54
55
      packages = with pkgs; [
56
57
        gcc
58
59
        gnumake
60
61
        cmake
62
63
      ];
64
65
    };
66
  };
67
}