main
Elnu 8 months ago
parent 04245c0604
commit a29048ddce

@ -0,0 +1 @@
use flake

9
.gitignore vendored

@ -1,6 +1,3 @@
# Generated by Cargo
# will have compiled files and executables
/target/
# These are backup files generated by rustfmt
**/*.rs.bk
/target
.direnv
result

@ -0,0 +1,5 @@
{
"rust-analyzer.linkedProjects": [
"./septadrop/Cargo.toml",
]
}

@ -1,22 +1,3 @@
[package]
name = "septadrop"
version = "1.1.0"
edition = "2021"
build = "build.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[profile.release]
strip = true
lto = true
codegen-units = 1
[dependencies]
sfml = "0.16.0"
rand = "0.8.5"
home = "0.5.3"
gcd = "2.1.0"
const_format = "0.2.22"
[build-dependencies]
winres = "0.1"
[workspace]
members = ["septadrop"]
resolver = "2"

@ -0,0 +1,96 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1693663421,
"narHash": "sha256-ImMIlWE/idjcZAfxKK8sQA7A1Gi/O58u5/CJA+mxvl8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e56990880811a451abd32515698c712788be5720",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1681358109,
"narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1693879802,
"narHash": "sha256-f+ceOsPpyiuExQIubKkLkyTZZiza1qJQGou4FZu9q1A=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "8a1d1bbe4c13eeb518e6159dd122c4f721f7543e",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

@ -0,0 +1,66 @@
/*
Some utility commands:
- `nix flake update --commit-lock-file`
- `nix flake lock update-input <input>`
- `nix build .#septadrop` or `nix build .`
- `nix run .#septadrop` or `nix run .`
*/
{
description = "A block game made in Rust and SFML.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nixpkgs, rust-overlay }:
let
overlays = [ (import rust-overlay) ];
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system overlays;
};
rustSettings = with pkgs; {
src = ./.;
cargoHash = nixpkgs.lib.fakeHash;
};
meta = with nixpkgs.lib; {
homepage = "https://git.elnu.com/ElnuDev/septadrop";
license = [ licenses.gpl3 ];
platforms = [ system ];
maintainers = with maintainers; [ elnudev ];
};
in {
devShells.${system}.default = with pkgs; mkShell {
packages = [
(pkgs.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" ];
})
cargo-edit
bacon
];
inputsFrom = with self.packages.${system}; [ septadrop ];
};
packages.${system} = {
default = self.packages.${system}.septadrop;
septadrop = pkgs.rustPlatform.buildRustPackage (rustSettings // {
pname = "septadrop";
version = "1.1.0";
buildAndTestSubdir = "septadrop";
buildInputs = with pkgs; [ csfml ];
cargoHash = "sha256-1Eis+FuISmv1bn4TvOdKDxxjk/ypNqyqzLoqfmXaEVQ=";
postPatch = ''
pushd septadrop
sed -i -E "s|\"res\"|\"''${out}\/share\"|" src/config.rs
mkdir -p $out/share
cp -r res/* $out/share
popd
'';
meta = meta // {
description = "A block game made in Rust and SFML.";
};
});
};
};
}

@ -0,0 +1,22 @@
[package]
name = "septadrop"
version = "1.1.0"
edition = "2021"
build = "build.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[profile.release]
strip = true
lto = true
codegen-units = 1
[dependencies]
sfml = "0.16.0"
rand = "0.8.5"
home = "0.5.3"
gcd = "2.1.0"
const_format = "0.2.22"
[build-dependencies]
winres = "0.1"

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Before

Width:  |  Height:  |  Size: 308 B

After

Width:  |  Height:  |  Size: 308 B

Before

Width:  |  Height:  |  Size: 540 B

After

Width:  |  Height:  |  Size: 540 B

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Loading…
Cancel
Save