host mac
This commit is contained in:
20
modules/dev/sh/common.nix
Normal file
20
modules/dev/sh/common.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ pkgs }:
|
||||
let
|
||||
packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
shellcheck
|
||||
shfmt
|
||||
;
|
||||
inherit (pkgs.nodePackages) bash-language-server;
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit packages;
|
||||
devShell = pkgs.mkShell {
|
||||
inherit packages;
|
||||
name = "sh-dev-shell";
|
||||
shellHook = ''
|
||||
echo "💻 Shell scripting dev environment"
|
||||
'';
|
||||
};
|
||||
}
|
||||
34
modules/dev/sh/home.nix
Normal file
34
modules/dev/sh/home.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
osConfig ? null,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hm = inputs.self.lib.hmModule {
|
||||
inherit
|
||||
config
|
||||
inputs
|
||||
osConfig
|
||||
;
|
||||
optionPath = [
|
||||
"dev"
|
||||
"sh"
|
||||
];
|
||||
};
|
||||
cfg = config.my.dev.sh;
|
||||
sh = import ./common.nix { inherit pkgs; };
|
||||
in
|
||||
{
|
||||
options.my.dev.sh.enable = lib.mkEnableOption "Install shell scripting tools globally";
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
my.dev.sh.enable = lib.mkDefault hm.enabledByDefault;
|
||||
}
|
||||
(lib.mkIf cfg.enable {
|
||||
home.packages = sh.packages;
|
||||
})
|
||||
];
|
||||
}
|
||||
27
modules/dev/sh/nixos.nix
Normal file
27
modules/dev/sh/nixos.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
sh = import ./common.nix { inherit pkgs; };
|
||||
in
|
||||
{
|
||||
options = {
|
||||
my.dev.sh = {
|
||||
enable = lib.mkEnableOption "Install shell scripting tools globally";
|
||||
users = lib.mkOption {
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.dev;
|
||||
description = "Users to install shell scripting packages for";
|
||||
};
|
||||
};
|
||||
devShells.sh = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = sh.devShell;
|
||||
description = "Shell scripting dev shell";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user