atagen

jelq

public

an http based roguelike rpg about jelqing

Star0
Watch0
2ea5ef81f040ab9608f3421508d03314efb7f6d8
1
ssh://brewery@pls.lobotomise.me:33/atagen/jelq.git
flake.nixNix71 lines1.8 KB
1
{
2
  description = "jelqd, a roguelike played entirely over HTTP";
3
4
  inputs = {
5
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6
    crane.url = "github:ipetkov/crane";
7
    flake-utils.url = "github:numtide/flake-utils";
8
  };
9
10
  outputs =
11
    {
12
      self,
13
      nixpkgs,
14
      crane,
15
      flake-utils,
16
    }:
17
    flake-utils.lib.eachDefaultSystem (
18
      system:
19
      let
20
        pkgs = nixpkgs.legacyPackages.${system};
21
        craneLib = crane.mkLib pkgs;
22
        src = pkgs.lib.cleanSourceWith {
23
          src = ./.;
24
          filter = path: type: pkgs.lib.hasSuffix ".html" path || craneLib.filterCargoSources path type;
25
        };
26
        commonArgs = {
27
          inherit src;
28
          strictDeps = true;
29
        };
30
        cargoArtifacts = craneLib.buildDepsOnly commonArgs;
31
        jelqd = craneLib.buildPackage (
32
          commonArgs
33
          // {
34
            inherit cargoArtifacts;
35
            meta.mainProgram = "jelqd";
36
          }
37
        );
38
      in
39
      {
40
        packages.default = jelqd;
41
42
        apps.default = flake-utils.lib.mkApp { drv = jelqd; } // {
43
          meta.description = "Run the jelqd server";
44
        };
45
46
        checks = {
47
          inherit jelqd;
48
          clippy = craneLib.cargoClippy (
49
            commonArgs
50
            // {
51
              inherit cargoArtifacts;
52
              cargoClippyExtraArgs = "--all-targets -- --deny warnings";
53
            }
54
          );
55
          fmt = craneLib.cargoFmt { inherit src; };
56
          test = craneLib.cargoTest (commonArgs // { inherit cargoArtifacts; });
57
        };
58
59
        devShells.default = craneLib.devShell {
60
          checks = self.checks.${system};
61
          packages = [
62
            pkgs.rust-analyzer
63
            pkgs.nushell
64
            pkgs.curl
65
          ];
66
        };
67
68
        formatter = pkgs.nixfmt;
69
      }
70
    );
71
}