feat(nvim): expose devShells through my flake
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-12-22 00:27:24 -05:00
parent 346077c0e0
commit b8d9e9ff92
3 changed files with 105 additions and 77 deletions

View file

@ -1,6 +1,12 @@
{pkgs, ...}: let
{
pkgs,
self,
...
}: let
inherit (builtins) attrValues;
langsShells = import ./langs.nix {inherit pkgs self;};
bumpNpmDeps = pkgs.writeShellApplication {
name = "bumpNpmDeps";
runtimeInputs = attrValues {
@ -16,91 +22,93 @@
prefetch-npm-deps ./package-lock.json
'';
};
in {
default = pkgs.mkShell {
packages = [
(pkgs.writeShellApplication {
name = "mkIso";
in
{
default = pkgs.mkShell {
packages = [
(pkgs.writeShellApplication {
name = "mkIso";
runtimeInputs = attrValues {
inherit
(pkgs)
nix-output-monitor
;
};
runtimeInputs = attrValues {
inherit
(pkgs)
nix-output-monitor
;
};
text = ''
isoConfig="nixosConfigurations.live-image.config.system.build.isoImage"
nom build "$FLAKE#$isoConfig"
'';
})
text = ''
isoConfig="nixosConfigurations.live-image.config.system.build.isoImage"
nom build "$FLAKE#$isoConfig"
'';
})
(pkgs.writeShellApplication {
name = "fixUidChange";
(pkgs.writeShellApplication {
name = "fixUidChange";
runtimeInputs = attrValues {
inherit
(pkgs)
findutils
gnused
;
};
runtimeInputs = attrValues {
inherit
(pkgs)
findutils
gnused
;
};
text = ''
GROUP="$1"
OLD_GID="$2"
NEW_GID="$3"
text = ''
GROUP="$1"
OLD_GID="$2"
NEW_GID="$3"
# Remove generated group entry
sudo sed -i -e "/^$GROUP:/d" /etc/group
# Remove generated group entry
sudo sed -i -e "/^$GROUP:/d" /etc/group
# Change GID on existing files
sudo find / -gid "$OLD_GID" -exec chgrp "$NEW_GID" {} +
'';
})
];
};
netdaemon = pkgs.mkShell {
packages = attrValues {
inherit
(pkgs.dotnetCorePackages)
sdk_9_0
;
# Change GID on existing files
sudo find / -gid "$OLD_GID" -exec chgrp "$NEW_GID" {} +
'';
})
];
};
};
node = pkgs.mkShell {
packages = attrValues {
inherit
(pkgs)
nodejs_latest
typescript
;
inherit
bumpNpmDeps
;
netdaemon = pkgs.mkShell {
packages = attrValues {
inherit
(pkgs.dotnetCorePackages)
sdk_9_0
;
};
};
};
subtitles-dev = pkgs.mkShell {
packages = attrValues {
inherit
(pkgs)
nodejs_latest
typescript
ffmpeg-full
;
node = pkgs.mkShell {
packages = attrValues {
inherit
(pkgs)
nodejs_latest
typescript
;
inherit
(pkgs.nodePackages)
ts-node
;
inherit
bumpNpmDeps
;
inherit
bumpNpmDeps
;
};
};
};
}
subtitles-dev = pkgs.mkShell {
packages = attrValues {
inherit
(pkgs)
nodejs_latest
typescript
ffmpeg-full
;
inherit
(pkgs.nodePackages)
ts-node
;
inherit
bumpNpmDeps
;
};
};
}
// langsShells

20
devShells/langs.nix Normal file
View file

@ -0,0 +1,20 @@
{
pkgs,
self,
...
}: let
inherit (pkgs.lib) listToAttrs nameValuePair;
mkLangsShells = langs:
listToAttrs (map (l:
nameValuePair l (pkgs.callPackage ../homeManagerModules/neovim/langs/${l}/shell.nix {inherit self;}))
langs);
in
mkLangsShells [
"csharp"
"json"
"lua"
"markdown"
"rust"
"web"
"c-lang"
]

View file

@ -141,7 +141,7 @@
devShells =
perSystem (pkgs:
import ./devShells {inherit pkgs;});
import ./devShells {inherit pkgs self;});
packages =
perSystem (pkgs: