Add nix dev-shell

This commit is contained in:
ItsDrike 2024-07-18 17:07:10 +02:00
parent 532da8ef86
commit 968bc2e532
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0
4 changed files with 59 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake .

3
.gitignore vendored
View file

@ -28,3 +28,6 @@ TODO
# Cheatsheet post used for debugging post pages # Cheatsheet post used for debugging post pages
content/posts/cheatsheet.md content/posts/cheatsheet.md
# Nix direnv
.direnv

26
flake.lock Normal file
View file

@ -0,0 +1,26 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1721306924,
"narHash": "sha256-DKOCd7Gk+brIn/3fkL3UlIpK4wmXLfHKeTGsjzJ1jPA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a0812b380b9d17e9dd02b677e4052bf446b97cbe",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

29
flake.nix Normal file
View file

@ -0,0 +1,29 @@
{
description = "My personal website (itsdrike.com)";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = {nixpkgs, ...}: let
inherit (nixpkgs) lib;
pkgsFor = system: import nixpkgs {inherit system;};
targetSystems = ["aarch64-linux" "x86_64-linux"];
in {
devShells = lib.genAttrs targetSystems (system: let
pkgs = pkgsFor system;
in {
default = pkgs.mkShell {
packages = with pkgs; [
bash
coreutils
hugo
nodePackages.npm
];
};
});
formatter = lib.genAttrs targetSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
};
}