refactor: pull out flake devshells
This commit is contained in:
17
devshell/c.nix
Normal file
17
devshell/c.nix
Normal 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
24
devshell/default.nix
Normal 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
8
devshell/haskell.nix
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
system,
|
||||||
|
pkgs,
|
||||||
|
self
|
||||||
|
}: self.devShells.${system}.default
|
||||||
|
// (pkgs.mkShell {
|
||||||
|
buildInputs = [pkgs.stack];
|
||||||
|
})
|
||||||
22
devshell/postgres-c.nix
Normal file
22
devshell/postgres-c.nix
Normal 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
14
devshell/pure-c.nix
Normal 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
17
devshell/rust.nix
Normal 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
|
||||||
|
];
|
||||||
|
})
|
||||||
71
flake.nix
71
flake.nix
@@ -27,70 +27,13 @@
|
|||||||
}: {
|
}: {
|
||||||
packages.${system} = import ./package { inherit system pkgs self; };
|
packages.${system} = import ./package { inherit system pkgs self; };
|
||||||
|
|
||||||
devShells.${system} = let
|
devShells.${system} = {
|
||||||
shells = self.devShells.${system};
|
c = import ./devshell/c.nix { inherit self system pkgs; };
|
||||||
in {
|
postgres-c = import ./devshell/postgres-c.nix { inherit self system pkgs; };
|
||||||
c = pkgs.mkShell {
|
pure-c = import ./devshell/pure-c.nix { inherit self system pkgs; };
|
||||||
buildInputs = (with pkgs; [inotify-tools gdb gcc]) ++ (with self.packages.${system}; [c-hectic nvim-pager watch]);
|
default = import ./devshell/default.nix { inherit self system pkgs; };
|
||||||
PAGER = "${self.packages.${system}.nvim-pager}/bin/pager";
|
rust = import ./devshell/rust.nix { inherit self system pkgs; };
|
||||||
};
|
haskell = import ./devshell/haskell.nix { inherit self system pkgs; };
|
||||||
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];
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
"devvm-manual|${system}" = import ./nixos/system/devvm-manual/default.nix { inherit flake self inputs system; };
|
"devvm-manual|${system}" = import ./nixos/system/devvm-manual/default.nix { inherit flake self inputs system; };
|
||||||
|
|||||||
Reference in New Issue
Block a user