container friendly passing of current system

This commit is contained in:
zuckerberg 2021-09-24 14:11:39 -04:00
parent b7f6576d64
commit be2828ee29
4 changed files with 33 additions and 24 deletions

View File

@ -2,7 +2,7 @@
let let
cfg = config.services.radio; cfg = config.services.radio;
radioPackage = config.inputs.radio.packages.${builtins.currentSystem}.radio; radioPackage = config.inputs.radio.packages.${config.currentSystem}.radio;
in { in {
options.services.radio = { options.services.radio = {
enable = lib.mkEnableOption "enable radio"; enable = lib.mkEnableOption "enable radio";

View File

@ -33,12 +33,13 @@
./common/common.nix ./common/common.nix
inputs.simple-nixos-mailserver.nixosModule inputs.simple-nixos-mailserver.nixosModule
inputs.agenix.nixosModules.age inputs.agenix.nixosModules.age
{ ({ lib, ... }: {
environment.systemPackages = [ inputs.agenix.defaultPackage.${system} ]; environment.systemPackages = [ inputs.agenix.defaultPackage.${system} ];
# because nixos specialArgs doesn't work for containers... need to pass in inputs a different way # because nixos specialArgs doesn't work for containers... need to pass in inputs a different way
options.inputs = lib.mkOption { default = inputs; }; options.inputs = lib.mkOption { default = inputs; };
} options.currentSystem = lib.mkOption { default = system; };
})
]; ];
# specialArgs = {}; # specialArgs = {};
}; };

View File

@ -147,11 +147,14 @@ in {
../../common/common.nix ../../common/common.nix
config.inputs.agenix.nixosModules.age config.inputs.agenix.nixosModules.age
]; ];
pia.enable = true;
nixpkgs.pkgs = pkgs;
# because nixos specialArgs doesn't work for containers... need to pass in inputs a different way # because nixos specialArgs doesn't work for containers... need to pass in inputs a different way
options.inputs = lib.mkOption { default = config.inputs; }; options.inputs = lib.mkOption { default = config.inputs; };
options.currentSystem = lib.mkOption { default = currentSystem; };
config = {
pia.enable = true;
nixpkgs.pkgs = pkgs;
services.drastikbot.enable = true; services.drastikbot.enable = true;
services.radio = { services.radio = {
@ -160,6 +163,7 @@ in {
}; };
}; };
}; };
};
# load the secret on behalf of the container # load the secret on behalf of the container
age.secrets."pia-login.conf".file = ../../secrets/pia-login.conf; age.secrets."pia-login.conf".file = ../../secrets/pia-login.conf;

View File

@ -49,11 +49,14 @@
../../common/common.nix ../../common/common.nix
config.inputs.agenix.nixosModules.age config.inputs.agenix.nixosModules.age
]; ];
pia.enable = true;
nixpkgs.pkgs = pkgs;
# because nixos specialArgs doesn't work for containers... need to pass in inputs a different way # because nixos specialArgs doesn't work for containers... need to pass in inputs a different way
options.inputs = lib.mkOption { default = config.inputs; }; options.inputs = lib.mkOption { default = config.inputs; };
options.currentSystem = lib.mkOption { default = currentSystem; };
config = {
pia.enable = true;
nixpkgs.pkgs = pkgs;
services.radarr.enable = true; services.radarr.enable = true;
services.radarr.openFirewall = true; services.radarr.openFirewall = true;
@ -70,6 +73,7 @@
services.deluge.web.openFirewall = true; services.deluge.web.openFirewall = true;
}; };
}; };
};
services.nginx.virtualHosts."radarr.neet.cloud" = { services.nginx.virtualHosts."radarr.neet.cloud" = {
enableACME = true; enableACME = true;