From ed89285fc853f8305eac2f9870b5b799aeb69cac Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Sun, 9 Jul 2023 14:43:26 +0200 Subject: [PATCH] build: Use gitignore.nix to fetch the src --- flake.lock | 21 +++++++++++++++++++++ flake.nix | 10 ++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/flake.lock b/flake.lock index 4b284ff..18b0960 100644 --- a/flake.lock +++ b/flake.lock @@ -18,6 +18,26 @@ "type": "github" } }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1688859638, @@ -55,6 +75,7 @@ "root": { "inputs": { "flake-parts": "flake-parts", + "gitignore": "gitignore", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index aa91b2e..b453096 100644 --- a/flake.nix +++ b/flake.nix @@ -3,9 +3,14 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; + + gitignore = { + url = "github:hercules-ci/gitignore.nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = inputs@{ flake-parts, ... }: + outputs = inputs@{ flake-parts, gitignore, ... }: flake-parts.lib.mkFlake { inherit inputs; } { systems = [ "aarch64-darwin" "x86_64-linux" "aarch64-linux" ]; @@ -19,6 +24,7 @@ elixir = beamPackages.elixir_1_15; inherit (pkgs.stdenv) isDarwin; + inherit (gitignore.lib) gitignoreSource; in { devShells.default = pkgs.mkShell { @@ -40,7 +46,7 @@ packages.default = beamPackages.mixRelease { inherit pname version; - src = ./.; + src = gitignoreSource ./.; mixNixDeps = import ./mix.nix { inherit lib beamPackages; }; };