dttyper/flake.nix

114 lines
2.6 KiB
Nix
Raw Normal View History

2024-04-28 11:30:15 +02:00
{
description = "romodoro builder";
2024-04-28 11:30:15 +02:00
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
2024-04-28 11:30:15 +02:00
outputs = { self, nixpkgs }:
let
supportedSystems =
[
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
2024-04-28 11:30:15 +02:00
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
2024-04-28 11:30:15 +02:00
nixpkgsFor = forAllSystems (system: import nixpkgs {
inherit system;
});
2024-04-28 11:30:15 +02:00
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;
2024-04-28 11:30:15 +02:00
};
});
2024-04-28 11:30:15 +02:00
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";
};
2024-04-28 11:30:15 +02:00
};
config = mkIf cfg.enable {
# todo add variables to ~/.config/dttyper
};
2024-04-28 11:30:15 +02:00
};
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
];
};
};
2024-04-28 11:30:15 +02:00
}