1
0

add nix derivation and flake

This commit is contained in:
Rokas Puzonas 2024-06-27 00:07:12 +03:00
parent ed9d885bed
commit 4d650c1566
11 changed files with 95 additions and 0 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
target/
result

9
default.nix Normal file
View File

@ -0,0 +1,9 @@
{ lib, rustPlatform }:
rustPlatform.buildRustPackage rec {
pname = "taskchampion-sync-server";
version = "0.4.1";
src = lib.cleanSource ./.;
cargoHash = "sha256-UvVAZX8cfGO3twpBZ0nC6MQ01vcUtbDqJj3QZDqz+rs=";
}

61
flake.lock generated Normal file
View File

@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1719253556,
"narHash": "sha256-A/76RFUVxZ/7Y8+OMVL1Lc8LRhBxZ8ZE2bpMnvZ1VpY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "fc07dc3bdf2956ddd64f24612ea7fc894933eb2e",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

17
flake.nix Normal file
View File

@ -0,0 +1,17 @@
{
description = "Fork of taskchampion-sync-server";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem(system:
let
pkgs = import nixpkgs { inherit system; };
in
{
packages.default = pkgs.callPackage ./. { };
});
}

View File

@ -82,6 +82,7 @@ pub(crate) async fn service(
}
#[cfg(test)]
#[cfg(debug_assertions)]
mod test {
use super::*;
use crate::api::CLIENT_ID_HEADER;

View File

@ -111,6 +111,7 @@ pub(crate) async fn service(
}
#[cfg(test)]
#[cfg(debug_assertions)]
mod test {
use crate::api::CLIENT_ID_HEADER;
use crate::storage::{InMemoryStorage, Storage};

View File

@ -55,6 +55,7 @@ pub(crate) async fn service(
}
#[cfg(test)]
#[cfg(debug_assertions)]
mod test {
use crate::api::CLIENT_ID_HEADER;
use crate::server::NIL_VERSION_ID;

View File

@ -40,6 +40,7 @@ pub(crate) async fn service(
}
#[cfg(test)]
#[cfg(debug_assertions)]
mod test {
use crate::api::CLIENT_ID_HEADER;
use crate::storage::{InMemoryStorage, Snapshot, Storage};

View File

@ -102,6 +102,7 @@ async fn main() -> anyhow::Result<()> {
}
#[cfg(test)]
#[cfg(debug_assertions)]
mod test {
use super::*;
use actix_web::{test, App};

View File

@ -45,6 +45,7 @@ impl Server {
}
#[cfg(test)]
#[cfg(debug_assertions)]
mod test {
use super::*;
use crate::storage::InMemoryStorage;

View File

@ -309,6 +309,7 @@ pub(crate) fn get_snapshot<'a>(
}
#[cfg(test)]
#[cfg(debug_assertions)]
mod test {
use super::*;
use crate::storage::{InMemoryStorage, Snapshot, Storage};