refactor: pull out flake devshells
This commit is contained in:
71
flake.nix
71
flake.nix
@@ -27,70 +27,13 @@
|
||||
}: {
|
||||
packages.${system} = import ./package { inherit system pkgs self; };
|
||||
|
||||
devShells.${system} = let
|
||||
shells = self.devShells.${system};
|
||||
in {
|
||||
c = 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";
|
||||
};
|
||||
postgres-c = 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"
|
||||
'';
|
||||
};
|
||||
pure-c = 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"
|
||||
'';
|
||||
};
|
||||
default = 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";
|
||||
};
|
||||
rust = 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
|
||||
shells.default
|
||||
// (pkgs.mkShell {
|
||||
nativeBuildInputs = [
|
||||
rustToolchain
|
||||
pkgs.pkg-config
|
||||
];
|
||||
});
|
||||
haskell =
|
||||
shells.default
|
||||
// (pkgs.mkShell {
|
||||
buildInputs = [pkgs.stack];
|
||||
});
|
||||
devShells.${system} = {
|
||||
c = import ./devshell/c.nix { inherit self system pkgs; };
|
||||
postgres-c = import ./devshell/postgres-c.nix { inherit self system pkgs; };
|
||||
pure-c = import ./devshell/pure-c.nix { inherit self system pkgs; };
|
||||
default = import ./devshell/default.nix { inherit self system pkgs; };
|
||||
rust = import ./devshell/rust.nix { inherit self system pkgs; };
|
||||
haskell = import ./devshell/haskell.nix { inherit self system pkgs; };
|
||||
};
|
||||
nixosConfigurations = {
|
||||
"devvm-manual|${system}" = import ./nixos/system/devvm-manual/default.nix { inherit flake self inputs system; };
|
||||
|
||||
Reference in New Issue
Block a user