Project setup

This commit is contained in:
mae 2024-11-01 22:55:23 +01:00
commit 27f18d0a45
8 changed files with 82 additions and 0 deletions

0
.clang-format Normal file
View file

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
result/
build/
.cache/

8
default.nix Normal file
View file

@ -0,0 +1,8 @@
{ stdenv, meson, ninja, pkg-config }: stdenv.mkDerivation {
name = "kobo-color-inputdev";
nativeBuildInputs = [
meson
ninja
];
src = ./.;
}

27
flake.lock Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1730200266,
"narHash": "sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "807e9154dcb16384b1b765ebe9cd2bba2ac287fd",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

21
flake.nix Normal file
View file

@ -0,0 +1,21 @@
{
description = "Small binary rewriting events from kobo libra colour to be used as a desktop libinput device";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in
{
packages.${system} =
{
kobo-color-inputdev = pkgs.callPackage ./default.nix { };
default = self.packages.${system}.kobo-color-inputdev;
};
devShells.${system}.default = import ./shell.nix { inherit pkgs; };
};
}

6
meson.build Normal file
View file

@ -0,0 +1,6 @@
project('kobo-color-inputdev', 'c',
version : '0.1',
default_options : ['warning_level=3'])
exe = executable('kobo-color-inputdev', 'src/main.c',
install : true)

5
shell.nix Normal file
View file

@ -0,0 +1,5 @@
{ pkgs ? import <nixpkgs> { } }:
pkgs.mkShell {
packages = with pkgs; [ libevent clang-tools ];
inputsFrom = [ (pkgs.callPackage ./default.nix { }) ];
}

12
src/main.c Normal file
View file

@ -0,0 +1,12 @@
#include <stdio.h>
#define PROJECT_NAME "kobo-color-inputdev"
int main(int argc, char **argv) {
if(argc != 1) {
printf("%s takes no arguments.\n", argv[0]);
return 1;
}
printf("This is project %s.\n", PROJECT_NAME);
return 0;
}