diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index eadc128..cf48717 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ target/ .ccls-cache/ +.direnv/ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..e79b649 --- /dev/null +++ b/flake.lock @@ -0,0 +1,26 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1707824078, + "narHash": "sha256-Au3wLi2d06bU7TDvahP2jIEeKwmjAxKHqi8l2uiBkGA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "99d7b32e4cfdaf763d9335b4d9ecf4415cbdc405", + "type": "github" + }, + "original": { + "owner": "NixOS", + "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..1deeff3 --- /dev/null +++ b/flake.nix @@ -0,0 +1,35 @@ +{ + description = "modular fetch"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + }; + + outputs = { + nixpkgs, + ... + }: let + systems = [ "x86_64-linux" "aarch64-linux" ]; + forEachSystem = nixpkgs.lib.genAttrs systems; + pkgsForEach = nixpkgs.legacyPackages; + in { + devShells = forEachSystem (system: + let + pkgs = pkgsForEach.${system}; + in { + default = pkgs.mkShell { + name = "modfetch"; + + nativeBuildInputs = with pkgs; [ + gcc + gnumake + ]; + + buildInputs = with pkgs; [ + curl.dev + ]; + }; + } + ); + }; +}