refactor: pull out flake devshells

This commit is contained in:
2025-07-17 15:48:20 +00:00
parent 33422320a5
commit 3d0fd7a030
7 changed files with 109 additions and 64 deletions

17
devshell/c.nix Normal file
View File

@@ -0,0 +1,17 @@
{
system,
pkgs,
self
}: pkgs.mkShell {
buildInputs = (with pkgs; [
inotify-tools
gdb
gcc
]) ++ (with self.packages.${system}; [
c-hectic
nvim-pager
watch
]);
PAGER = "${self.packages.${system}.nvim-pager}/bin/pager";
}

24
devshell/default.nix Normal file
View File

@@ -0,0 +1,24 @@
{
system,
pkgs,
self
}: pkgs.mkShell {
buildInputs =
(with self.packages.${system}; [
nvim-alias
#prettify-log
nvim-pager
])
++ (with pkgs; [
git
jq
yq-go
curl
(writeScriptBin "hemar-check" ''
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null vm-postgres 'zsh -c check'
'')
]);
# environment
PAGER = "${self.packages.${system}.nvim-pager}/bin/pager";
}

8
devshell/haskell.nix Normal file
View File

@@ -0,0 +1,8 @@
{
system,
pkgs,
self
}: self.devShells.${system}.default
// (pkgs.mkShell {
buildInputs = [pkgs.stack];
})

22
devshell/postgres-c.nix Normal file
View File

@@ -0,0 +1,22 @@
{
system,
pkgs,
self
}: pkgs.mkShell {
buildInputs = (with pkgs; [
inotify-tools
postgresql_15
]) ++ (with self.packages.${system}; [
nvim-pager
]) ++ (with pkgs; [
gdb
gcc
]);
PAGER = "${self.packages.${system}.nvim-pager}/bin/pager";
shellHook = ''
export PATH=${pkgs.gcc}/bin:$PATH
export PAGER="${self.packages.${system}.nvim-pager}/bin/pager"
'';
}

14
devshell/pure-c.nix Normal file
View File

@@ -0,0 +1,14 @@
{
system,
pkgs,
self
}: pkgs.mkShell {
buildInputs = (with pkgs; [ inotify-tools ]) ++ (with self.packages.${system}; [ nvim-pager ]) ++ (with pkgs; [ gdb gcc binutils ]);
PAGER = "${self.packages.${system}.nvim-pager}/bin/pager";
shellHook = ''
export PATH=${pkgs.gcc}/bin:$PATH
export PAGER="${self.packages.${system}.nvim-pager}/bin/pager"
'';
}

17
devshell/rust.nix Normal file
View File

@@ -0,0 +1,17 @@
{
self,
pkgs,
system
}: let
rustToolchain =
if builtins.pathExists ./rust-toolchain.toml
then pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml
else pkgs.pkgsBuildHost.rust-bin.stable."1.81.0".default;
in
self.devShells.${system}.default
// (pkgs.mkShell {
nativeBuildInputs = [
rustToolchain
pkgs.pkg-config
];
})