0
0
mirror of https://github.com/neon-mmd/websurfx.git synced 2024-11-26 07:58:20 -05:00
websurfx/flake.nix
Jann Marc Villablanca 0943b8b8c4
📝 Developer environment setup on NixOS (#454)
* 🧑‍💻feat: update nix flake dev environment

- This removes installing `docker`, `rust-analyzer`, `rustfmt`
  imperatively. `nodejs` is used to install dev dependencies
  `stylelint-config-standard` and `postcss-lit`
- The `shellHook`s adds `rusty-hook` CLI to the PATH and the node
  dev dependencies to the NODE_PATH.

* 📝 docs(developing): update NixOS dev environment setup

* fix: remove nonvital guide and improve grammar

---------

Co-authored-by: neon_arch <mustafadhuleb53@gmail.com>
2023-12-24 07:27:54 +03:00

64 lines
1.7 KiB
Nix

{
# Websurfx NixOS flake
inputs = {
naersk.url = "github:nix-community/naersk/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = {
naersk,
nixpkgs,
self,
utils,
}:
# We do this for all systems - namely x86_64-linux, aarch64-linux,
# x86_64-darwin and aarch64-darwin
utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
naersk-lib = pkgs.callPackage naersk {};
in rec {
# Build via "nix build .#default"
packages.default = naersk-lib.buildPackage {
# The build dependencies
buildInputs = with pkgs; [pkg-config openssl];
src = ./.;
};
# Enter devshell with all the tools via "nix develop"
# or "nix-shell"
devShells.default = with pkgs;
mkShell {
buildInputs = [
actionlint
cargo
docker
haskellPackages.hadolint
nodejs
nodePackages_latest.cspell
nodePackages_latest.eslint
nodePackages_latest.markdownlint-cli2
nodePackages_latest.stylelint
redis
rustPackages.clippy
rust-analyzer
cargo-watch
rustc
rustfmt
yamllint
openssl
pkg-config
];
RUST_SRC_PATH = rustPlatform.rustLibSrc;
shellHook = ''
export PATH="$PATH:$HOME/.cargo/bin"
export NODE_PATH="$NODE_PATH:./node_modules"
'';
};
# Build via "nix build .#websurfx", which is basically just
# calls the build function
packages.websurfx = packages.default;
});