-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Earthly is a build configuration framework utilizing buildkit and Dockerfile-like syntax for simplicity and fast builds.
- Loading branch information
1 parent
c31b4e3
commit 2b382e4
Showing
8 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ earthly-settings = ./earthly-settings.nix; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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} | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
git: | ||
github.com: | ||
auth: ssh | ||
user: username | ||
global: | ||
disable_analytics: true |