add flake with direnv support

This commit is contained in:
jacekpoz 2024-02-13 19:20:24 +01:00
parent b990fabd4f
commit e2ac9aa4e6
No known key found for this signature in database
GPG key ID: 94E812A8B12AAE3C
4 changed files with 63 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
target/
.ccls-cache/
.direnv/

26
flake.lock Normal file
View file

@ -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
}

35
flake.nix Normal file
View file

@ -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
];
};
}
);
};
}