build: Use gitignore.nix to fetch the src

This commit is contained in:
Daniel Kempkens 2023-07-09 14:43:26 +02:00
parent 00a74bfebe
commit ed89285fc8
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
2 changed files with 29 additions and 2 deletions

View file

@ -18,6 +18,26 @@
"type": "github" "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": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1688859638, "lastModified": 1688859638,
@ -55,6 +75,7 @@
"root": { "root": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"gitignore": "gitignore",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
} }

View file

@ -3,9 +3,14 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts"; 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; } { flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "aarch64-darwin" "x86_64-linux" "aarch64-linux" ]; systems = [ "aarch64-darwin" "x86_64-linux" "aarch64-linux" ];
@ -19,6 +24,7 @@
elixir = beamPackages.elixir_1_15; elixir = beamPackages.elixir_1_15;
inherit (pkgs.stdenv) isDarwin; inherit (pkgs.stdenv) isDarwin;
inherit (gitignore.lib) gitignoreSource;
in in
{ {
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
@ -40,7 +46,7 @@
packages.default = beamPackages.mixRelease { packages.default = beamPackages.mixRelease {
inherit pname version; inherit pname version;
src = ./.; src = gitignoreSource ./.;
mixNixDeps = import ./mix.nix { inherit lib beamPackages; }; mixNixDeps = import ./mix.nix { inherit lib beamPackages; };
}; };