modules/argos: init argos-translate module

This commit is contained in:
Dmitriy Pleshevskiy 2024-06-18 20:34:24 +03:00
parent 9ed408cc86
commit 9f6bedbdc8
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2
3 changed files with 21 additions and 4 deletions

View file

@ -0,0 +1,18 @@
{ config, lib, pkgs, ... }:
let cfg = config.local.programs.argos-translate; in
{
options.local.programs.argos-translate = with lib; {
enable = mkEnableOption "argostranslate";
package = mkPackageOption pkgs.python311Packages "argostranslate" {};
};
config = lib.mkIf cfg.enable {
home.packages = [ cfg.package ];
programs.zsh.shellAliases = lib.mkIf config.programs.zsh.enable {
en2ru = "${cfg.package}/bin/argos-translate --from en --to ru";
ru2en = "${cfg.package}/bin/argos-translate --from ru --to en";
};
};
}

View file

@ -3,6 +3,7 @@
{
imports = [
./aerc.nix
./argos-translate.nix
./communication.nix
./dev-tools.nix
./flameshot.nix

View file

@ -120,6 +120,8 @@
local.programs.flameshot.enable = lib.mkDefault true;
local.programs.argos-translate.enable = lib.mkDefault true;
################################################################################
# Services
################################################################################
@ -156,10 +158,6 @@
procs
bottom
jq
# Translator
# use argospm tool to manage libraries
python311Packages.argostranslate
];
home.file = {