mirror of
https://github.com/nix-community/home-manager.git
synced 2024-12-14 11:57:55 +00:00
just: add module
This commit is contained in:
parent
d119cea376
commit
87beebc7a2
5 changed files with 68 additions and 0 deletions
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
|
@ -119,6 +119,8 @@
|
|||
|
||||
/modules/programs/java.nix @ShamrockLee
|
||||
|
||||
/modules/programs/just.nix @maximsmol
|
||||
|
||||
/modules/programs/keychain.nix @marsam
|
||||
|
||||
/modules/programs/kodi.nix @dwagenk
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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
52
modules/programs/just.nix
Normal 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
|
||||
'';
|
||||
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue