Compare commits
1 commit
main
...
flake-upda
Author | SHA1 | Date | |
---|---|---|---|
|
5a2fea9d9d |
6 changed files with 20 additions and 37 deletions
|
@ -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.tmp.useTmpfs = true;
|
nixos.configuration.boot.tmpOnTmpfs = 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;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
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.tmp.useTmpfs = true;
|
nixos.configuration.boot.tmpOnTmpfs = true;
|
||||||
nixos.configuration.networking.useDHCP = false;
|
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";
|
||||||
|
|
18
flake.lock
18
flake.lock
|
@ -7,11 +7,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722555600,
|
"lastModified": 1725234343,
|
||||||
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
|
"narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
|
"rev": "567b938d64d4b4112ee253b9274472dc3a346eb6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -64,11 +64,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1719226092,
|
"lastModified": 1724947644,
|
||||||
"narHash": "sha256-YNkUMcCUCpnULp40g+svYsaH1RbSEj6s4WdZY/SHe38=",
|
"narHash": "sha256-MHHrHasTngp7EYQOObHJ1a/IsRF+wodHqOckhH6uZbk=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "hercules-ci-effects",
|
"repo": "hercules-ci-effects",
|
||||||
"rev": "11e4b8dc112e2f485d7c97e1cee77f9958f498f5",
|
"rev": "dba4367b9a9d9615456c430a6d6af716f6e84cef",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -79,11 +79,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722630782,
|
"lastModified": 1725103162,
|
||||||
"narHash": "sha256-hMyG9/WlUi0Ho9VkRrrez7SeNlDzLxalm9FwY7n/Noo=",
|
"narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "d04953086551086b44b6f3c6b7eeb26294f207da",
|
"rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -86,6 +86,12 @@
|
||||||
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@{ ... }:
|
||||||
|
|
|
@ -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.tmp.useTmpfs = true;
|
nixos.configuration.boot.tmpOnTmpfs = 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;
|
||||||
|
|
|
@ -66,22 +66,6 @@ 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;
|
||||||
|
@ -210,11 +194,6 @@ 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 = [];
|
||||||
|
@ -358,8 +337,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) {
|
||||||
build = lib.filterAttrs (n: v: v != null) config.service.build;
|
inherit (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 != []) {
|
||||||
|
@ -416,7 +395,5 @@ 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;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue