-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdefault.nix
54 lines (44 loc) · 1.15 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{ pkgs ? import <nixpkgs> {}, lib ? pkgs.lib }:
let
rustPlatform = pkgs.rustPlatform;
agnos = rustPlatform.buildRustPackage {
pname = "agnos";
version = "0.1.0";
src = lib.fileset.toSource { root = ./.; fileset = lib.fileset.unions [
./Cargo.lock
./Cargo.toml
./LICENSE.txt
./README.md
./resources/Banner-optimized.png
./resources/red-iron.png
./src
./systemd
]; };
cargoLock = {
lockFile = ./Cargo.lock;
};
nativeBuildInputs = [
pkgs.pkg-config
];
buildInputs = [
pkgs.openssl
];
buildPhase = ''
cargo build --release
'';
installPhase = ''
mkdir -p $out/bin
cp target/release/agnos $out/bin/
# Install systemd unit and timer
mkdir -p $out/lib/systemd/system
cp ${./systemd/agnos.service} $out/lib/systemd/system/
cp ${./systemd/agnos.timer} $out/lib/systemd/system/
'';
meta = with lib; {
description = "A Rust project with systemd unit and timer files";
license = licenses.mit;
maintainers = [ maintainers.krtab ];
};
};
in
agnos