Skip to content

Commit

Permalink
feat: add Nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
grialion committed Aug 24, 2024
1 parent 528c453 commit 8bdfa7d
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ dist/
/compile_commands.json

.cache/

# nix build result
result
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs =
{ flake-utils, nixpkgs, ... }:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };

name = "LiDM";
version = "0.0.1";

lidm = (
pkgs.stdenv.mkDerivation {
pname = name;
version = version;

src = ./.;

nativeBuildInputs = with pkgs; [
gcc
gnumake
linux-pam
];

makeFlags = [
"DESTDIR=$(out)"
"PREFIX="
];

fixupPhase = ''
rm -rf $out/etc
'';
}
);
in
rec {
defaultApp = flake-utils.lib.mkApp { drv = defaultPackage; };
defaultPackage = lidm;
devShell = pkgs.mkShell { buildInputs = lidm.nativeBuildInputs ++ [ pkgs.clang-tools ]; };
}
);
}

0 comments on commit 8bdfa7d

Please sign in to comment.