bacon: add module

Bacon is a background rust code checker. See
<https://dystroy.org/bacon/>.
This commit is contained in:
shimun 2023-08-20 10:38:49 +02:00 committed by Robert Helgesson
parent 4a6333265e
commit a88df2fb10
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
8 changed files with 84 additions and 0 deletions

View file

@ -347,6 +347,12 @@
github = "sebtm"; github = "sebtm";
githubId = 17243347; githubId = 17243347;
}; };
shimunn = {
name = "shimun";
email = "home-manager.c.shimun@shimun.net";
github = "shimunn";
githubId = 41011289;
};
rasmus-kirk = { rasmus-kirk = {
name = "Rasmus Kirk"; name = "Rasmus Kirk";
email = "mail@rasmuskirk.com"; email = "mail@rasmuskirk.com";

View file

@ -1230,6 +1230,13 @@ in
Rio is a hardware-accelerated GPU terminal emulator powered by WebGPU. 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'.
'';
}
]; ];
}; };
} }

View file

@ -60,6 +60,7 @@ let
./programs/bash.nix ./programs/bash.nix
./programs/bashmount.nix ./programs/bashmount.nix
./programs/bat.nix ./programs/bat.nix
./programs/bacon.nix
./programs/beets.nix ./programs/beets.nix
./programs/borgmatic.nix ./programs/borgmatic.nix
./programs/bottom.nix ./programs/bottom.nix

View 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;
};
}

View file

@ -62,6 +62,7 @@ import nmt {
./modules/programs/aria2 ./modules/programs/aria2
./modules/programs/atuin ./modules/programs/atuin
./modules/programs/autojump ./modules/programs/autojump
./modules/programs/bacon
./modules/programs/bash ./modules/programs/bash
./modules/programs/bat ./modules/programs/bat
./modules/programs/bottom ./modules/programs/bottom

View 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}
'';
}

View file

@ -0,0 +1 @@
{ bacon-program = ./bacon.nix; }

View 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