Skip to content

Commit

Permalink
feat(nix): add develop suite
Browse files Browse the repository at this point in the history
  • Loading branch information
sbulav committed Jan 31, 2024
1 parent c067c99 commit 7fd624e
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 3 deletions.
24 changes: 24 additions & 0 deletions nix/modules/nixos/cli-apps/atuin/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
lib,
config,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.custom.cli-apps.atuin;
in {
options.custom.cli-apps.atuin = {
enable = mkEnableOption "atuin";
};

config = mkIf cfg.enable {
home.programs.atuin = {
enable = true;
# Does not work right now, injecting via fish
enableBashIntegration = true;
enableFishIntegration = true;
enableZshIntegration = true;
};
};
}
1 change: 1 addition & 0 deletions nix/modules/nixos/suites/common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ in {
misc.enable = true;
};
custom.cli-apps = {
atuin.enable = true;
neovim.enable = true;
tmux.enable = true;
};
Expand Down
23 changes: 23 additions & 0 deletions nix/modules/nixos/suites/develop/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.suites.develop;
in {
options.suites.develop = with types; {
enable = mkBoolOpt false "Enable the develop suite";
};

config = mkIf cfg.enable {
custom.tools = {
lsp.enable = true;
linters.enable = true;
k8s.enable = true;
};
};
}
6 changes: 5 additions & 1 deletion nix/modules/nixos/tools/k8s/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ in {
};

config = mkIf cfg.enable {
programs.zsh.shellAliases = {
programs.fish.shellAliases = {
k = "kubecolor";
kk = "kubecolor";
kubectl = "kubecolor";
kc = "kubectx";
kn = "kubens";
Expand All @@ -30,6 +31,9 @@ in {
kubecolor
kubernetes-helm
helmfile
helm-docs
k9s
krew
];
};
}
23 changes: 23 additions & 0 deletions nix/modules/nixos/tools/linters/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.custom.tools.linters;
in {
options.custom.tools.linters = with types; {
enable = mkBoolOpt false "Whether or not to enable linters utilities.";
};

config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
alejandra
ctags
stylua
];
};
}
25 changes: 25 additions & 0 deletions nix/modules/nixos/tools/lsp/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.custom.tools.lsp;
in {
options.custom.tools.lsp = with types; {
enable = mkBoolOpt false "Whether or not to enable lsp utilities.";
};

config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
lua-language-server # LSP for lua
marksman # LSP for markdown
rnix-lsp # LSP for nix
tree-sitter
yamllint
];
};
}
4 changes: 2 additions & 2 deletions nix/packages/sys/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ writeShellScriptBin "sys" ''
cmd_rebuild() {
echo "🔨 Building system configuration with $REBUILD_COMMAND"
$REBUILD_COMMAND switch --flake .#
$REBUILD_COMMAND switch --flake ~/dotfiles/nix#
}
cmd_test() {
echo "🏗️ Building ephemeral system configuration with $REBUILD_COMMAND"
$REBUILD_COMMAND test --fast --flake .#
$REBUILD_COMMAND test --fast --flake ~/dotfiles/nix#
}
# TODO: Make it update a single input
Expand Down
1 change: 1 addition & 0 deletions nix/systems/x86_64-linux/nz/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

suites.common.enable = true; # Enables the basics, like audio, networking, ssh, etc.
suites.desktop.enable = true;
suites.develop.enable = true;

# ======================== DO NOT CHANGE THIS ========================
system.stateVersion = "23.11";
Expand Down

0 comments on commit 7fd624e

Please sign in to comment.