This commit is contained in:
Danilo Reyes
2026-03-16 16:16:32 -06:00
parent 4f4c23d1df
commit 195c55891e
35 changed files with 430 additions and 469 deletions

View File

@@ -7,7 +7,7 @@
...
}:
let
shellType = inputs.self.lib.hmShellType config osConfig;
shellType = inputs.self.lib.hmShellType osConfig "zsh";
hm = inputs.self.lib.hmModule {
inherit
config
@@ -39,7 +39,7 @@ in
"doom/templates/programming.org".source = ../../../dotfiles/doom/templates/programming.org;
};
services = {
lorri.enable = true;
lorri.enable = pkgs.stdenv.isLinux;
emacs = {
enable = true;
defaultEditor = true;

View File

@@ -7,7 +7,7 @@
...
}:
let
shellType = inputs.self.lib.hmShellType config osConfig;
shellType = inputs.self.lib.hmShellType osConfig "zsh";
hm = inputs.self.lib.hmModule {
inherit
config

View File

@@ -1,43 +0,0 @@
{
config,
inputs,
lib,
pkgs,
...
}:
let
packages = builtins.attrValues {
inherit (pkgs)
shellcheck # Shell script linter
shfmt # Shell parser and formatter
;
# LSP for Bash and sh
inherit (pkgs.nodePackages) bash-language-server;
};
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 = pkgs.mkShell {
inherit packages;
name = "sh-dev-shell";
shellHook = ''
echo "💻 Shell scripting dev environment"
'';
};
description = "Shell scripting dev shell";
};
};
config = lib.mkIf config.my.dev.sh.enable {
users.users = inputs.self.lib.mkUserAttrs lib config.my.dev.sh.users { inherit packages; };
};
}

20
modules/dev/sh/common.nix Normal file
View 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
View 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
View 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";
};
};
}

View File

@@ -7,7 +7,7 @@
...
}:
let
shellType = inputs.self.lib.hmShellType config osConfig;
shellType = inputs.self.lib.hmShellType osConfig "zsh";
enabled =
inputs.self.lib.hmOnlyUser config osConfig "jawz"
&& (osConfig.my.units.download.enable || osConfig.my.units.downloadManga.enable);

View File

@@ -1,29 +0,0 @@
{
config,
inputs,
lib,
pkgs,
...
}:
{
options.my.shell.exercism = {
enable = lib.mkEnableOption "Exercism coding practice platform";
users = lib.mkOption {
type = inputs.self.lib.usersOptionType lib;
default = config.my.toggleUsers.shell;
description = "Users to install Exercism for";
};
};
config = lib.mkIf config.my.shell.exercism.enable {
users.users =
let
packages = builtins.attrValues {
inherit (pkgs)
exercism # learn to code
bats # testing system, required by Exercism
;
};
in
inputs.self.lib.mkUserPackages lib config.my.shell.exercism.users packages;
};
}

View File

@@ -0,0 +1,9 @@
{ pkgs }:
{
packages = builtins.attrValues {
inherit (pkgs)
exercism
bats
;
};
}

View File

@@ -0,0 +1,34 @@
{
config,
inputs,
lib,
osConfig ? null,
pkgs,
...
}:
let
hm = inputs.self.lib.hmModule {
inherit
config
inputs
osConfig
;
optionPath = [
"shell"
"exercism"
];
};
cfg = config.my.shell.exercism;
exercism = import ./common.nix { inherit pkgs; };
in
{
options.my.shell.exercism.enable = lib.mkEnableOption "Exercism coding practice platform";
config = lib.mkMerge [
{
my.shell.exercism.enable = lib.mkDefault hm.enabledByDefault;
}
(lib.mkIf cfg.enable {
home.packages = exercism.packages;
})
];
}

View File

@@ -0,0 +1,16 @@
{
config,
inputs,
lib,
...
}:
{
options.my.shell.exercism = {
enable = lib.mkEnableOption "Exercism coding practice platform";
users = lib.mkOption {
type = inputs.self.lib.usersOptionType lib;
default = config.my.toggleUsers.shell;
description = "Users to install Exercism for";
};
};
}

View File

@@ -7,7 +7,7 @@
...
}:
let
shellType = inputs.self.lib.hmShellType config osConfig;
shellType = inputs.self.lib.hmShellType osConfig "zsh";
hm = inputs.self.lib.hmModule {
inherit
config

View File

@@ -7,7 +7,7 @@
...
}:
let
shellType = inputs.self.lib.hmShellType config osConfig;
shellType = inputs.self.lib.hmShellType osConfig "zsh";
hm = inputs.self.lib.hmModule {
inherit
config