[RFC,v3] nix: add a simple flake nix shell
Checks
Commit Message
This commit is specifically targeting enhancements in
Nix support for GCC development. This initiative stems
from the recognized need within our community for a more
streamlined and efficient development process when using Nix.
Please not that in this case the Nix tool is used to define
what should be in the dev environment, and not as a NixOS distro
package manager.
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
---
v3: moved the flake to contrib/ instead of installing it at the root of
the repository
.gitignore | 1 +
contrib/nix/flake.nix | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
create mode 100644 contrib/nix/flake.nix
@@ -2,6 +2,7 @@
*.patch
*.orig
*.rej
+*.lock
*~
.#*
new file mode 100644
@@ -0,0 +1,35 @@
+{
+ description = "gcc compiler";
+
+ inputs = {
+ nixpkgs.url = "github:nixos/nixpkgs";
+ flake-utils.url = "github:numtide/flake-utils";
+ };
+
+ outputs = { self, nixpkgs, flake-utils }:
+ flake-utils.lib.eachDefaultSystem (system:
+ let pkgs = nixpkgs.legacyPackages.${system};
+ in {
+ packages = {
+ default = pkgs.gnumake;
+ };
+ formatter = pkgs.nixpkgs-fmt;
+
+ devShell = pkgs.mkShell {
+ buildInputs = [
+ pkgs.gnumake
+ pkgs.gcc13
+
+ pkgs.gmp
+ pkgs.libmpc
+ pkgs.mpfr
+ pkgs.isl
+ pkgs.pkg-config
+ pkgs.autoconf-archive
+ pkgs.autoconf
+ pkgs.automake
+ ];
+ };
+ }
+ );
+}