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