module does not build:
$ nix build .#nixosConfigurations.vm.config.system.build.vm
error:
… while calling the 'derivationStrict' builtin
at /builtin/derivation.nix:9:12: (source not available)
… while evaluating derivation 'nixos-vm'
whose name attribute is located at /nix/store/ikx99aci297hpgys7114fjwyf38iv9qi-source/pkgs/stdenv/generic/make-derivation.nix:348:7
… while evaluating attribute 'buildCommand' of derivation 'nixos-vm'
at /nix/store/ikx99aci297hpgys7114fjwyf38iv9qi-source/pkgs/build-support/trivial-builders/default.nix:87:14:
86| enableParallelBuilding = true;
87| inherit buildCommand name;
| ^
88| passAsFile = [ "buildCommand" ]
(stack trace truncated; use '--show-trace' to show the full trace)
error: attribute 'system' missing
at /nix/store/ikx99aci297hpgys7114fjwyf38iv9qi-source/lib/modules.nix:506:28:
505| builtins.addErrorContext (context name)
506| (args.${name} or config._module.args.${name})
| ^
507| ) (lib.functionArgs f);
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
geoip2-tarball: {
|
||||
nixpkgs: {
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
system,
|
||||
geoip2-tarball,
|
||||
...
|
||||
}: {
|
||||
}: let
|
||||
pkgs = import ../../pkgs.nix {inherit nixpkgs system geoip2-tarball;};
|
||||
in {
|
||||
options.e11sync = with lib.types; {
|
||||
enable = lib.mkEnableOption "Enable e11sync";
|
||||
secretKeyPath = lib.mkOption {type = oneOf [path (enum ["unsafe"])];};
|
||||
@@ -28,21 +31,10 @@ geoip2-tarball: {
|
||||
|
||||
config = let
|
||||
cfg = config.e11sync;
|
||||
geoip-mmdb = pkgs.callPackage ../../pkgs/geoip-mmdb.nix {
|
||||
inherit geoip2-tarball;
|
||||
};
|
||||
e11sync-static = pkgs.callPackage ../../pkgs/e11sync-static.nix {};
|
||||
e11sync-frontend = pkgs.callPackage ../../pkgs/e11sync-frontend.nix {
|
||||
inherit e11sync-static;
|
||||
};
|
||||
e11sync-backend = pkgs.callPackage ../../pkgs/e11sync-backend.nix {
|
||||
inherit e11sync-static geoip-mmdb;
|
||||
inherit (cfg) backendPort databasePath;
|
||||
};
|
||||
in
|
||||
lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
e11sync-backend
|
||||
pkgs.e11sync-backend
|
||||
];
|
||||
|
||||
systemd.services = {
|
||||
@@ -67,7 +59,7 @@ geoip2-tarball: {
|
||||
StateDirectory = "e11sync-backend";
|
||||
WorkingDirectory = "/var/lib/e11sync-backend";
|
||||
KillSignal = "SIGQUIT";
|
||||
ExecStart = "${e11sync-backend}/bin/e11sync-backend";
|
||||
ExecStart = "${pkgs.e11sync-backend}/bin/e11sync-backend";
|
||||
|
||||
MemoryHigh = "1535M";
|
||||
MemoryMax = "4096M";
|
||||
@@ -79,7 +71,7 @@ geoip2-tarball: {
|
||||
ProtectControlGroups = true;
|
||||
}
|
||||
(lib.mkIf cfg.migrateOnStart {
|
||||
ExecStartPre = "${e11sync-backend}/bin/e11sync migrate";
|
||||
ExecStartPre = "${pkgs.e11sync-backend}/bin/e11sync migrate";
|
||||
})
|
||||
(lib.mkIf (cfg.secretKeyPath != "unsafe") {
|
||||
LoadCredential = "secret_key:${cfg.secretKeyPath}";
|
||||
@@ -89,6 +81,6 @@ geoip2-tarball: {
|
||||
};
|
||||
|
||||
services.caddy.virtualHosts."${cfg.vhost}".extraConfig =
|
||||
builtins.readFile "${e11sync-frontend}";
|
||||
builtins.readFile "${pkgs.e11sync-frontend}";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user