-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathflake.nix
More file actions
33 lines (33 loc) · 807 Bytes
/
Copy pathflake.nix
File metadata and controls
33 lines (33 loc) · 807 Bytes
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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs = { nixpkgs, ... }: let
pkgs = import nixpkgs {
system = "x86_64-linux";
};
in {
devShells."x86_64-linux".default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
gnumake pkg-config systemDlibs libusb1
];
hardeningDisable = [ "all" ];
};
packages."x86_64-linux".default = pkgs.stdenv.mkDerivation {
name = "ch341prog";
pname = "ch341prog";
version = "9999";
src = ./.;
buildInputs = with pkgs; [
gcc gnumake libusb1 systemdLibs
];
buildPhase = ''
gcc ch341a.c main.c -o ch341prog -lusb-1.0
'';
installPhase = ''
mkdir -p $out/bin
cp ch341prog $out/bin
'';
};
};
}