Get rid of useless self and providers arguments

This commit is contained in:
Nicolas Jeannerod 2025-01-31 16:34:21 +01:00
parent 564938e52d
commit ba97ed26d0
Signed by untrusted user: Niols
GPG key ID: 35DB9EC8886E1CB8
4 changed files with 10 additions and 14 deletions

View file

@ -27,7 +27,6 @@
./deployment/flake-part.nix ./deployment/flake-part.nix
./infra/flake-part.nix ./infra/flake-part.nix
./keys/flake-part.nix
./services/flake-part.nix ./services/flake-part.nix
]; ];

View file

@ -1,7 +1,5 @@
{ {
self,
inputs, inputs,
providers,
lib, lib,
config, config,
... ...
@ -12,6 +10,10 @@ let
inherit (lib.attrsets) concatMapAttrs optionalAttrs; inherit (lib.attrsets) concatMapAttrs optionalAttrs;
inherit (lib.strings) removeSuffix; inherit (lib.strings) removeSuffix;
secretsPrefix = ../../secrets;
secrets = import (secretsPrefix + "/secrets.nix");
keys = import ../../keys;
in in
{ {
options = { options = {
@ -30,12 +32,10 @@ in
config = config =
let let
hostPublicKey = self.keys.systems.${config.procolixVm.name}; hostPublicKey = keys.systems.${config.procolixVm.name};
in in
{ {
type = providers.local.exec;
ssh = { ssh = {
host = config.procolixVm.host; host = config.procolixVm.host;
hostPublicKey = hostPublicKey; hostPublicKey = hostPublicKey;
@ -55,13 +55,13 @@ in
age.secrets = concatMapAttrs ( age.secrets = concatMapAttrs (
name: secret: name: secret:
optionalAttrs (elem hostPublicKey secret.publicKeys) ({ optionalAttrs (elem hostPublicKey secret.publicKeys) ({
${removeSuffix ".age" name}.file = ../../secrets + "/${name}"; ${removeSuffix ".age" name}.file = secretsPrefix + "/${name}";
}) })
) (import ../../secrets/secrets.nix); ) secrets;
## FIXME: Remove direct root authentication once the NixOps4 NixOS ## FIXME: Remove direct root authentication once the NixOps4 NixOS
## provider supports users with password-less sudo. ## provider supports users with password-less sudo.
users.users.root.openssh.authorizedKeys.keys = attrValues self.keys.contributors; users.users.root.openssh.authorizedKeys.keys = attrValues keys.contributors;
}; };
}; };
} }

View file

@ -1,5 +1,4 @@
{ {
self,
inputs, inputs,
lib, lib,
... ...
@ -13,7 +12,8 @@ let
vmName: vmName:
{ providers, ... }: { providers, ... }:
{ {
_module.args = { inherit self inputs providers; }; _module.args = { inherit inputs; };
type = providers.local.exec;
imports = [ imports = [
inputs.nixops4-nixos.modules.nixops4Resource.nixos inputs.nixops4-nixos.modules.nixops4Resource.nixos
./common/procolixResource.nix ./common/procolixResource.nix

View file

@ -1,3 +0,0 @@
{
flake.keys = import ./.;
}