mirror of
https://github.com/Savapitech/42sh.git
synced 2026-01-18 16:57:28 +01:00
Add derivation for 42sh
This commit is contained in:
27
42sh.nix
Normal file
27
42sh.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
withDevBinaries ? false,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
name = "42sh";
|
||||
version = "dev";
|
||||
|
||||
src = ./.;
|
||||
enableParallelBuilding = true;
|
||||
|
||||
makeFlags = [ "PREFIX=${placeholder "out"}"]
|
||||
++ (lib.optional withDevBinaries ["debug" "check"]);
|
||||
|
||||
postInstall = lib.optional withDevBinaries ''
|
||||
install -Dm755 -t $out/bin debug
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Epitech shell";
|
||||
license = [ ];
|
||||
mainProgram = "42sh";
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = with lib.maintainers; [ savalet ];
|
||||
};
|
||||
}
|
||||
10
Makefile
10
Makefile
@@ -128,3 +128,13 @@ fclean:
|
||||
re: fclean all
|
||||
|
||||
.PHONY: all clean fclean re
|
||||
|
||||
PREFIX ?=
|
||||
BINDIR ?= $(PREFIX)/bin
|
||||
|
||||
.PHONY: install uninstall
|
||||
install: $(NAME_release)
|
||||
install -Dm755 -t $(BINDIR) $(NAME_release)
|
||||
|
||||
uninstall:
|
||||
$(RM) $(BINDIR)/42sh
|
||||
|
||||
46
flake.lock
generated
46
flake.lock
generated
@@ -1,59 +1,25 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1736798957,
|
||||
"narHash": "sha256-qwpCtZhSsSNQtK4xYGzMiyEDhkNzOCz/Vfu4oL2ETsQ=",
|
||||
"owner": "nixos",
|
||||
"lastModified": 1745377448,
|
||||
"narHash": "sha256-jhZDfXVKdD7TSEGgzFJQvEEZ2K65UMiqW5YJ2aIqxMA=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9abb87b552b7f55ac8916b6fc9e5cb486656a2f3",
|
||||
"rev": "507b63021ada5fee621b6ca371c4fca9ca46f52c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
||||
50
flake.nix
50
flake.nix
@@ -1,23 +1,35 @@
|
||||
{
|
||||
description = "Epitech flakes";
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
}: let
|
||||
forAllSystems = function:
|
||||
nixpkgs.lib.genAttrs [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
] (system: function nixpkgs.legacyPackages.${system});
|
||||
in {
|
||||
devShells = forAllSystems (pkgs: {
|
||||
default = pkgs.mkShell {
|
||||
hardeningDisable = ["fortify"];
|
||||
packages = with pkgs; [
|
||||
gcc
|
||||
criterion
|
||||
valgrind
|
||||
compiledb
|
||||
gcovr
|
||||
tcsh
|
||||
];
|
||||
};
|
||||
});
|
||||
|
||||
formatter = forAllSystems (pkgs: pkgs.alejandra);
|
||||
|
||||
packages = forAllSystems (pkgs: {
|
||||
default = self.packages.${pkgs.system}._42sh;
|
||||
_42sh = pkgs.callPackage ./42sh.nix { };
|
||||
});
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, flake-utils, ... }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let pkgs = nixpkgs.legacyPackages.${system}; in
|
||||
{
|
||||
devShells.default =
|
||||
pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
gcc
|
||||
criterion
|
||||
valgrind
|
||||
compiledb
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user