Compare commits

...

4 Commits

Author SHA1 Message Date
Félinàun Chapeau 8b48b2d937
Merge bc5eaf40ca into 24a7ea3905 2024-04-26 15:44:21 +02:00
Ryan Mulligan 24a7ea3905
Merge pull request #256 from spectre256/main
fix: allow for newlines in keys
2024-04-26 05:59:12 -07:00
Ellis Gibbons 2c1d1fb134
fix: allow for newlines in keys 2024-04-12 17:50:07 -04:00
Félinàun Chapeau bc5eaf40ca
Turn module into file path.
If a module is an attrset deduplicating imports does not work properly
and would lead to the module system complaining about redefining
options. Here is an example:

error: The option `age.identityPaths' in `/nix/store/wn50ysifrfp5qj5pp3jqpyvwh8ksz36y-source/machines/foo' is already declared in `/nix/store/wn50ysifrfp5qj5pp3jqpyvwh8ksz36y-source/common/ddclient/default.nix'.

when common/ddclient/default.nix and machines/foo/default.nix is:

{ ..., agenix, ... }: {
  imports = [
    agenix.nixosModules.age
  ];
}

Turning the module into a filepath fixes the issue.
2024-02-05 09:48:19 +01:00
2 changed files with 6 additions and 4 deletions

View File

@ -23,13 +23,13 @@
}: let
eachSystem = nixpkgs.lib.genAttrs (import systems);
in {
nixosModules.age = import ./modules/age.nix;
nixosModules.age = ./modules/age.nix;
nixosModules.default = self.nixosModules.age;
darwinModules.age = import ./modules/age.nix;
darwinModules.age = ./modules/age.nix;
darwinModules.default = self.darwinModules.age;
homeManagerModules.age = import ./modules/age-home.nix;
homeManagerModules.age = ./modules/age-home.nix;
homeManagerModules.default = self.homeManagerModules.age;
overlays.default = import ./overlay.nix;

View File

@ -171,7 +171,9 @@ function edit {
ENCRYPT=()
while IFS= read -r key
do
ENCRYPT+=(--recipient "$key")
if [ -n "$key" ]; then
ENCRYPT+=(--recipient "$key")
fi
done <<< "$KEYS"
REENCRYPTED_DIR=$(@mktempBin@ -d)