just: add module

This commit is contained in:
maximsmol 2022-02-18 16:57:35 -08:00 committed by Robert Helgesson
parent d119cea376
commit 87beebc7a2
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
5 changed files with 68 additions and 0 deletions

2
.github/CODEOWNERS vendored
View file

@ -119,6 +119,8 @@
/modules/programs/java.nix @ShamrockLee
/modules/programs/just.nix @maximsmol
/modules/programs/keychain.nix @marsam
/modules/programs/kodi.nix @dwagenk

View file

@ -111,6 +111,12 @@
githubId = 46252070;
name = "Sara Johnsson";
};
maximsmol = {
email = "maximsmol@gmail.com";
github = "maximsmol";
githubId = 1472826;
name = "Max Smolin";
};
msfjarvis = {
email = "me@msfjarvis.dev";
github = "msfjarvis";

View file

@ -2442,6 +2442,13 @@ in
Use this to enable services based on macOS LaunchAgents.
'';
}
{
time = "2022-03-06T08:50:32+00:00";
message = ''
A new module is available: 'programs.just'.
'';
}
];
};
}

View file

@ -87,6 +87,7 @@ let
./programs/irssi.nix
./programs/java.nix
./programs/jq.nix
./programs/just.nix
./programs/kakoune.nix
./programs/keychain.nix
./programs/kitty.nix

52
modules/programs/just.nix Normal file
View file

@ -0,0 +1,52 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.just;
in {
meta.maintainers = [ hm.maintainers.maximsmol ];
options.programs.just = {
enable = mkEnableOption
"just, a handy way to save and run project-specific commands";
package = mkOption {
type = types.package;
default = pkgs.just;
defaultText = literalExpression "pkgs.just";
description = "Package providing the <command>just</command> tool.";
};
enableBashIntegration = mkEnableOption "Bash integration" // {
default = true;
};
enableZshIntegration = mkEnableOption "Zsh integration" // {
default = true;
};
enableFishIntegration = mkEnableOption "Fish integration" // {
default = true;
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
source ${cfg.package}/share/bash-completion/completions/just.bash
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
source ${cfg.package}/share/zsh/site-functions/_just
'';
programs.fish.shellInit = mkIf cfg.enableFishIntegration ''
source ${cfg.package}/share/fish/vendor_completions.d/just.fish
'';
};
}