mirror of
https://github.com/nix-community/home-manager.git
synced 2024-12-14 11:57:55 +00:00
bacon: add module
Bacon is a background rust code checker. See <https://dystroy.org/bacon/>.
This commit is contained in:
parent
4a6333265e
commit
a88df2fb10
8 changed files with 84 additions and 0 deletions
|
@ -347,6 +347,12 @@
|
|||
github = "sebtm";
|
||||
githubId = 17243347;
|
||||
};
|
||||
shimunn = {
|
||||
name = "shimun";
|
||||
email = "home-manager.c.shimun@shimun.net";
|
||||
github = "shimunn";
|
||||
githubId = 41011289;
|
||||
};
|
||||
rasmus-kirk = {
|
||||
name = "Rasmus Kirk";
|
||||
email = "mail@rasmuskirk.com";
|
||||
|
|
|
@ -1230,6 +1230,13 @@ in
|
|||
Rio is a hardware-accelerated GPU terminal emulator powered by WebGPU.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2023-09-24T10:06:47+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.bacon'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ let
|
|||
./programs/bash.nix
|
||||
./programs/bashmount.nix
|
||||
./programs/bat.nix
|
||||
./programs/bacon.nix
|
||||
./programs/beets.nix
|
||||
./programs/borgmatic.nix
|
||||
./programs/bottom.nix
|
||||
|
|
37
modules/programs/bacon.nix
Normal file
37
modules/programs/bacon.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.bacon;
|
||||
|
||||
settingsFormat = pkgs.formats.toml { };
|
||||
in {
|
||||
meta.maintainers = [ hm.maintainers.shimunn ];
|
||||
|
||||
options.programs.bacon = {
|
||||
enable = mkEnableOption "bacon, a background rust code checker";
|
||||
|
||||
settings = mkOption {
|
||||
type = settingsFormat.type;
|
||||
example = {
|
||||
jobs.default = {
|
||||
command = [ "cargo" "build" "--all-features" "--color" "always" ];
|
||||
need_stdout = true;
|
||||
};
|
||||
};
|
||||
description = ''
|
||||
Bacon configuration.
|
||||
For available settings see <https://dystroy.org/bacon/#global-preferences>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ pkgs.bacon ];
|
||||
|
||||
xdg.configFile."bacon/prefs.toml".source =
|
||||
settingsFormat.generate "prefs.toml" cfg.settings;
|
||||
};
|
||||
}
|
|
@ -62,6 +62,7 @@ import nmt {
|
|||
./modules/programs/aria2
|
||||
./modules/programs/atuin
|
||||
./modules/programs/autojump
|
||||
./modules/programs/bacon
|
||||
./modules/programs/bash
|
||||
./modules/programs/bat
|
||||
./modules/programs/bottom
|
||||
|
|
23
tests/modules/programs/bacon/bacon.nix
Normal file
23
tests/modules/programs/bacon/bacon.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ ... }: {
|
||||
programs.bacon = {
|
||||
enable = true;
|
||||
settings = {
|
||||
jobs = {
|
||||
ta = {
|
||||
command = [ "cargo" "test" "--all-features" "--color" "always" ];
|
||||
need_stdout = true;
|
||||
};
|
||||
};
|
||||
export = {
|
||||
enabled = true;
|
||||
path = ".bacon-locations";
|
||||
line_format = "{kind} {path}:{line}:{column} {message}";
|
||||
};
|
||||
};
|
||||
};
|
||||
test.stubs.bacon = { };
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/bacon/prefs.toml
|
||||
assertFileContent home-files/.config/bacon/prefs.toml ${./expected.toml}
|
||||
'';
|
||||
}
|
1
tests/modules/programs/bacon/default.nix
Normal file
1
tests/modules/programs/bacon/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{ bacon-program = ./bacon.nix; }
|
8
tests/modules/programs/bacon/expected.toml
Normal file
8
tests/modules/programs/bacon/expected.toml
Normal file
|
@ -0,0 +1,8 @@
|
|||
[export]
|
||||
enabled = true
|
||||
line_format = "{kind} {path}:{line}:{column} {message}"
|
||||
path = ".bacon-locations"
|
||||
|
||||
[jobs.ta]
|
||||
command = ["cargo", "test", "--all-features", "--color", "always"]
|
||||
need_stdout = true
|
Loading…
Reference in a new issue