From ea32169d8a2bf4f46b3f060dad6d6d793104c79c Mon Sep 17 00:00:00 2001 From: yathxyz Date: Mon, 1 Jan 2024 10:20:48 +0000 Subject: [PATCH] Add nix support (#115) (Don't want to be the nix shill but I don't want to have cargo installed on my computer.) ### Add nix support to this repo, Can quickly set up locally with: `nix-shell --command 'mdbook serve'` or `nix develop -c mdbook serve` --- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 16 ++++++++++++++++ shell.nix | 16 ++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 shell.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..f3a179b6b --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1703832156, + "narHash": "sha256-2u/2oCSFH4QCVKeL/GHnse/S+rZ7aOMQeFJOIwCdBYU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "66559cae054c9abe9f6f997c3c9720fbad8d5443", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-23.11", + "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 000000000..f20d0dd25 --- /dev/null +++ b/flake.nix @@ -0,0 +1,16 @@ +{ + description = "Development environment for Space Station 14"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-23.11"; + + outputs = { self, nixpkgs }: + let + forAllSystems = function: + nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] + (system: function nixpkgs.legacyPackages.${system}); + in { + devShells = forAllSystems + (pkgs: { default = import ./shell.nix { inherit pkgs; }; }); + }; + +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 000000000..f80b6578a --- /dev/null +++ b/shell.nix @@ -0,0 +1,16 @@ +{ pkgs ? import (builtins.fetchTarball { + url = + "https://github.com/nixos/nixpkgs/archive/66559cae054c9abe9f6f997c3c9720fbad8d5443.tar.gz"; + sha256 = "sha256-2u/2oCSFH4QCVKeL/GHnse/S+rZ7aOMQeFJOIwCdBYU="; +}) { } }: + +with pkgs; +mkShell { + buildInputs = [ + mdbook + mdbook-mermaid + mdbook-linkcheck + mdbook-admonish + mdbook-emojicodes + ]; +}