aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/x509-info/.envrc1
-rw-r--r--src/x509-info/.github/dependabot.yml11
-rw-r--r--src/x509-info/.github/workflows/build.yml73
-rw-r--r--src/x509-info/.gitignore1
-rw-r--r--src/x509-info/Cargo.toml8
-rw-r--r--src/x509-info/LICENSE20
-rw-r--r--src/x509-info/flake.nix61
-rw-r--r--src/x509-info/rust-toolchain.toml3
-rw-r--r--src/x509-info/rustfmt.toml1
-rw-r--r--src/x509-info/src/main.rs3
10 files changed, 182 insertions, 0 deletions
diff --git a/src/x509-info/.envrc b/src/x509-info/.envrc
new file mode 100644
index 0000000..a5dbbcb
--- /dev/null
+++ b/src/x509-info/.envrc
@@ -0,0 +1 @@
+use flake .
diff --git a/src/x509-info/.github/dependabot.yml b/src/x509-info/.github/dependabot.yml
new file mode 100644
index 0000000..2b2ebcf
--- /dev/null
+++ b/src/x509-info/.github/dependabot.yml
@@ -0,0 +1,11 @@
+version: 2
+updates:
+- package-ecosystem: cargo
+ directory: "/"
+ schedule:
+ interval: daily
+ open-pull-requests-limit: 10
+- package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "weekly"
diff --git a/src/x509-info/.github/workflows/build.yml b/src/x509-info/.github/workflows/build.yml
new file mode 100644
index 0000000..68deda2
--- /dev/null
+++ b/src/x509-info/.github/workflows/build.yml
@@ -0,0 +1,73 @@
+name: gh-ssh-keys CI
+
+on:
+ push:
+
+jobs:
+ check:
+ name: Check
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions-rs/toolchain@v1
+ with:
+ profile: minimal
+ toolchain: stable
+ override: true
+ - uses: actions-rs/cargo@v1
+ with:
+ command: check
+ - uses: actions-rs/cargo@v1
+ with:
+ command: check
+ args: --no-default-features
+
+ test:
+ name: Test
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions-rs/toolchain@v1
+ with:
+ profile: minimal
+ toolchain: stable
+ override: true
+ - uses: actions-rs/cargo@v1
+ with:
+ command: test
+ - uses: actions-rs/cargo@v1
+ with:
+ command: test
+ args: --no-default-features
+
+ fmt:
+ name: Rustfmt
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions-rs/toolchain@v1
+ with:
+ profile: minimal
+ toolchain: stable
+ override: true
+ - run: rustup component add rustfmt
+ - uses: actions-rs/cargo@v1
+ with:
+ command: fmt
+ args: --all -- --check
+
+ clippy:
+ name: Clippy
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions-rs/toolchain@v1
+ with:
+ profile: minimal
+ toolchain: stable
+ override: true
+ - run: rustup component add clippy
+ - uses: actions-rs/cargo@v1
+ with:
+ command: clippy
+ args: -- -D warnings
diff --git a/src/x509-info/.gitignore b/src/x509-info/.gitignore
new file mode 100644
index 0000000..ea8c4bf
--- /dev/null
+++ b/src/x509-info/.gitignore
@@ -0,0 +1 @@
+/target
diff --git a/src/x509-info/Cargo.toml b/src/x509-info/Cargo.toml
new file mode 100644
index 0000000..0dff6ec
--- /dev/null
+++ b/src/x509-info/Cargo.toml
@@ -0,0 +1,8 @@
+[package]
+name = "x509-info"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
diff --git a/src/x509-info/LICENSE b/src/x509-info/LICENSE
new file mode 100644
index 0000000..ac375e1
--- /dev/null
+++ b/src/x509-info/LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2022 Franck Cuny
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/src/x509-info/flake.nix b/src/x509-info/flake.nix
new file mode 100644
index 0000000..0dbaee0
--- /dev/null
+++ b/src/x509-info/flake.nix
@@ -0,0 +1,61 @@
+{
+ description = "A CLI to display information about x509 certificates.";
+
+ inputs = {
+ flake-utils.url = "github:numtide/flake-utils";
+ nixpkgs.url = "github:NixOS/nixpkgs";
+ rust-overlay.url = "github:oxalica/rust-overlay";
+ naersk.url = "github:nmattia/naersk";
+ };
+
+ outputs =
+ { self
+ , flake-utils
+ , nixpkgs
+ , naersk
+ , rust-overlay
+ }:
+
+ flake-utils.lib.eachDefaultSystem
+ (system:
+ let
+ overlays = [ (import rust-overlay) ];
+ pkgs = import nixpkgs { inherit system overlays; };
+ rust-toolchain =
+ (pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override {
+ extensions = [ "rust-src" ];
+ };
+ naersk-lib = naersk.lib."${system}".override {
+ rustc = rust-toolchain;
+ };
+ in
+ rec
+ {
+ packages.x509-info = naersk-lib.buildPackage {
+ pname = "x509-info";
+ root = ./.;
+ buildInputs = with pkgs; [ ];
+ };
+
+ defaultPackage = packages.x509-info;
+
+ devShell = pkgs.mkShell {
+ nativeBuildInputs = with pkgs; [
+ rust-toolchain
+ cargo-audit
+ cargo-deny
+ cargo-cross
+ rust-analyzer
+ ] ++ pkgs.lib.optionals (pkgs.stdenv.isLinux) (with pkgs; [ cargo-watch ]);
+
+ shellHook = ''
+ cargo --version
+ '';
+ };
+ })
+ // {
+ overlay = final: prev: {
+ x509-info = self.defaultPackage.${prev.system};
+ };
+ };
+}
diff --git a/src/x509-info/rust-toolchain.toml b/src/x509-info/rust-toolchain.toml
new file mode 100644
index 0000000..e7ae097
--- /dev/null
+++ b/src/x509-info/rust-toolchain.toml
@@ -0,0 +1,3 @@
+[toolchain]
+channel = "1.64.0"
+components = [ "rustfmt", "clippy" ]
diff --git a/src/x509-info/rustfmt.toml b/src/x509-info/rustfmt.toml
new file mode 100644
index 0000000..3a26366
--- /dev/null
+++ b/src/x509-info/rustfmt.toml
@@ -0,0 +1 @@
+edition = "2021"
diff --git a/src/x509-info/src/main.rs b/src/x509-info/src/main.rs
new file mode 100644
index 0000000..e7a11a9
--- /dev/null
+++ b/src/x509-info/src/main.rs
@@ -0,0 +1,3 @@
+fn main() {
+ println!("Hello, world!");
+}