-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lint / check includes / updated help
- Loading branch information
Archim Jhunjhunwala
committed
Dec 1, 2024
1 parent
53917a4
commit 6c73eed
Showing
9 changed files
with
127 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
{ | ||
description = "A simple C program using jansson built with Nix flakes"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
}; | ||
|
||
outputs = { self, nixpkgs }: { | ||
packages = nixpkgs.lib.genAttrs [ "aarch64-darwin" "x86_64-linux" ] (system: | ||
let pkgs = import nixpkgs { inherit system; }; | ||
in rec { | ||
wideriver = pkgs.stdenv.mkDerivation { | ||
pname = "wideriver"; | ||
version = "1.0"; | ||
|
||
src = ./.; | ||
|
||
nativeBuildInputs = with pkgs; [ | ||
wayland-scanner | ||
]; | ||
buildInputs = with pkgs; [ | ||
clang | ||
wayland | ||
wayland-scanner | ||
wlr-protocols | ||
wlroots | ||
pkg-config | ||
]; | ||
|
||
buildPhase = '' | ||
make | ||
''; | ||
|
||
installFlags = [ "PREFIX=$(out)" ]; | ||
|
||
installPhase = '' | ||
mkdir -p $out/bin | ||
cp wideriver $out/bin/ | ||
''; | ||
|
||
meta = with pkgs.lib; { | ||
description = "A simple program using jansson"; | ||
license = licenses.mit; | ||
maintainers = [ maintainers.yourname ]; | ||
platforms = platforms.unix; | ||
}; | ||
}; | ||
}); | ||
|
||
devShell = nixpkgs.lib.genAttrs [ "aarch64-darwin" "x86_64-linux" ] (system: | ||
let pkgs = import nixpkgs { inherit system; }; | ||
in pkgs.mkShell { | ||
nativeBuildInputs = with pkgs; [ | ||
wayland-scanner | ||
]; | ||
buildInputs = with pkgs; [ | ||
clang | ||
clang-tools # Includes clangd | ||
cmocka | ||
include-what-you-use | ||
valgrind | ||
wayland | ||
wayland-scanner | ||
wlr-protocols | ||
wlroots | ||
pkg-config | ||
]; | ||
|
||
shellHook = '' | ||
echo "Development environment loaded." | ||
''; | ||
}); | ||
|
||
defaultPackage = { | ||
aarch64-darwin = self.packages.aarch64-darwin.wideriver; | ||
x86_64-linux = self.packages.x86_64-linux.wideriver; | ||
}; | ||
|
||
defaultApp = { | ||
forAllSystems = nixpkgs.lib.mapAttrs' (system: pkg: { | ||
inherit system; | ||
defaultApp = { | ||
type = "app"; | ||
program = "${pkg.wideriver}/bin/wideriver"; | ||
}; | ||
}) self.packages; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/nix/store/p98n306sq7xk0yvc0px9yzkgcasrl1jr-wideriver-1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#include <stdbool.h> | ||
#include <stddef.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#include <unistd.h> | ||
#include <strings.h> | ||
|
||
#include <stddef.h> | ||
#include "enum.h" | ||
|
||
struct NameVal { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters