Add flake.nix
Diff
.gitignore | 1 +
README.md | 8 ++++++++
flake.lock | 140 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
flake.nix | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.cargo/audit.toml | 9 +++++++++
src/client.rs | 1 +
6 files changed, 266 insertions(+)
@@ -1,2 +1,3 @@
/target
.idea/
/result
@@ -1,0 +1,8 @@
# titanircd
A modern take on an IRC server, built from the ground up in Rust
against the [IRCv3 spec].
All clients require authentication, and bouncers are built-in.
[IRCv3 spec]: https://modern.ircdocs.horse/
@@ -1,0 +1,140 @@
{
"nodes": {
"advisory-db": {
"flake": false,
"locked": {
"lastModified": 1672138084,
"narHash": "sha256-x+q6lNmmzr+y/XBRy0fg9oYDqg0r/zQ+8Uiikx4osh8=",
"owner": "rustsec",
"repo": "advisory-db",
"rev": "6d5b76eb3be175fd2101b83140df15673531bb7b",
"type": "github"
},
"original": {
"owner": "rustsec",
"repo": "advisory-db",
"type": "github"
}
},
"crane": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1673056065,
"narHash": "sha256-a68tMDTDqdAauxq377ALl4Uwm6oh9MeoY2WbTYRWZoo=",
"owner": "ipetkov",
"repo": "crane",
"rev": "0144134311767fcee80213321f079a8ffa0b9cc1",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1668681692,
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1672997035,
"narHash": "sha256-DNaNjsGMRYefBTAxFIrVOB2ok477cj1FTpqnu/mKRf4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f1ffcf798e93b169321106a4aef79526a2b4bd0a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"advisory-db": "advisory-db",
"crane": "crane",
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": [
"crane",
"flake-utils"
],
"nixpkgs": [
"crane",
"nixpkgs"
]
},
"locked": {
"lastModified": 1672712534,
"narHash": "sha256-8S0DdMPcbITnlOu0uA81mTo3hgX84wK8S9wS34HEFY4=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "69fb7bf0a8c40e6c4c197fa1816773774c8ac59f",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
@@ -1,0 +1,107 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
advisory-db = {
url = "github:rustsec/advisory-db";
flake = false;
};
};
outputs = { self, nixpkgs, crane, flake-utils, advisory-db, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
inherit (pkgs) lib;
craneLib = crane.lib.${system};
src = craneLib.cleanCargoSource ./.;
buildInputs = [
] ++ lib.optionals pkgs.stdenv.isDarwin [
pkgs.libiconv
];
cargoArtifacts = craneLib.buildDepsOnly {
inherit src buildInputs;
};
titanircd = craneLib.buildPackage {
inherit cargoArtifacts src buildInputs;
};
in
{
checks = {
inherit titanircd;
titanircd-clippy = craneLib.cargoClippy {
inherit cargoArtifacts src buildInputs;
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
};
titanircd-doc = craneLib.cargoDoc {
inherit cargoArtifacts src buildInputs;
};
titanircd-fmt = craneLib.cargoFmt {
inherit src;
};
titanircd-audit = craneLib.cargoAudit {
inherit src advisory-db;
};
titanircd-nextest = craneLib.cargoNextest {
inherit cargoArtifacts src buildInputs;
partitions = 1;
partitionType = "count";
};
} // lib.optionalAttrs (system == "x86_64-linux") {
titanircd-coverage = craneLib.cargoTarpaulin {
inherit cargoArtifacts src;
};
};
packages.default = titanircd;
apps.default = flake-utils.lib.mkApp {
drv = titanircd;
};
devShells.default = pkgs.mkShell {
inputsFrom = builtins.attrValues self.checks;
nativeBuildInputs = with pkgs; [
cargo
rustc
];
};
});
}
@@ -1,0 +1,9 @@
[advisories]
ignore = [
"RUSTSEC-2020-0159",
"RUSTSEC-2020-0071"
]
@@ -504,6 +504,7 @@
}
}
#[must_use]
pub fn parse_channel_name_list(s: &str) -> Vec<String> {
s.split(',')
.filter(|v| !v.is_empty())