Skip to content

Commit

Permalink
feat(syncthing): removed unnecessary manage configuration via agenix …
Browse files Browse the repository at this point in the history
…secrets
  • Loading branch information
Wittano committed Jun 29, 2024
1 parent 42e4653 commit 0c3b9b0
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 181 deletions.
150 changes: 27 additions & 123 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
url = "github:ezKEa/aagl-gtk-on-nix/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix.url = "github:ryantm/agenix";
nixvim.url = "github:nix-community/nixvim";
honkai-railway-grub-theme.url = "github:voidlhf/StarRailGrubThemes";
catppuccin.url = "github:catppuccin/nix";
Expand Down
32 changes: 1 addition & 31 deletions modules/secrets.nix
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
{ config, lib, inputs, pkgs, secretDir, ... }:
{ config, lib, pkgs, ... }:
with lib;
with lib.my;
let
keyPath = "/etc/ssh/syncthing.key";

secretFiles = attrsets.filterAttrs
(n: _: strings.hasSuffix ".age" n)
(builtins.readDir secretDir);
in
{
imports = [
inputs.agenix.nixosModules.default
];

environment.systemPackages = [ inputs.agenix.packages.x86_64-linux.default ];

services.openssh = mkIf (!config.modules.services.ssh.enable) {
enable = mkForce true;
hostKeys = [{
bits = 4096;
path = keyPath;
type = "rsa";
}];
openFirewall = false;
allowSFTP = false;
settings = {
Expand Down Expand Up @@ -65,16 +47,4 @@ in
moveNewerKey "$p.pub" || echo "failed move file $p.pub"
done
'';


age.secrets = attrsets.mapAttrs'
(n: _:
{
name = strings.removeSuffix ".age" n;
value = {
file = secretDir + "/${n}";
owner = "wittano";
};
})
secretFiles;
}
Loading

0 comments on commit 0c3b9b0

Please sign in to comment.