earthly: init module (#6265)
Earthly is a build configuration framework utilizing buildkit and Dockerfile-like syntax for simplicity and fast builds.
This commit is contained in:
parent
c31b4e330e
commit
2b382e499a
8 changed files with 86 additions and 0 deletions
|
|
@ -667,4 +667,10 @@
|
|||
fingerprint = "AD32 73D4 5E0E 9478 E826 543F EDB2 C634 166A E6AD";
|
||||
}];
|
||||
};
|
||||
folliehiyuki = {
|
||||
name = "Hoang Nguyen";
|
||||
email = "folliekazetani@protonmail.com";
|
||||
github = "folliehiyuki";
|
||||
githubId = 67634026;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2084,6 +2084,16 @@ in {
|
|||
screen brightness based on the screen contents and amount of ambient light around you.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2025-02-21T16:53:20+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.earthly'.
|
||||
|
||||
Earthly is a build configuration framework utilizing buildkit and
|
||||
Dockerfile-like syntax for fast builds and simplicity.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ let
|
|||
./programs/dircolors.nix
|
||||
./programs/direnv.nix
|
||||
./programs/discocss.nix
|
||||
./programs/earthly.nix
|
||||
./programs/eclipse.nix
|
||||
./programs/emacs.nix
|
||||
./programs/eww.nix
|
||||
|
|
|
|||
40
modules/programs/earthly.nix
Normal file
40
modules/programs/earthly.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.earthly;
|
||||
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
|
||||
in {
|
||||
meta.maintainers = [ lib.hm.maintainers.folliehiyuki ];
|
||||
|
||||
options.programs.earthly = {
|
||||
enable = lib.mkEnableOption "earthly";
|
||||
|
||||
package = lib.mkPackageOption pkgs "earthly" { };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = yamlFormat.type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to ~/.earthly/config.yml file.
|
||||
See https://docs.earthly.dev/docs/earthly-config for supported values.
|
||||
'';
|
||||
example = lib.literalExpression ''
|
||||
global = {
|
||||
disable_analytics = true;
|
||||
disable_log_sharing = true;
|
||||
};
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
home.file.".earthly/config.yml" = lib.mkIf (cfg.settings != { }) {
|
||||
source = yamlFormat.generate "earthly-config" cfg.settings;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -146,6 +146,7 @@ in import nmtSrc {
|
|||
./modules/programs/darcs
|
||||
./modules/programs/dircolors
|
||||
./modules/programs/direnv
|
||||
./modules/programs/earthly
|
||||
./modules/programs/emacs
|
||||
./modules/programs/fastfetch
|
||||
./modules/programs/feh
|
||||
|
|
|
|||
1
tests/modules/programs/earthly/default.nix
Normal file
1
tests/modules/programs/earthly/default.nix
Normal file
|
|
@ -0,0 +1 @@
|
|||
{ earthly-settings = ./earthly-settings.nix; }
|
||||
21
tests/modules/programs/earthly/earthly-settings.nix
Normal file
21
tests/modules/programs/earthly/earthly-settings.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
programs.earthly = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
global.disable_analytics = true;
|
||||
|
||||
git."github.com" = {
|
||||
auth = "ssh";
|
||||
user = "username";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs.earthly = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.earthly/config.yml
|
||||
assertFileContent home-files/.earthly/config.yml ${./earthly-settings.yml}
|
||||
'';
|
||||
}
|
||||
6
tests/modules/programs/earthly/earthly-settings.yml
Normal file
6
tests/modules/programs/earthly/earthly-settings.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
git:
|
||||
github.com:
|
||||
auth: ssh
|
||||
user: username
|
||||
global:
|
||||
disable_analytics: true
|
||||
Loading…
Add table
Add a link
Reference in a new issue