diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..57586a0 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.lock binary diff --git a/.gitignore b/.gitignore index 854fa32..d4f3ce5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ public/ resources/ *.lock +!flake.lock diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..23ba805 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1681346444, + "narHash": "sha256-JdT9kZ8iZD+Sc/y94jq4LjUw68gYJWXLzXXAgSt/iYs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1e0075620628ee4b367f9a2aae4ec14dcf304f69", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1e0075620628ee4b367f9a2aae4ec14dcf304f69", + "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 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..cf6c245 --- /dev/null +++ b/flake.nix @@ -0,0 +1,14 @@ +{ + description = "c8h4.io website"; + + inputs = { + nixpkgs.url = + "github:NixOS/nixpkgs/1e0075620628ee4b367f9a2aae4ec14dcf304f69"; # 13-04-2023 + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = import nixpkgs { inherit system; }; + in { devShells.default = import ./shell.nix { inherit pkgs; }; }); +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..d06c8ca --- /dev/null +++ b/shell.nix @@ -0,0 +1,21 @@ +{ pkgs ? import (fetchGit { + name = "nixos-unstable"; + url = "https://github.com/NixOS/nixpkgs"; + ref = "refs/heads/master"; + rev = "1e0075620628ee4b367f9a2aae4ec14dcf304f69"; # 13-04-2023 +}) { } }: + +pkgs.mkShell { + # Fix annoying "sh: warning: setlocale: LC_ALL: cannot change locale" warning + # https://stackoverflow.com/a/63123144 + # https://gist.github.com/peti/2c818d6cb49b0b0f2fd7c300f8386bc3 + # TODO: Fix this for `nix develop` too, this seems to only work for `nix-shell` + LOCALE_ARCHIVE_2_27 = "${pkgs.glibcLocales}/lib/locale/locale-archive"; + + nativeBuildInputs = with pkgs; [ + deadnix + nixfmt + nodePackages.prettier + statix + ]; +}