Merge pull request 'turborepo, neovim: rust-analyzer pushed to devShell' (#4) from top-level-wip into master
Reviewed-on: #4pull/6/head^2
commit
34ef52d5b4
33
flake.lock
33
flake.lock
|
@ -89,11 +89,11 @@
|
||||||
"utils": "utils"
|
"utils": "utils"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1672349765,
|
"lastModified": 1672770368,
|
||||||
"narHash": "sha256-Ul3lSGglgHXhgU3YNqsNeTlRH1pqxbR64h+2hM+HtnM=",
|
"narHash": "sha256-iO6Z9blIe8dcPh3VT2nkej9EimORCoskGQR6xNjICWI=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "dd99675ee81fef051809bc87d67eb07f5ba022e8",
|
"rev": "d01e7280ad7d13a5a0fae57355bd0dbfe5b81969",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -124,17 +124,14 @@
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1661367362,
|
"lastModified": 1,
|
||||||
"narHash": "sha256-Qc8MXcV+YCPREu8kk6oggk23ZBKLqeQRAIsLbHEviPE=",
|
"narHash": "sha256-KP+2qdZlhmRkrafuuEofg7YnNdVmGV95ipvpuqmJneI=",
|
||||||
"owner": "guibou",
|
"path": "out-of-tree/nixGL",
|
||||||
"repo": "nixGL",
|
"type": "path"
|
||||||
"rev": "7165ffbccbd2cf4379b6cd6d2edd1620a427e5ae",
|
|
||||||
"type": "github"
|
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "guibou",
|
"path": "out-of-tree/nixGL",
|
||||||
"repo": "nixGL",
|
"type": "path"
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
|
@ -154,11 +151,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1672262501,
|
"lastModified": 1672617983,
|
||||||
"narHash": "sha256-ZNXqX9lwYo1tOFAqrVtKTLcJ2QMKCr3WuIvpN8emp7I=",
|
"narHash": "sha256-68WDiCBs631mbDDk4UAKdGURKcsfW6hjb7wgudTAe5o=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e182da8622a354d44c39b3d7a542dc12cd7baa5f",
|
"rev": "0fc9fca9c8d43edd79d33fea0dd8409d7c4580f4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -201,11 +198,11 @@
|
||||||
"nixpkgs": "nixpkgs_3"
|
"nixpkgs": "nixpkgs_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1672367043,
|
"lastModified": 1672712534,
|
||||||
"narHash": "sha256-4/40kfJysfDEfSpXJ3inuMetn40czz5Mh73SjxsKTX0=",
|
"narHash": "sha256-8S0DdMPcbITnlOu0uA81mTo3hgX84wK8S9wS34HEFY4=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "e6b2214363f5e18576a3b2ca0e0483d8f42fe531",
|
"rev": "69fb7bf0a8c40e6c4c197fa1816773774c8ac59f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
nixgl.url = "github:guibou/nixGL";
|
nixgl.url = "path:out-of-tree/nixGL";
|
||||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||||
# Allows default.nix to call onto flake.nix. Useful for nix eval and automations
|
# Allows default.nix to call onto flake.nix. Useful for nix eval and automations
|
||||||
flake-compat = {
|
flake-compat = {
|
||||||
|
|
|
@ -56,9 +56,5 @@ in
|
||||||
KEEPASSDB_TIMEOUT = cfg.copy_timeout_secs;
|
KEEPASSDB_TIMEOUT = cfg.copy_timeout_secs;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
# xdg.dataFile."keepass.kdbx".path =
|
|
||||||
# base.shells.shellAliases = {
|
|
||||||
# kp = "kpcli --kdb=${cfg.path}";
|
|
||||||
# };
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,9 +47,12 @@ let
|
||||||
|
|
||||||
# Language-specific stuffs
|
# Language-specific stuffs
|
||||||
pkgs.sumneko-lua-language-server
|
pkgs.sumneko-lua-language-server
|
||||||
pkgs.rust-analyzer
|
# TODO: the devShell should provide rust-analyzer so that
|
||||||
rust_pkgs
|
# cargo test builds binaries compatible with rust-analyzer
|
||||||
pkgs.evcxr # Rust REPL for Conjure!
|
|
||||||
|
# pkgs.rust-analyzer
|
||||||
|
# rust_pkgs
|
||||||
|
# pkgs.evcxr # Rust REPL for Conjure!
|
||||||
|
|
||||||
# Python3 as alternative to bash scripts :^)
|
# Python3 as alternative to bash scripts :^)
|
||||||
# (pkgs.python310Full.withPackages (pypkgs: [
|
# (pkgs.python310Full.withPackages (pypkgs: [
|
||||||
|
@ -77,6 +80,11 @@ in
|
||||||
vimAlias = true;
|
vimAlias = true;
|
||||||
withPython3 = true;
|
withPython3 = true;
|
||||||
withNodeJs = true;
|
withNodeJs = true;
|
||||||
|
# Attempt 4: Correct way to make neovim aware of packages
|
||||||
|
# homeConfigurations.config.programs.neovim takes UNWRAPPED neovim
|
||||||
|
# and wraps it.
|
||||||
|
# Ideally, we build our own neovim and add that to config.home.packages
|
||||||
|
# to share it with nixOS. But we don't really need to share
|
||||||
extraPackages = nvim_pkgs;
|
extraPackages = nvim_pkgs;
|
||||||
# only for here for archive-documentation
|
# only for here for archive-documentation
|
||||||
# extraPython3Packages = (pypkgs: [
|
# extraPython3Packages = (pypkgs: [
|
||||||
|
|
|
@ -69,11 +69,11 @@
|
||||||
"utils": "utils"
|
"utils": "utils"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1672349765,
|
"lastModified": 1672770368,
|
||||||
"narHash": "sha256-Ul3lSGglgHXhgU3YNqsNeTlRH1pqxbR64h+2hM+HtnM=",
|
"narHash": "sha256-iO6Z9blIe8dcPh3VT2nkej9EimORCoskGQR6xNjICWI=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "dd99675ee81fef051809bc87d67eb07f5ba022e8",
|
"rev": "d01e7280ad7d13a5a0fae57355bd0dbfe5b81969",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -106,11 +106,11 @@
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
"lastModified": 1,
|
||||||
"narHash": "sha256-KP+2qdZlhmRkrafuuEofg7YnNdVmGV95ipvpuqmJneI=",
|
"narHash": "sha256-KP+2qdZlhmRkrafuuEofg7YnNdVmGV95ipvpuqmJneI=",
|
||||||
"path": "/nix/store/qcm4676fqkcdrizjkn4j0796ybddwlxm-source/out-of-tree/nixGL",
|
"path": "./../../out-of-tree/nixGL",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/nix/store/qcm4676fqkcdrizjkn4j0796ybddwlxm-source/out-of-tree/nixGL",
|
"path": "./../../out-of-tree/nixGL",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -131,11 +131,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1672262501,
|
"lastModified": 1672617983,
|
||||||
"narHash": "sha256-ZNXqX9lwYo1tOFAqrVtKTLcJ2QMKCr3WuIvpN8emp7I=",
|
"narHash": "sha256-68WDiCBs631mbDDk4UAKdGURKcsfW6hjb7wgudTAe5o=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e182da8622a354d44c39b3d7a542dc12cd7baa5f",
|
"rev": "0fc9fca9c8d43edd79d33fea0dd8409d7c4580f4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -178,11 +178,11 @@
|
||||||
"nixpkgs": "nixpkgs_3"
|
"nixpkgs": "nixpkgs_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1672367043,
|
"lastModified": 1672712534,
|
||||||
"narHash": "sha256-4/40kfJysfDEfSpXJ3inuMetn40czz5Mh73SjxsKTX0=",
|
"narHash": "sha256-8S0DdMPcbITnlOu0uA81mTo3hgX84wK8S9wS34HEFY4=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "e6b2214363f5e18576a3b2ca0e0483d8f42fe531",
|
"rev": "69fb7bf0a8c40e6c4c197fa1816773774c8ac59f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
nixgl.url = "./../../out-of-tree/nixGL";
|
nixgl.url = "path:./../../out-of-tree/nixGL";
|
||||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||||
# Allows default.nix to call onto flake.nix. Useful for nix eval and automations
|
# Allows default.nix to call onto flake.nix. Useful for nix eval and automations
|
||||||
flake-compat = {
|
flake-compat = {
|
||||||
|
|
|
@ -22,11 +22,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671359686,
|
"lastModified": 1672525397,
|
||||||
"narHash": "sha256-3MpC6yZo+Xn9cPordGz2/ii6IJpP2n8LE8e/ebUXLrs=",
|
"narHash": "sha256-WASDnyxHKWVrEe0dIzkpH+jzKlCKAk0husv0f/9pyxg=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "04f574a1c0fde90b51bf68198e2297ca4e7cccf4",
|
"rev": "8ba56d7c0d7490680f2d51ba46a141eca7c46afa",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -7,6 +7,9 @@ echo "SCRIPT_DIR: ${SCRIPT_DIR}"
|
||||||
|
|
||||||
HOME_MANAGER_DIR="${SCRIPT_DIR}/../nix-conf/home-manager"
|
HOME_MANAGER_DIR="${SCRIPT_DIR}/../nix-conf/home-manager"
|
||||||
|
|
||||||
|
# Mason is bad: it puts binaries onto xdg.data
|
||||||
|
rm -rf ~/.local/share/nvim/mason
|
||||||
|
|
||||||
# test if we have home-manager, if not, attempt to use nix to put home-manager to
|
# test if we have home-manager, if not, attempt to use nix to put home-manager to
|
||||||
# our environment
|
# our environment
|
||||||
if [ $(home-manager >/dev/null 2>&1) ]; then
|
if [ $(home-manager >/dev/null 2>&1) ]; then
|
||||||
|
|
|
@ -12,4 +12,8 @@
|
||||||
path = ./rust-monorepo;
|
path = ./rust-monorepo;
|
||||||
description = "Opinionated Rust monorepo, extended from ./rust, using Cargo workspace";
|
description = "Opinionated Rust monorepo, extended from ./rust, using Cargo workspace";
|
||||||
};
|
};
|
||||||
|
ts-turborepo = {
|
||||||
|
path = ./ts/turborepo;
|
||||||
|
description = "Typescript monorepo with tsconfig, eslint, but with minimal framework attached";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,23 +11,21 @@
|
||||||
let
|
let
|
||||||
overlays = [ rust-overlay.overlays.default ];
|
overlays = [ rust-overlay.overlays.default ];
|
||||||
pkgs = import nixpkgs { inherit system overlays; };
|
pkgs = import nixpkgs { inherit system overlays; };
|
||||||
|
rust_pkgs = (pkgs.rust-bin.selectLatestNightlyWith
|
||||||
|
(
|
||||||
|
toolchain:
|
||||||
|
toolchain.default.override {
|
||||||
|
extensions = [ "rust-src" "rust-analyzer" "rust-docs" "clippy" "miri" ];
|
||||||
|
}
|
||||||
|
));
|
||||||
naersk-lib = pkgs.callPackage naersk { };
|
naersk-lib = pkgs.callPackage naersk { };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
defaultPackage = naersk-lib.buildPackage ./.;
|
defaultPackage = naersk-lib.buildPackage ./.;
|
||||||
devShell = with pkgs; mkShell {
|
devShell = with pkgs; mkShell {
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
(pkgs.rust-bin.selectLatestNightlyWith
|
rust_pkgs
|
||||||
(
|
|
||||||
toolchain:
|
|
||||||
toolchain.default.override {
|
|
||||||
extensions = [ "rust-src" ];
|
|
||||||
}
|
|
||||||
))
|
|
||||||
pkgs.rust-analyzer
|
|
||||||
pkgs.bacon # rust background code checker
|
|
||||||
];
|
];
|
||||||
RUST_SRC_PATH = rustPlatform.rustLibSrc;
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
# nix flake update # is this even needed?
|
# nix flake update # is this even needed?
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
{
|
||||||
|
description = "Provides devShell for Nodejs + pnpm";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
# https://github.com/vercel/turbo/issues/2293#issuecomment-1296094236
|
||||||
|
# work-around for turbo-repo on nix
|
||||||
|
turbo.url = "github:dlip/turbo";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, turbo, flake-utils, nixpkgs }:
|
||||||
|
with flake-utils; lib.eachSystem lib.defaultSystems (sys:
|
||||||
|
let
|
||||||
|
overlays = [ turbo.overlay ];
|
||||||
|
# pkgs is our tweaked nixpkgs
|
||||||
|
pkgs = import nixpkgs { system = sys; overlays = overlays; };
|
||||||
|
shellMsg = ''
|
||||||
|
echo "Hello from nix ${sys}"
|
||||||
|
echo "Local development may use our remote planetscale database (pscale login && pnpm dev:infra; pnpm dev)"
|
||||||
|
echo "Or from the specified docker-compose.yml (pnpm dev:local_infra && pnpm dev)"
|
||||||
|
echo "See more on CONTRIBUTING.md"
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
devShell = pkgs.mkShell {
|
||||||
|
nativeBuildInputs = [ pkgs.bashInteractive ];
|
||||||
|
buildInputs = [
|
||||||
|
pkgs.nodejs-18_x
|
||||||
|
pkgs.nodePackages.pnpm
|
||||||
|
pkgs.nodePackages.prisma
|
||||||
|
pkgs.prisma-engines
|
||||||
|
pkgs.turbo
|
||||||
|
# pkgs.turbo-tooling
|
||||||
|
pkgs.jq
|
||||||
|
pkgs.pscale
|
||||||
|
pkgs.act # Github workflow
|
||||||
|
];
|
||||||
|
shellHook =
|
||||||
|
# https://github.com/prisma/prisma/issues/3026#issuecomment-927258138
|
||||||
|
# nix-direnv is required (impure build?) https://github.com/nix-community/nix-direnv
|
||||||
|
''
|
||||||
|
export PRISMA_MIGRATION_ENGINE_BINARY="${pkgs.prisma-engines}/bin/migration-engine"
|
||||||
|
export PRISMA_QUERY_ENGINE_BINARY="${pkgs.prisma-engines}/bin/query-engine"
|
||||||
|
export PRISMA_QUERY_ENGINE_LIBRARY="${pkgs.prisma-engines}/lib/libquery_engine.node"
|
||||||
|
export PRISMA_INTROSPECTION_ENGINE_BINARY="${pkgs.prisma-engines}/bin/introspection-engine"
|
||||||
|
export PRISMA_FMT_BINARY="${pkgs.prisma-engines}/bin/prisma-fmt"
|
||||||
|
export TURBO_BINARY_PATH="${pkgs.turbo}/bin/turbo"
|
||||||
|
pnpm install
|
||||||
|
'' + shellMsg;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in New Issue