-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modules: Extract modules for nextcloud and sops
I had to do this in one setp, because nextcloud requires sops, and without having sops input on all configurations, those that did not have the input would fail building.
- Loading branch information
Showing
4 changed files
with
76 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,9 @@ in { | |
./monitoring | ||
./my-user | ||
./networking | ||
./nextcloud | ||
./nix | ||
./sops | ||
./sound | ||
./ssh-access | ||
]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
... | ||
}: let | ||
cfg = config.my.modules.nextcloud; | ||
in { | ||
options.my.modules.nextcloud = { | ||
enable = lib.mkEnableOption "nextcloud"; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
sops.secrets.nextcloud-admin-pass = { | ||
owner = "nextcloud"; | ||
}; | ||
|
||
services.nextcloud = { | ||
enable = true; | ||
package = pkgs.nextcloud29; | ||
hostName = "nextcloud.ritter.family"; | ||
config = { | ||
adminpassFile = config.sops.secrets.nextcloud-admin-pass.path; | ||
}; | ||
extraApps = { | ||
inherit (config.services.nextcloud.package.packages.apps) bookmarks calendar contacts cookbook deck memories richdocuments; | ||
news = pkgs.fetchNextcloudApp { | ||
url = "https://github.com/nextcloud/news/releases/download/25.0.0-alpha7/news.tar.gz"; | ||
sha256 = "sha256-XNGjf7SWgJYFdVNOh3ED0jxSG0GJwWImVQq4cJT1Lo4="; | ||
license = "agpl3Plus"; | ||
}; | ||
}; | ||
extraAppsEnable = true; | ||
}; | ||
|
||
networking = { | ||
firewall = { | ||
allowedTCPPorts = [80 443]; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
config, | ||
lib, | ||
inputs, | ||
... | ||
}: let | ||
cfg = config.my.modules.sops; | ||
in { | ||
imports = [ | ||
inputs.sops-nix.nixosModules.sops | ||
]; | ||
|
||
options.my.modules.sops = { | ||
enable = lib.mkEnableOption "sops"; | ||
sopsFile = lib.mkOption { | ||
type = lib.types.nullOr lib.types.path; | ||
default = null; | ||
}; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
sops.defaultSopsFile = cfg.sopsFile; | ||
# This will automatically import SSH keys as age keys | ||
sops.age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters