fix: use specialArgs instead of _module.args

Avoids infinite recursion issues in some cases.
This commit is contained in:
Felix Schröter 2023-07-12 20:50:01 +02:00
parent afdcbb0c06
commit 09f7db14c3
Signed by: felschr
GPG key ID: 671E39E6744C807D
3 changed files with 45 additions and 10 deletions

View file

@ -100,14 +100,7 @@
nixpkgs.overlays = systemDefaults.overlays;
imports = systemDefaults.modules ++ [
hardwareConfig
config
{
# make arguments available to modules
_module.args = { inherit self inputs; };
}
];
imports = systemDefaults.modules ++ [ hardwareConfig config ];
environment.systemPackages = with pkgs;
[ agenix.packages.x86_64-linux.default ];
@ -118,6 +111,7 @@
(createUser' name args) ({ inherit home-manager; } // args2));
createMediaGroup = _: { users.groups.media.gid = 600; };
};
specialArgs = { inherit inputs; };
in rec {
inherit lib overlays nixosModules homeManagerModules;
@ -145,6 +139,7 @@
[ deploy-rs.defaultPackage.x86_64-linux ];
})
];
inherit specialArgs;
};
nixosConfigurations.pilot1 = nixpkgs.lib.nixosSystem {
@ -164,6 +159,7 @@
config = ./home/felschr-work.nix;
})
];
inherit specialArgs;
};
nixosConfigurations.home-server = nixpkgs.lib.nixosSystem {
@ -189,6 +185,7 @@
config = ./home/felschr-server.nix;
})
];
inherit specialArgs;
};
deploy.nodes.home-server = {

View file

@ -1,4 +1,4 @@
{ pkgs, lib, self, inputs, ... }:
{ pkgs, lib, inputs, ... }:
let
flakes = lib.filterAttrs (name: value: value ? outputs) inputs;
@ -6,7 +6,7 @@ let
in {
# Let 'nixos-version --json' know about the Git revision
# of this flake.
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
system.configurationRevision = lib.mkIf (inputs.self ? rev) inputs.self.rev;
nix = {
extraOptions = "experimental-features = nix-command flakes";

View file

@ -0,0 +1,38 @@
{ inputs, ... }:
{
# TODO they don't exist, so not disabling them
/* disabledModules = [
"services/audio/wyoming/piper.nix"
"services/audio/wyoming/faster-whisper.nix"
];
*/
# TODO fails with infinite recursion, why?
# TODO perhaps because of the `pkgs.unstable` override?
imports = [
"${inputs.nixpkgs-unstable}/nixos/modules/services/audio/wyoming/piper.nix"
"${inputs.nixpkgs-unstable}/nixos/modules/services/audio/wyoming/faster-whisper.nix"
];
/* services.wyoming.piper.servers = {
"en" = {
enable = true;
voice = "en_GB-alba-medium";
uri = "tcp://0.0.0.0:10200";
speaker = 0;
};
};
services.wyoming.faster-whisper.servers = {
"tiny-en" = {
enable = true;
model = "tiny-int8";
language = "en";
uri = "tcp://0.0.0.0:10300";
device = "cpu";
};
};
*/
}