2005
836ad76173
rewrote the whole thing added a few options but config needs to be written changed old users to me
114 lines
2.6 KiB
Nix
114 lines
2.6 KiB
Nix
{
|
|
description = "romodoro builder";
|
|
|
|
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
|
|
|
|
outputs = { self, nixpkgs }:
|
|
let
|
|
supportedSystems =
|
|
[
|
|
"x86_64-linux"
|
|
"x86_64-darwin"
|
|
"aarch64-linux"
|
|
"aarch64-darwin"
|
|
];
|
|
|
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
|
|
|
nixpkgsFor = forAllSystems (system: import nixpkgs {
|
|
inherit system;
|
|
});
|
|
|
|
in
|
|
{
|
|
|
|
packages = forAllSystems (system:
|
|
let
|
|
pkgs = nixpkgsFor.${system};
|
|
in
|
|
{
|
|
default = pkgs.rustPlatform.buildRustPackage {
|
|
pname = "dttyper";
|
|
version = "1.4.3";
|
|
src = ./.;
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
libiconv
|
|
pkg-config
|
|
];
|
|
buildInputs = with pkgs; [
|
|
openssl
|
|
];
|
|
cargoLock.lockFile = ./Cargo.lock;
|
|
};
|
|
});
|
|
|
|
nixosModules.default = { config, lib, pkgs, ... }:
|
|
with lib;
|
|
let
|
|
cfg = config.services.prometheus.exporters.i2pd;
|
|
in
|
|
{
|
|
options.programs.dttyper = {
|
|
enable = mkEnableOption "Enable dttyper";
|
|
|
|
default_language = mkOption {
|
|
type = types.str;
|
|
default = "english1000";
|
|
};
|
|
server = mkOption {
|
|
type = types.str;
|
|
# TODO add checking for url in config
|
|
default = "http://localhost:8086";
|
|
};
|
|
token = mkOption {
|
|
type = types.str;
|
|
# TODO add tokeFile
|
|
};
|
|
bucket = mkOption {
|
|
type = types.str;
|
|
default = "dttyper";
|
|
};
|
|
|
|
org = mkOption {
|
|
type = types.str;
|
|
};
|
|
|
|
keyboard = mkOption {
|
|
type = types.str;
|
|
default = "Generic";
|
|
};
|
|
};
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
# todo add variables to ~/.config/dttyper
|
|
};
|
|
};
|
|
|
|
|
|
|
|
devShells.default =
|
|
with nixpkgs; mkShell
|
|
{
|
|
LIBCLANG_PATH = "${pkgs.llvmPackages_17.libclang.lib}/lib";
|
|
RUST_BACKTRACE = 1;
|
|
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
|
OPENSSL_NO_VENDOR = 1;
|
|
packages = with pkgs; [
|
|
rustc
|
|
cargo
|
|
rustfmt
|
|
rust-analyzer
|
|
clippy
|
|
rustup
|
|
pkg-config
|
|
openssl
|
|
libiconv
|
|
];
|
|
};
|
|
};
|
|
}
|
|
|
|
|