an http based roguelike rpg about jelqing
Commit d2e314cf03d5
tarball2 files changed+71-99
@@ -1,38 +1,5 @@
11
{22
"nodes": {3
- "crane": {4
- "locked": {5
- "lastModified": 1790899423,6
- "narHash": "sha256-THGtz65UGJU+sonZidRboyCMk+9DclpMF7pwL4uDV4M=",7
- "owner": "ipetkov",8
- "repo": "crane",9
- "rev": "47b6b27ed9a3a9181415e4367d0c30ab2a0e0250",10
- "type": "github"11
- },12
- "original": {13
- "owner": "ipetkov",14
- "repo": "crane",15
- "type": "github"16
- }17
- },18
- "flake-utils": {19
- "inputs": {20
- "systems": "systems"21
- },22
- "locked": {23
- "lastModified": 1731533236,24
- "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",25
- "owner": "numtide",26
- "repo": "flake-utils",27
- "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",28
- "type": "github"29
- },30
- "original": {31
- "owner": "numtide",32
- "repo": "flake-utils",33
- "type": "github"34
- }35
- },363
"nixpkgs": {374
"locked": {385
"lastModified": 1791456040,@@ -51,25 +18,8 @@
5118
},5219
"root": {5320
"inputs": {54
- "crane": "crane",55
- "flake-utils": "flake-utils",5621
"nixpkgs": "nixpkgs"5722
}58
- },59
- "systems": {60
- "locked": {61
- "lastModified": 1681028828,62
- "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",63
- "owner": "nix-systems",64
- "repo": "default",65
- "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",66
- "type": "github"67
- },68
- "original": {69
- "owner": "nix-systems",70
- "repo": "default",71
- "type": "github"72
- }7323
}7424
},7525
"root": "root",@@ -1,71 +1,93 @@
11
{22
description = "jelqd, a roguelike played entirely over HTTP";33
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
- };4
+ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";95
106
outputs =7
+ { self, nixpkgs }:8
+ let9
+ inherit (nixpkgs) lib;10
+ systems = [11
+ "x86_64-linux"12
+ "aarch64-linux"13
+ "x86_64-darwin"14
+ "aarch64-darwin"15
+ ];16
+ pkgsFor = lib.genAttrs systems (system: nixpkgs.legacyPackages.${system});17
+ forAllSystems = f: lib.genAttrs systems (system: f pkgsFor.${system});18
+19
+ src = lib.fileset.toSource {20
+ root = ./.;21
+ fileset = lib.fileset.unions [22
+ ./Cargo.toml23
+ ./Cargo.lock24
+ ./src25
+ ./tests26
+ ];27
+ };28
+ in1129
{12
- self,13
- nixpkgs,14
- crane,15
- flake-utils,16
- }:17
- flake-utils.lib.eachDefaultSystem (18
- system:19
- let20
- 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 = {30
+ packages = forAllSystems (pkgs: {31
+ default = pkgs.rustPlatform.buildRustPackage {32
+ pname = "jelqd";33
+ version = "0.6.9";2734
inherit src;28
- strictDeps = true;35
+ cargoLock.lockFile = ./Cargo.lock;36
+ meta.mainProgram = "jelqd";2937
};30
- cargoArtifacts = craneLib.buildDepsOnly commonArgs;31
- jelqd = craneLib.buildPackage (32
- commonArgs33
- // {34
- inherit cargoArtifacts;35
- meta.mainProgram = "jelqd";36
- }37
- );38
- in39
- {40
- packages.default = jelqd;38
+ });4139
42
- apps.default = flake-utils.lib.mkApp { drv = jelqd; } // {40
+ apps = forAllSystems (pkgs: {41
+ default = {42
+ type = "app";43
+ program = lib.getExe self.packages.${pkgs.stdenv.hostPlatform.system}.default;4344
meta.description = "Run the jelqd server";4445
};46
+ });4547
46
- checks = {48
+ checks = forAllSystems (49
+ pkgs:50
+ let51
+ jelqd = self.packages.${pkgs.stdenv.hostPlatform.system}.default;52
+ in53
+ {4754
inherit jelqd;48
- clippy = craneLib.cargoClippy (49
- commonArgs50
- // {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
- };55
+ clippy = jelqd.overrideAttrs (old: {56
+ pname = "jelqd-clippy";57
+ nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.clippy ];58
+ buildPhase = "cargo clippy --offline --all-targets -- --deny warnings";59
+ doCheck = false;60
+ installPhase = "touch $out";61
+ });62
+ fmt =63
+ pkgs.runCommand "jelqd-fmt"64
+ {65
+ nativeBuildInputs = [66
+ pkgs.cargo67
+ pkgs.rustfmt68
+ ];69
+ }70
+ ''71
+ cd ${src}72
+ cargo fmt --check73
+ touch $out74
+ '';75
+ }76
+ );5877
59
- devShells.default = craneLib.devShell {60
- checks = self.checks.${system};78
+ devShells = forAllSystems (pkgs: {79
+ default = pkgs.mkShell {80
+ inputsFrom = [ self.packages.${pkgs.stdenv.hostPlatform.system}.default ];6181
packages = [82
+ pkgs.clippy83
+ pkgs.rustfmt6284
pkgs.rust-analyzer6385
pkgs.nushell6486
pkgs.curl6587
];6688
};89
+ });6790
68
- formatter = pkgs.nixfmt;69
- }70
- );91
+ formatter = forAllSystems (pkgs: pkgs.nixfmt);92
+ };7193
}