Compare commits

...

33 commits

Author SHA1 Message Date
ec4f2a836d
Add profiles 2024-10-01 16:23:38 +02:00
hercules-ci[bot]
90bc855327
Merge pull request #258 from hercules-ci/flake-update
`flake.lock`: Update
2024-08-05 02:44:33 +00:00
Hercules CI Effects
16c4d4d8b8 flake.lock: Update
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7' (2024-07-03)
  → 'github:hercules-ci/flake-parts/8471fe90ad337a8074e957b69ca4d0089218391d' (2024-08-01)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/9f4128e00b0ae8ec65918efeba59db998750ead6' (2024-07-03)
  → 'github:NixOS/nixpkgs/d04953086551086b44b6f3c6b7eeb26294f207da' (2024-08-02)
2024-08-05 02:38:38 +00:00
hercules-ci[bot]
236f9dd82d
Merge pull request #253 from hercules-ci/flake-update
`flake.lock`: Update
2024-07-05 02:50:08 +00:00
Hercules CI Effects
ab9bdaf08f flake.lock: Update
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8' (2024-06-01)
  → 'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7' (2024-07-03)
• Updated input 'hercules-ci-effects':
    'github:hercules-ci/hercules-ci-effects/c0302ec12d569532a6b6bd218f698bc402e93adc' (2024-04-23)
  → 'github:hercules-ci/hercules-ci-effects/11e4b8dc112e2f485d7c97e1cee77f9958f498f5' (2024-06-24)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/57610d2f8f0937f39dbd72251e9614b1561942d8' (2024-05-31)
  → 'github:NixOS/nixpkgs/9f4128e00b0ae8ec65918efeba59db998750ead6' (2024-07-03)
2024-07-05 02:38:52 +00:00
Robert Hensing
555e7ba634
Merge pull request #241 from tomeon/remove-defaultPackage
chore(flake): remove `defaultPackage` output
2024-06-26 13:17:50 +02:00
Robert Hensing
01777136c6
Merge pull request #248 from KiaraGrouwstra/rename-tmpfs-option
rename boot.tmpOnTmpfs -> boot.tmp.useTmpfs
2024-06-24 08:01:23 +02:00
Kiara Grouwstra
8f0549b434 rename boot.tmpOnTmpfs -> boot.tmp.useTmpfs
resolves warning:
trace: Obsolete option `boot.tmpOnTmpfs' is used. It was renamed to
`boot.tmp.useTmpfs'.
c.f.
a5d95ac5fc
2024-06-12 22:14:14 +00:00
hercules-ci[bot]
c24c185e67
Merge pull request #245 from hercules-ci/flake-update
`flake.lock`: Update
2024-06-05 02:52:18 +00:00
Hercules CI Effects
d917218d05 flake.lock: Update
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e' (2024-05-02)
  → 'github:hercules-ci/flake-parts/2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8' (2024-06-01)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/63c3a29ca82437c87573e4c6919b09a24ea61b0f' (2024-05-02)
  → 'github:NixOS/nixpkgs/57610d2f8f0937f39dbd72251e9614b1561942d8' (2024-05-31)
2024-06-05 02:38:23 +00:00
hercules-ci[bot]
e9945eb6cd
Merge pull request #242 from hercules-ci/flake-update
`flake.lock`: Update
2024-05-05 02:48:07 +00:00
Hercules CI Effects
0449d31ffb flake.lock: Update
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/9126214d0a59633752a136528f5f3b9aa8565b7d' (2024-04-01)
  → 'github:hercules-ci/flake-parts/e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e' (2024-05-02)
• Updated input 'hercules-ci-effects':
    'github:hercules-ci/hercules-ci-effects/64e7763d72c1e4c1e5e6472640615b6ae2d40fbf' (2024-03-15)
  → 'github:hercules-ci/hercules-ci-effects/c0302ec12d569532a6b6bd218f698bc402e93adc' (2024-04-23)
• Updated input 'hercules-ci-effects/flake-parts':
    'github:hercules-ci/flake-parts/f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2' (2024-03-01)
  → 'github:hercules-ci/flake-parts/9126214d0a59633752a136528f5f3b9aa8565b7d' (2024-04-01)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/5c24cf2f0a12ad855f444c30b2421d044120c66f' (2024-04-19)
  → 'github:NixOS/nixpkgs/63c3a29ca82437c87573e4c6919b09a24ea61b0f' (2024-05-02)
2024-05-05 02:38:58 +00:00
Matt Schreiber
7e7aa3dfc6
chore(flake): remove defaultPackage output
Follow-up to #240.
2024-04-28 20:35:20 -04:00
Robert Hensing
efa008e12f
Merge pull request #240 from tomeon/defaultPackage-eval-fix
fix(flake): allow `defaultPackage` to evaluate
2024-04-28 20:30:18 +02:00
Matt Schreiber
df306b74bc
fix(flake): allow defaultPackage to evaluate
by adding the missing (and in this case ignored) key/attribute-name
argument to `lib.mapAttrs`.
2024-04-28 11:55:23 -04:00
hercules-ci[bot]
add0e67d2b
Merge pull request #239 from hercules-ci/flake-update
`flake.lock`: Update
2024-04-21 19:36:12 +00:00
Hercules CI Effects
c8c61a3c67 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/fd281bd6b7d3e32ddfa399853946f782553163b5' (2024-04-03)
  → 'github:NixOS/nixpkgs/5c24cf2f0a12ad855f444c30b2421d044120c66f' (2024-04-19)
2024-04-21 17:53:24 +00:00
hercules-ci[bot]
1886d25075
Merge pull request #236 from hercules-ci/flake-update
`flake.lock`: Update
2024-04-05 02:50:56 +00:00
Hercules CI Effects
c2cc3dae34 flake.lock: Update
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2' (2024-03-01)
  → 'github:hercules-ci/flake-parts/9126214d0a59633752a136528f5f3b9aa8565b7d' (2024-04-01)
• Updated input 'hercules-ci-effects':
    'github:hercules-ci/hercules-ci-effects/0ca27bd58e4d5be3135a4bef66b582e57abe8f4a' (2024-02-21)
  → 'github:hercules-ci/hercules-ci-effects/64e7763d72c1e4c1e5e6472640615b6ae2d40fbf' (2024-03-15)
• Updated input 'hercules-ci-effects/flake-parts':
    'github:hercules-ci/flake-parts/34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5' (2023-12-01)
  → 'github:hercules-ci/flake-parts/f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2' (2024-03-01)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/b8697e57f10292a6165a20f03d2f42920dfaf973' (2024-03-03)
  → 'github:NixOS/nixpkgs/fd281bd6b7d3e32ddfa399853946f782553163b5' (2024-04-03)
2024-04-05 02:39:24 +00:00
hercules-ci[bot]
d2d48c9ec3
Merge pull request #233 from hercules-ci/flake-update
`flake.lock`: Update
2024-03-05 02:44:05 +00:00
Hercules CI Effects
c1597ef64b flake.lock: Update
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/b253292d9c0a5ead9bc98c4e9a26c6312e27d69f' (2024-02-01)
  → 'github:hercules-ci/flake-parts/f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2' (2024-03-01)
• Updated input 'hercules-ci-effects':
    'github:hercules-ci/hercules-ci-effects/d5cbf433a6ae9cae05400189a8dbc6412a03ba16' (2023-12-31)
  → 'github:hercules-ci/hercules-ci-effects/0ca27bd58e4d5be3135a4bef66b582e57abe8f4a' (2024-02-21)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8' (2024-02-11)
  → 'github:NixOS/nixpkgs/b8697e57f10292a6165a20f03d2f42920dfaf973' (2024-03-03)
2024-03-05 02:38:52 +00:00
hercules-ci[bot]
2b1fa9a8e9
Merge pull request #232 from hercules-ci/flake-update
`flake.lock`: Update
2024-02-14 15:12:56 +00:00
Hercules CI Effects
4fb872dc07 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/e92b6015881907e698782c77641aa49298330223' (2024-02-02)
  → 'github:NixOS/nixpkgs/f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8' (2024-02-11)
2024-02-14 14:56:50 +00:00
Robert Hensing
39ee2bc7f7
Merge pull request #231 from EricTheMagician/docker-build
add support for more docker-compose build options
2024-02-14 15:54:56 +01:00
Eric Yen
245fec68a2 add support for more docker-compose build options 2024-02-09 22:46:18 -08:00
hercules-ci[bot]
9e5caa2b48
Merge pull request #228 from hercules-ci/flake-update
`flake.lock`: Update
2024-02-05 16:37:50 +00:00
Hercules CI Effects
5321799830 flake.lock: Update
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/88a2cd8166694ba0b6cb374700799cec53aef527' (2024-01-01)
  → 'github:hercules-ci/flake-parts/b253292d9c0a5ead9bc98c4e9a26c6312e27d69f' (2024-02-01)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/bd645e8668ec6612439a9ee7e71f7eac4099d4f6' (2024-01-02)
  → 'github:NixOS/nixpkgs/e92b6015881907e698782c77641aa49298330223' (2024-02-02)
2024-02-05 17:31:21 +01:00
Hercules CI Effects
e92e133563 flake.lock: Update
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5' (2023-12-01)
  → 'github:hercules-ci/flake-parts/88a2cd8166694ba0b6cb374700799cec53aef527' (2024-01-01)
• Updated input 'hercules-ci-effects':
    'github:hercules-ci/hercules-ci-effects/31b6cd7569191bfcd0a548575b0e2ef953ed7d09' (2023-11-26)
  → 'github:hercules-ci/hercules-ci-effects/d5cbf433a6ae9cae05400189a8dbc6412a03ba16' (2023-12-31)
• Updated input 'hercules-ci-effects/flake-parts':
    'github:hercules-ci/flake-parts/c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4' (2023-10-03)
  → 'github:hercules-ci/flake-parts/34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5' (2023-12-01)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/91050ea1e57e50388fa87a3302ba12d188ef723a' (2023-12-01)
  → 'github:NixOS/nixpkgs/bd645e8668ec6612439a9ee7e71f7eac4099d4f6' (2024-01-02)
2024-02-05 17:31:21 +01:00
Robert Hensing
6ad33828e7 tests: Add VM memory
https://hercules-ci.com/accounts/github/hercules-ci/derivations/%2Fnix%2Fstore%2Fccihcy0i8p98vhf9rq0k64mdlin1d7dv-vm-test-run-arion-test.drv/log?via-job=446d4a99-fc0c-442d-a2ed-50ed004a8c48
2024-02-05 17:31:21 +01:00
Robert Hensing
f295eabd25
Merge pull request #199 from 0x450x6c/patch-1
Disable DHCP in full-nixos example
2023-12-30 16:37:40 +01:00
Robert Hensing
a27295cbf5
Merge pull request #226 from ciarandg/configurable-service-names
Add configurable systemd service name to NixOS module
2023-12-30 16:22:27 +01:00
Nikita Pedorich
b181b822f8
Use Compose Spec links in docs (#202) 2023-12-30 15:19:45 +00:00
Elbek Azimov
daf4aebad7
Disable DHCP in full-nixos example 2023-07-08 16:45:35 +00:00
9 changed files with 47 additions and 27 deletions

View file

@ -148,7 +148,7 @@ Describe containers using NixOS-style modules. There are a few options:
project.name = "full-nixos"; project.name = "full-nixos";
services.webserver = { pkgs, lib, ... }: { services.webserver = { pkgs, lib, ... }: {
nixos.useSystemd = true; nixos.useSystemd = true;
nixos.configuration.boot.tmpOnTmpfs = true; nixos.configuration.boot.tmp.useTmpfs = true;
nixos.configuration.services.nginx.enable = true; nixos.configuration.services.nginx.enable = true;
nixos.configuration.services.nginx.virtualHosts.localhost.root = "${pkgs.nix.doc}/share/doc/nix/manual"; nixos.configuration.services.nginx.virtualHosts.localhost.root = "${pkgs.nix.doc}/share/doc/nix/manual";
nixos.configuration.services.nscd.enable = false; nixos.configuration.services.nscd.enable = false;

View file

@ -2,7 +2,8 @@
project.name = "full-nixos"; project.name = "full-nixos";
services.webserver = { pkgs, lib, ... }: { services.webserver = { pkgs, lib, ... }: {
nixos.useSystemd = true; nixos.useSystemd = true;
nixos.configuration.boot.tmpOnTmpfs = true; nixos.configuration.boot.tmp.useTmpfs = true;
nixos.configuration.networking.useDHCP = false;
nixos.configuration.services.nginx.enable = true; nixos.configuration.services.nginx.enable = true;
nixos.configuration.services.nginx.virtualHosts.localhost.root = "${pkgs.nix.doc}/share/doc/nix/manual"; nixos.configuration.services.nginx.virtualHosts.localhost.root = "${pkgs.nix.doc}/share/doc/nix/manual";
nixos.configuration.services.nscd.enable = false; nixos.configuration.services.nscd.enable = false;

View file

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1701473968, "lastModified": 1722555600,
"narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5", "rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -28,11 +28,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1696343447, "lastModified": 1712014858,
"narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -64,11 +64,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1701009247, "lastModified": 1719226092,
"narHash": "sha256-GuX16rzRze2y7CsewJLTV6qXkXWyEwp6VCZXi8HLruU=", "narHash": "sha256-YNkUMcCUCpnULp40g+svYsaH1RbSEj6s4WdZY/SHe38=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "hercules-ci-effects", "repo": "hercules-ci-effects",
"rev": "31b6cd7569191bfcd0a548575b0e2ef953ed7d09", "rev": "11e4b8dc112e2f485d7c97e1cee77f9958f498f5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -79,11 +79,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1701436327, "lastModified": 1722630782,
"narHash": "sha256-tRHbnoNI8SIM5O5xuxOmtSLnswEByzmnQcGGyNRjxsE=", "narHash": "sha256-hMyG9/WlUi0Ho9VkRrrez7SeNlDzLxalm9FwY7n/Noo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "91050ea1e57e50388fa87a3302ba12d188ef723a", "rev": "d04953086551086b44b6f3c6b7eeb26294f207da",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -86,12 +86,6 @@
flake = { flake = {
debug = { inherit inputs config lib; }; debug = { inherit inputs config lib; };
defaultPackage =
lib.mapAttrs
(ps: lib.warn "arion.defaultPackage has been removed in favor of arion.packages.\${system}.default"
ps.default)
config.flake.packages;
lib = { lib = {
eval = import ./src/nix/eval-composition.nix; eval = import ./src/nix/eval-composition.nix;
build = args@{ ... }: build = args@{ ... }:

View file

@ -2,7 +2,7 @@
project.name = "unit-test-data"; project.name = "unit-test-data";
services.webserver = { pkgs, ... }: { services.webserver = { pkgs, ... }: {
nixos.useSystemd = true; nixos.useSystemd = true;
nixos.configuration.boot.tmpOnTmpfs = true; nixos.configuration.boot.tmp.useTmpfs = true;
nixos.configuration.services.nginx.enable = true; nixos.configuration.services.nginx.enable = true;
nixos.configuration.services.nginx.virtualHosts.localhost.root = "${pkgs.nix.doc}/share/doc/nix/manual"; nixos.configuration.services.nginx.virtualHosts.localhost.root = "${pkgs.nix.doc}/share/doc/nix/manual";
service.useHostStore = true; service.useHostStore = true;

View file

@ -3,11 +3,13 @@ let
link = url: text: ''[${text}](${url})''; link = url: text: ''[${text}](${url})'';
composeSpecRev = "55b450aee50799a2f33cc99e1d714518babe305e";
serviceRef = fragment: serviceRef = fragment:
''See ${link "https://docs.docker.com/compose/compose-file/05-services/#${fragment}" "Docker Compose Services #${fragment}"}''; ''See ${link "https://github.com/compose-spec/compose-spec/blob/${composeSpecRev}/05-services.md#${fragment}" "Compose Spec Services #${fragment}"}'';
networkRef = fragment: networkRef = fragment:
''See ${link "https://docs.docker.com/compose/compose-file/06-networks/#${fragment}" "Docker Compose Network #${fragment}"}''; ''See ${link "https://github.com/compose-spec/compose-spec/blob/${composeSpecRev}/06-networks.md#${fragment}" "Compose Spec Networks #${fragment}"}'';
in in
{ {

View file

@ -66,6 +66,22 @@ in
https://docs.docker.com/compose/compose-file/build/#context https://docs.docker.com/compose/compose-file/build/#context
''; '';
}; };
service.build.dockerfile = mkOption {
type = nullOr str;
default = null;
description = ''
Sets an alternate Dockerfile. A relative path is resolved from the build context.
https://docs.docker.com/compose/compose-file/build/#dockerfile
'';
};
service.build.target = mkOption {
type = nullOr str;
default = null;
description = ''
Defines the stage to build as defined inside a multi-stage Dockerfile.
https://docs.docker.com/compose/compose-file/build/#target
'';
};
service.hostname = mkOption { service.hostname = mkOption {
type = nullOr str; type = nullOr str;
default = null; default = null;
@ -194,6 +210,11 @@ in
default = []; default = [];
description = serviceRef "external_links"; description = serviceRef "external_links";
}; };
service.profiles = mkOption {
type = listOf str;
default = [];
description = serviceRef "profiles";
};
service.extra_hosts = mkOption { service.extra_hosts = mkOption {
type = listOf str; type = listOf str;
default = []; default = [];
@ -337,8 +358,8 @@ in
; ;
} // lib.optionalAttrs (config.service.image != null) { } // lib.optionalAttrs (config.service.image != null) {
inherit (config.service) image; inherit (config.service) image;
} // lib.optionalAttrs (config.service.build.context != null) { } // lib.optionalAttrs (config.service.build.context != null ) {
inherit (config.service) build; build = lib.filterAttrs (n: v: v != null) config.service.build;
} // lib.optionalAttrs (cap_add != []) { } // lib.optionalAttrs (cap_add != []) {
inherit cap_add; inherit cap_add;
} // lib.optionalAttrs (cap_drop != []) { } // lib.optionalAttrs (cap_drop != []) {
@ -395,5 +416,7 @@ in
inherit (config.service) working_dir; inherit (config.service) working_dir;
} // lib.optionalAttrs (config.service.user != null) { } // lib.optionalAttrs (config.service.user != null) {
inherit (config.service) user; inherit (config.service) user;
} // lib.optionalAttrs (config.service.profiles != []) {
inherit (config.service) profiles;
}; };
} }

View file

@ -45,7 +45,7 @@ in
pkgs.stdenv pkgs.stdenv
]; ];
virtualisation.memorySize = 1024; virtualisation.memorySize = 2048;
virtualisation.diskSize = 8000; virtualisation.diskSize = 8000;
}; };
testScript = '' testScript = ''

View file

@ -4,7 +4,7 @@ pkgs.nixosTest {
name = "test-basic-arion-kafka"; name = "test-basic-arion-kafka";
nodes = { nodes = {
machine = { ... }: { machine = { ... }: {
virtualisation.memorySize = 3000; virtualisation.memorySize = 4096;
virtualisation.diskSize = 10000; virtualisation.diskSize = 10000;
imports = [ imports = [
../../nixos-module.nix ../../nixos-module.nix