Compare commits
3 commits
589f43e52e
...
70489ddf74
Author | SHA1 | Date | |
---|---|---|---|
70489ddf74 | |||
081beb9c79 | |||
1cda4fd866 |
6 changed files with 226 additions and 2 deletions
|
@ -2,3 +2,4 @@ README.md
|
|||
LICENSE.txt
|
||||
/dist
|
||||
/target
|
||||
/result
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@
|
|||
/dist
|
||||
.env
|
||||
.vscode
|
||||
/result
|
148
flake.lock
Normal file
148
flake.lock
Normal file
|
@ -0,0 +1,148 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1698882062,
|
||||
"narHash": "sha256-HkhafUayIqxXyHH1X8d9RDl1M2CkFgZLjKD3MzabiEo=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "8c9fa2545007b49a5db5f650ae91f227672c3877",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"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": 1701040486,
|
||||
"narHash": "sha256-vawYwoHA5CwvjfqaT3A5CT9V36Eq43gxdwpux32Qkjw=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "45827faa2132b8eade424f6bdd48d8828754341a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1698611440,
|
||||
"narHash": "sha256-jPjHjrerhYDy3q9+s5EAsuhyhuknNfowY6yt6pjn9pc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "0cbe9f69c234a7700596e943bfae7ef27a31b735",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"dir": "lib",
|
||||
"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": {
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"rust-crate2nix": "rust-crate2nix",
|
||||
"rust-overlay": "rust-overlay"
|
||||
}
|
||||
},
|
||||
"rust-crate2nix": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1701048361,
|
||||
"narHash": "sha256-MIAFa7npdx7a3mSXrlzwrxNY7GyfRdEfgLgHzQUjfrA=",
|
||||
"owner": "kolloch",
|
||||
"repo": "crate2nix",
|
||||
"rev": "08a455fb7dee71720a9bb413fe498d5304708380",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "kolloch",
|
||||
"repo": "crate2nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1701137803,
|
||||
"narHash": "sha256-0LcPAdql5IhQSUXJx3Zna0dYTgdIoYO7zUrsKgiBd04=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "9dd940c967502f844eacea52a61e9596268d4f70",
|
||||
"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
|
||||
}
|
50
flake.nix
Normal file
50
flake.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
description = "staxman";
|
||||
|
||||
inputs = {
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||
rust-crate2nix = {
|
||||
url = "github:kolloch/crate2nix";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-parts,
|
||||
rust-overlay,
|
||||
rust-crate2nix,
|
||||
...
|
||||
} : flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
];
|
||||
perSystem = { system, pkgs, ... }: let
|
||||
overlays = [
|
||||
(import rust-overlay)
|
||||
(self: super: let
|
||||
toolchain = super.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||
in {
|
||||
rustc = toolchain;
|
||||
})
|
||||
];
|
||||
pkgs = import nixpkgs { inherit system overlays; };
|
||||
|
||||
project = let
|
||||
crateTools = pkgs.callPackage "${rust-crate2nix}/tools.nix" { inherit pkgs; };
|
||||
in import (crateTools.generatedCargoNix {
|
||||
name = "staxman";
|
||||
src = ./.;
|
||||
}) {
|
||||
inherit pkgs;
|
||||
};
|
||||
in rec {
|
||||
packages = {
|
||||
staxman = project.rootCrate.build;
|
||||
default = packages.staxman;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
22
package.nix
Normal file
22
package.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ naersk
|
||||
, version
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
naersk.buildPackage {
|
||||
name = "staxman";
|
||||
inherit version;
|
||||
|
||||
src = ./.;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
clang
|
||||
mold
|
||||
zlib
|
||||
libgit2
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = with pkgs; [ ];
|
||||
}
|
2
rust-toolchain.toml
Normal file
2
rust-toolchain.toml
Normal file
|
@ -0,0 +1,2 @@
|
|||
[toolchain]
|
||||
channel = "1.73"
|
Reference in a new issue