package up the regexes better
This commit is contained in:
parent
2a1d80d820
commit
18d6842f95
|
@ -18,7 +18,7 @@ in pkgs.stdenv.mkDerivation {
|
|||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
ln -s ${tron}/bin/tron $out/bin/tron
|
||||
ln -s ${./regexes.dhall} $out/regexes.dhall
|
||||
cp ${tron}/bin/tron $out/bin/tron
|
||||
cp ${./regexes.dhall} $out/regexes.dhall
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -9,12 +9,13 @@ let
|
|||
dockerImage = pkg:
|
||||
pkgs.dockerTools.buildLayeredImage {
|
||||
name = "xena/tron";
|
||||
tag = pkg.version;
|
||||
tag = tron.version;
|
||||
|
||||
contents = [ pkgs.cacert pkg ];
|
||||
contents = [ pkgs.cacert ];
|
||||
|
||||
config = {
|
||||
Cmd = [ "/bin/tron" ];
|
||||
Cmd = [ "${tron}/bin/tron" ];
|
||||
Env = [ "REGEXES=${tron}/regexes.dhall" ];
|
||||
WorkingDir = "/";
|
||||
};
|
||||
};
|
||||
|
|
|
@ -3,6 +3,4 @@ let Rule =
|
|||
, default = { regex = "", why = "" }
|
||||
}
|
||||
|
||||
in [ Rule::{ regex = "(n|z)igg(er|a)", why = "racism" }
|
||||
, Rule::{ regex = "(hot|cute)", why = "Cadey is testing" }
|
||||
]
|
||||
in [ Rule::{ regex = "(n|z)igg(er|a)", why = "racism" } ]
|
||||
|
|
|
@ -9,6 +9,7 @@ pkgs.mkShell {
|
|||
rustc
|
||||
rustfmt
|
||||
|
||||
# dhall
|
||||
dhall.dhall-simple
|
||||
|
||||
# system
|
||||
|
|
|
@ -99,9 +99,10 @@ impl FirehoseAdaptor for Rules {
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
kankyo::init()?;
|
||||
let _ = kankyo::init();
|
||||
pretty_env_logger::init();
|
||||
let cfg: Config = envy::from_env()?;
|
||||
log::debug!("cfg: {:?}", cfg);
|
||||
let rexes: Vec<Rule> = serde_dhall::from_file(cfg.regexes.clone()).parse()?;
|
||||
let mut compiled_rules: Vec<CompiledRule> = Vec::new();
|
||||
|
||||
|
|
Loading…
Reference in New Issue