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