1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-20 01:59:45 +01:00

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";
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";

View file

@ -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'.
'';
}
];
};
}

View file

@ -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

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/atuin
./modules/programs/autojump
./modules/programs/bacon
./modules/programs/bash
./modules/programs/bat
./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