From c81cd0c2ea5c07053098828c16d4fc778d51941f Mon Sep 17 00:00:00 2001 From: Maix0 Date: Tue, 30 Apr 2024 21:31:08 +0200 Subject: [PATCH] flake devshell --- .clangd | 8 ++ .gitignore | 1 + flake.lock | 228 +++++++++++++++++++++++++++++++++++++++++ flake.nix | 16 +++ stdme/src/os/process.c | 4 +- 5 files changed, 254 insertions(+), 3 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.clangd b/.clangd index 294e143f..86a1a788 100644 --- a/.clangd +++ b/.clangd @@ -9,4 +9,12 @@ CompileFlags: # Tweak the parse settings - "-I/home/maiboyer/Documents/ring-2/shcat/includes/" - "-I/home/maiboyer/Documents/ring-2/shcat/output/include/" - "-I/home/maiboyer/Documents/ring-2/shcat/generic_sources/header/" + - "-I/home/maix/school/shcat/vendor/" + - "-I/home/maix/school/shcat/stdme/include/" + - "-I/home/maix/school/shcat/stdme/vendor/" + - "-I/home/maix/school/shcat/stdme/output/include/" + - "-I/home/maix/school/shcat/stdme/generic_sources/header/" + - "-I/home/maix/school/shcat/includes/" + - "-I/home/maix/school/shcat/output/include/" + - "-I/home/maix/school/shcat/generic_sources/header/" diff --git a/.gitignore b/.gitignore index bc400656..10885b2d 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,4 @@ Mkfile.old dkms.conf objects/ minishell +.envrc diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..28814d17 --- /dev/null +++ b/flake.lock @@ -0,0 +1,228 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "generic_c": { + "inputs": { + "flake-utils": "flake-utils_2", + "naersk": "naersk", + "nixpkgs": "nixpkgs_2", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1706829609, + "narHash": "sha256-A0imQ9AIJafdL1/+j/1b3G7bm2j+N+VhzTsvKikKjz4=", + "owner": "Maix0", + "repo": "generic_c", + "rev": "a470c2c5a8c8aadc852a7a50d72853f2a3873595", + "type": "github" + }, + "original": { + "owner": "Maix0", + "repo": "generic_c", + "type": "github" + } + }, + "naersk": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1698420672, + "narHash": "sha256-/TdeHMPRjjdJub7p7+w55vyABrsJlt5QkznPYy55vKA=", + "owner": "nix-community", + "repo": "naersk", + "rev": "aeb58d5e8faead8980a807c840232697982d47b9", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "naersk", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1706683685, + "narHash": "sha256-FtPPshEpxH/ewBOsdKBNhlsL2MLEFv1hEnQ19f/bFsQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5ad9903c16126a7d949101687af0aa589b1d7d3d", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1706683685, + "narHash": "sha256-FtPPshEpxH/ewBOsdKBNhlsL2MLEFv1hEnQ19f/bFsQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5ad9903c16126a7d949101687af0aa589b1d7d3d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1706487304, + "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "90f456026d284c22b3e3497be980b2e47d0b28ac", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 0, + "narHash": "sha256-XtTSSIB2DA6tOv+l0FhvfDMiyCmhoRbNB+0SeInZkbk=", + "path": "/nix/store/v4pcs3nzx54m5bmxd39win0rgl2d2hbx-source", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "generic_c": "generic_c", + "nixpkgs": "nixpkgs_4" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1706753617, + "narHash": "sha256-ZKqTFzhFwSWFEpQTJ0uXnfJBs5Y/po9/8TK4bzssdbs=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "58be43ae223034217ea1bd58c73210644031b687", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "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", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..3069590a --- /dev/null +++ b/flake.nix @@ -0,0 +1,16 @@ +{ + description = "Flake utils demo"; + + inputs.flake-utils.url = "github:numtide/flake-utils"; + inputs.generic_c.url = "github:Maix0/generic_c"; + + outputs = { self, nixpkgs, flake-utils, generic_c }: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; in + { + devShell = pkgs.mkShell { + packages = with pkgs; [clang valgrind gnumake readline.out readline.dev generic_c.packages.${system}.default]; + }; + } + ); +} diff --git a/stdme/src/os/process.c b/stdme/src/os/process.c index 55e0d394..70b6b5f4 100644 --- a/stdme/src/os/process.c +++ b/stdme/src/os/process.c @@ -6,7 +6,7 @@ /* By: maiboyer +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/03 16:22:41 by maiboyer #+# #+# */ -/* Updated: 2024/01/06 17:50:47 by maiboyer ### ########.fr */ +/* Updated: 2024/04/30 21:17:22 by maiboyer ### ########.fr */ /* */ /* ************************************************************************** */ @@ -81,11 +81,9 @@ t_error in_path(t_spawn_info *info, t_process *process, t_const_str path, t_error find_binary(t_spawn_info *info, t_process *process) { t_usize p_idx; - t_str *splitted_path; t_buffer_str s; (void)(process); - splitted_path = NULL; s = alloc_new_buffer(256); if (str_start_with(info->binary_path, "/") || str_find_chr(info->binary_path, '/') != NULL)