Skip to content

Commit 8a8aa97

Browse files
committed
adding nix build script
1 parent 277849b commit 8a8aa97

11 files changed

+156
-17
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- run: cargo test && cargo build --release
1111
- run: mkdir release && cp target/release/cemtexer release/
1212
- run: curl -LO https://github.com/tcnksm/ghr/releases/download/v0.14.0/ghr_v0.14.0_linux_amd64.tar.gz && tar -xvf ghr_v0.14.0_linux_amd64.tar.gz
13-
- run: ./ghr_v0.14.0_linux_amd64/ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete v0.1.2 release/
13+
- run: ./ghr_v0.14.0_linux_amd64/ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete v0.1.3 release/
1414
workflows:
1515
version: 2
1616
build:

.envrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/target
22
/.vscode/
33
**/*.rs.bk
4-
Cargo.lock
4+
Cargo.lock
5+
/result
6+
/.direnv

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
## ✨ cemtexer **0.1.0** *(2022-05-22)*
1+
## ✨ cemtexer **0.1.0** *(2022-05-22)*
2+
## ✨ cemtexer **0.1.3** *(2022-08-06)*
3+
Adding nix build script

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cemtexer"
3-
version = "0.1.2"
3+
version = "0.1.3"
44
edition = "2021"
55
authors = ["Geoffrey Borough <[email protected]>"]
66
readme = "README.md"

README.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ UI in the upcoming releases.
3333
## How to Use
3434

3535
Download the latest release from:
36-
https://github.com/gborough/cemtexer/releases/download/v0.1.2/cemtexer
36+
https://github.com/gborough/cemtexer/releases/download/v0.1.3/cemtexer
3737

3838
The command line interface currently features four functions, type cemtexer -h
3939
for command line options
@@ -135,12 +135,6 @@ verbatim. Overall we assume that the accounting software would output the correc
135135
* Due to Cemtex using non-compliant date format(DDMMYY), the leap year validation will only
136136
run up to year 9999 A.D.
137137

138-
## TODOS
139-
140-
* Add Nix build files. In progress.
141-
142-
* Add cross compile script. In progress.
143-
144138
## Future Releases
145139

146140
* A simple UI for individual users(accountants I would assume) which is compiled to a wasm

default.nix

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
(import
2+
(
3+
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
4+
fetchTarball {
5+
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
6+
sha256 = lock.nodes.flake-compat.locked.narHash;
7+
}
8+
)
9+
{ src = ./.; }
10+
).defaultNix

flake.lock

+94
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
description = "An utility for generating and validating Australian Banking Association Cemtex file format";
3+
4+
inputs = {
5+
naersk.url = "github:nmattia/naersk/master";
6+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
7+
utils.url = "github:numtide/flake-utils";
8+
flake-compat = {
9+
url = github:edolstra/flake-compat;
10+
flake = false;
11+
};
12+
};
13+
14+
outputs = { self, nixpkgs, utils, naersk, ... }:
15+
utils.lib.eachDefaultSystem (system:
16+
let
17+
pkgs = import nixpkgs { inherit system; };
18+
naersk-lib = pkgs.callPackage naersk { };
19+
in
20+
{
21+
defaultPackage = naersk-lib.buildPackage {
22+
src = ./.;
23+
doCheck = true;
24+
pname = "cemtexer";
25+
};
26+
27+
defaultApp = utils.lib.mkApp {
28+
drv = self.defaultPackage."${system}";
29+
};
30+
31+
devShell = with pkgs; mkShell {
32+
buildInputs = [
33+
jq
34+
cargo
35+
rustc
36+
];
37+
RUST_SRC_PATH = rustPlatform.rustLibSrc;
38+
};
39+
});
40+
}

src/cli/cli_opts.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
//! Command line options and associated functions
22
use clap::{AppSettings, Args, Parser, Subcommand};
33

4-
// use crate::blocks::*;
5-
// use crate::cemtex::*;
6-
// use crate::csv::*;
7-
84
/// Command line options
95
#[derive(Parser)]
106
#[clap(author = "Author: Geoffrey Borough<[email protected]>")]
11-
#[clap(version = "0.1.2")]
7+
#[clap(version)]
128
#[clap(about = "Utility to convert CSV file to Cemtex ABA file and validate Cemtex ABA file format", long_about = None)]
139
#[clap(global_setting(AppSettings::DeriveDisplayOrder))]
1410
pub struct Cli {

0 commit comments

Comments
 (0)