chore: Add Nix development files (#5856)

* chore: Add Nix development files

* chore: add dir env flakes support and add it's directory to gitignore

* chore: add shards
This commit is contained in:
Fijxu
2026-08-01 18:50:15 -04:00
committed by GitHub
parent 6e13814c9e
commit 67bfb56bbe
6 changed files with 122 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
use flake
+3
View File
@@ -7,3 +7,6 @@
/invidious
/sentry
/config/config.yml
# direnv directory used for the Nix Flake.
.direnv
Generated
+61
View File
@@ -0,0 +1,61 @@
{
"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": 1785571196,
"narHash": "sha256-KoTsyMQqnXQZq8deCEnu4QkyldkwH/bpMMhUcfMdGIw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "148bab9c1c3c53136ecb44a6ea356a0ed5b39b06",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-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",
"version": 7
}
+27
View File
@@ -0,0 +1,27 @@
{
description = "Invidious Nix Flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
devPackages = import ./packages.nix { inherit pkgs; };
in
{
devShells.default = pkgs.mkShell {
buildInputs = devPackages;
};
}
);
}
+19
View File
@@ -0,0 +1,19 @@
{ pkgs }:
# Development packages, this makes Crystal 1.19 (latest available in nixpkgs)
# and sqlite available in a `nix-shell` or `nix develop` build environment.
#
# We dont need to add other dependencies like `libxml2` or `libyaml` here
# since they are already available by default in the Crystal Nix package
# (see the output value of CRYSTAL_LIBRARY_PATH when running `crystal env`
# Ref: https://github.com/NixOS/nixpkgs/blob/nixos-26.05/pkgs/development/compilers/crystal/default.nix#L231)
#
with pkgs;
[
# Invidious dependencies
crystal_1_19
sqlite
shards
# Utilities
nixd # Nixd LSP to format .nix files
]
+11
View File
@@ -0,0 +1,11 @@
{
pkgs ? import <nixpkgs> { },
}:
let
devPackages = import ./packages.nix { inherit pkgs; };
in
pkgs.mkShell {
buildInputs = devPackages;
}