From c04e4ae6c5f2584702be205d79ab48172fb14dcb Mon Sep 17 00:00:00 2001 From: Vri Date: Tue, 18 Feb 2025 19:52:22 +0100 Subject: [PATCH] feat: add flake devshell --- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..1fd6ae2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1739736696, + "narHash": "sha256-zON2GNBkzsIyALlOCFiEBcIjI4w38GYOb+P+R4S8Jsw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d74a2335ac9c133d6bbec9fc98d91a77f1604c1f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "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..5aca172 --- /dev/null +++ b/flake.nix @@ -0,0 +1,34 @@ +{ + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + outputs = { + nixpkgs, + self, + }: let + pkgs = nixpkgs; + + mkAllSystems = genAttrs [ + "aarch64-darwin" + "aarch64-linux" + "i686-linux" + "x86_64-darwin" + "x86_64-linux" + ]; + + inherit (lib) genAttrs; + inherit (pkgs) alejandra lib; + in { + formatter = mkAllSystems (system: alejandra); + + devShells = mkAllSystems (system: let + pkgs = nixpkgs.legacyPackages.${system}; + + inherit (pkgs) mkShell; + in { + default = mkShell { + nativeBuildInputs = [pkgs.hugo]; + shellHook = "hugo server"; + }; + }); + }; +}