diff --git a/.gitignore b/.gitignore index b41f311..45eda79 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,9 @@ obj/ -minishell .direnv -.envrc -flake.nix compile_commands.json .cache libft/**/*.o libft/**/*.a src/main.c vgcore.* +result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..7f793bd --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1733261153, + "narHash": "sha256-eq51hyiaIwtWo19fPEeE0Zr2s83DYMKJoukNLgGGpek=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "b681065d0919f7eb5309a93cea2cfa84dec9aa88", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..8ab3304 --- /dev/null +++ b/flake.nix @@ -0,0 +1,34 @@ +{ + description = "minishell flake"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; + }; + + outputs = { self, nixpkgs, ... }: + let + supportedSystems = [ "x86_64-linux" ]; + forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f { + pkgs = import nixpkgs { inherit system; }; + }); + in + { + packages = forAllSystems ({ pkgs }: rec { + default = minishell; + minishell = pkgs.stdenv.mkDerivation { + name = "minishell"; + src = self; + buildInputs = with pkgs; [ + gcc clang readline + ]; + hardeningDisable = [ "all" ]; + buildPhase = '' + make + ''; + installPhase = '' + mkdir -p $out/bin + cp -r * $out/bin + ''; + }; + }); + }; +} diff --git a/minishell b/minishell new file mode 100755 index 0000000..7fa01a5 Binary files /dev/null and b/minishell differ