Skip to content

Commit

Permalink
nix : use nix-filter
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaslepoix committed Nov 26, 2024
1 parent 4b8cc9c commit 09d6fe2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
13 changes: 12 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@ stdenv.mkDerivation {
name = "openemsh";
version = "0.0.0";

src = ./.;
src = lib.nix-filter {
root = ./.;
include = [
"cmake"
"src"
"doc"
"icon"
"test"
"CMakeLists.txt"
"CMakePresets.json"
];
};

nativeBuildInputs = [
cmake
Expand Down
9 changes: 8 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/22.11";

nix-filter.url = "github:numtide/nix-filter";

flake-utils.url = "github:numtide/flake-utils";

cmake-utils = {
Expand All @@ -17,11 +19,15 @@

outputs = { self
, nixpkgs
, nix-filter
, cmake-utils
, flake-utils
, ...
}@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
lib = nixpkgs.lib.extend nix-filter.overlays.default;

in flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system}.appendOverlays [
cmake-utils.overlays.pkgs
Expand Down Expand Up @@ -64,6 +70,7 @@
overlays = {
pkgs = final: prev: {
openemsh = prev.callPackage ./default.nix {
inherit lib;
stdenv = prev.llvmPackages_13.stdenv;
};

Expand Down

0 comments on commit 09d6fe2

Please sign in to comment.