update: devShells: inputs

This commit is contained in:
L-Nafaryus 2024-04-20 01:34:48 +05:00
parent 001cb9222a
commit 6cf4c1f9d4
Signed by: L-Nafaryus
GPG Key ID: 582F8B0866B294A1
8 changed files with 67 additions and 49 deletions

8
devShells/bonfire.nix Normal file
View File

@ -0,0 +1,8 @@
{ crane-lib, pkgs, ... }:
crane-lib.devShell {
packages = with pkgs; [
# nil
jq
cachix
];
}

View File

@ -1,23 +1,30 @@
# self.devShells.${system} # self.devShells.${system}
# #
{ self, nixpkgs, crane, ... }: { self, nixpkgs, ... }:
let let
forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" ]; forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" ];
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in forAllSystems(system: let in forAllSystems(system:
let environment = {
pkgs = nixpkgsFor.${system}; pkgs = nixpkgsFor.${system};
bpkgs = self.packages.${system};
blib = self.lib; bonfire = self;
cranelib = crane.lib.${system}; bonfire-lib = self.lib;
in { bonfire-pkgs = self.packages.${system};
crane = self.inputs.crane;
crane-lib = self.inputs.crane.lib.${system};
}; in {
netgen = import ./netgen.nix { inherit pkgs bpkgs; }; default = import ./bonfire.nix environment;
openfoam = import ./openfoam.nix { inherit pkgs bpkgs; }; netgen = import ./netgen.nix environment;
rust = import ./rust.nix { inherit pkgs cranelib; }; openfoam = import ./openfoam.nix environment;
rust-x11 = import ./rust-x11.nix { inherit pkgs cranelib; };
go = import ./go.nix { inherit pkgs; }; rust = import ./rust.nix environment;
rust-x11 = import ./rust-x11.nix environment;
go = import ./go.nix environment;
}) })

View File

@ -1,4 +1,11 @@
{ pkgs, ... }: { pkgs, ... }:
pkgs.mkShell { pkgs.mkShellNoCC {
buildInputs = with pkgs; [ go gopls gotools go-tools golangci-lint gnumake ]; packages = with pkgs; [
go
gopls
gotools
go-tools
golangci-lint
gnumake
];
} }

View File

@ -1,15 +1,9 @@
{ pkgs, bpkgs, ... }: { pkgs, bonfire-pkgs, ... }:
let pkgs.mkShellNoCC {
python = pkgs.python3.withPackages(ps: []); packages = [
bonfire-pkgs.netgen
in pkgs.mkShellNoCC { pkgs.python3
packages = with pkgs; [
bpkgs.netgen
python
]; ];
shellHook = '' shellHook = bonfire-pkgs.netgen.passthru.shellHook;
export PYTHONPATH="${python}/${python.sitePackages}"
export PYTHONPATH="$PYTHONPATH:${bpkgs.netgen}/${python.sitePackages}"
'';
} }

View File

@ -1,11 +1,9 @@
{ pkgs, bpkgs, ... }: { pkgs, bonfire-pkgs, ... }:
pkgs.mkShellNoCC { pkgs.mkShellNoCC {
packages = with pkgs; [ packages = [
bpkgs.openfoam bonfire-pkgs.openfoam
mpi pkgs.mpi
]; ];
shellHook = '' shellHook = bonfire-pkgs.openfoam.passthru.shellHook;
. ${bpkgs.openfoam}/OpenFOAM-${bpkgs.openfoam.major}/etc/bashrc
'';
} }

View File

@ -1,21 +1,23 @@
{ pkgs, cranelib, ... }: { pkgs, crane-lib, ... }:
cranelib.devShell { crane-lib.devShell rec {
packages = with pkgs; [ packages = with pkgs; [
libGL
xorg.libXi xorg.libX11 xorg.libXcursor xorg.libXrandr
lld lld
libxkbcommon pkg-config
libGL
vulkan-loader vulkan-loader
vulkan-headers
vulkan-tools
vulkan-validation-layers
xorg.libXi
xorg.libX11
xorg.libXcursor
xorg.libXrandr
libxkbcommon
libudev-zero
alsa-lib
]; ];
shellHook = '' shellHook = ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.lib.makeLibraryPath packages}"
with pkgs; lib.makeLibraryPath [
libGL
xorg.libX11 xorg.libXi xorg.libXcursor xorg.libXrandr
libxkbcommon
vulkan-loader
]
}"
''; '';
} }

View File

@ -1,4 +1,6 @@
{ pkgs, cranelib, ... }: { pkgs, crane-lib, ... }:
cranelib.devShell { crane-lib.devShell {
packages = []; packages = [
pkgs.cargo-watch
];
} }

View File

@ -65,6 +65,6 @@
apps = import ./apps { inherit self nixpkgs; }; apps = import ./apps { inherit self nixpkgs; };
devShells = import ./devShells { inherit self nixpkgs crane; }; devShells = import ./devShells { inherit self nixpkgs; };
}; };
} }