nextcloud server config added
This commit is contained in:
parent
fe912ec7c9
commit
8b02ce9fb3
@ -31,6 +31,7 @@ sudo nixos-install --no-root-password --flake git+https://code.beancloud.de/publ
|
||||
- [nixos.org](https://nixos.org/)
|
||||
- [NixOS packages](https://search.nixos.org/packages)
|
||||
- [NixOS config options](https://search.nixos.org/options?)
|
||||
- [home-manager options](https://nix-community.github.io/home-manager/options.xhtml)
|
||||
- [Nix explained from the ground up](https://www.youtube.com/watch?v=5D3nUU1OVx8)
|
||||
- [Zero to Nix Quick start](https://zero-to-nix.com/start/)
|
||||
- [The Purely Functional Software Deployment Model](https://edolstra.github.io/pubs/phd-thesis.pdf) thesis from Eelco Dolstra
|
@ -7,6 +7,7 @@
|
||||
software = {
|
||||
container = true;
|
||||
desktop = true;
|
||||
nextcloud.server.enable = true;
|
||||
};
|
||||
disk.device.name = "vda";
|
||||
hardware.virtualmachine.type = "kvm";
|
||||
|
17
options.nix
17
options.nix
@ -125,6 +125,13 @@
|
||||
default = false;
|
||||
description = "beancloud.software.nextcloud.talk-desktop to activate the nextcloud talk desktop package";
|
||||
};
|
||||
server = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "beancloud.software.nextcloud.server.enable to activate the nextcloud server and the related software like the DB";
|
||||
};
|
||||
};
|
||||
};
|
||||
beancloud.software.ollama = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
@ -257,12 +264,12 @@
|
||||
};
|
||||
};
|
||||
virtualmachine = {
|
||||
type = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
example = "kvm";
|
||||
description = "beancloud.hardware.virtualmachine.type[kvm] to enable virtio related kernel modules";
|
||||
};
|
||||
type = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
example = "kvm";
|
||||
description = "beancloud.hardware.virtualmachine.type[kvm] to enable virtio related kernel modules";
|
||||
};
|
||||
};
|
||||
};
|
||||
beancloud.tier = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
|
@ -38,6 +38,7 @@
|
||||
imports = [
|
||||
./firmware.nix
|
||||
./gnome.nix
|
||||
./nextcloud.nix
|
||||
./nix-daemon.nix
|
||||
./openssh.nix
|
||||
./wine.nix
|
||||
|
51
software/nextcloud.nix
Normal file
51
software/nextcloud.nix
Normal file
@ -0,0 +1,51 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
(lib.mkIf config.beancloud.software.nextcloud.client nextcloud-client)
|
||||
(lib.mkIf config.beancloud.software.nextcloud.talk-desktop nextcloud-talk-desktop)
|
||||
];
|
||||
|
||||
# in production use https://wiki.nixos.org/wiki/Comparison_of_secret_managing_schemes like https://github.com/Mic92/sops-nix
|
||||
environment.etc = {
|
||||
"nextcloud-admin-pass" = {
|
||||
enable = config.beancloud.software.nextcloud.server.enable;
|
||||
text = "demo123456";
|
||||
target = "nextcloud/admin.password";
|
||||
};
|
||||
"nextcloud-secrets" = {
|
||||
enable = config.beancloud.software.nextcloud.server.enable;
|
||||
text = ''
|
||||
{
|
||||
"passwordsalt": "qXILOyHFVeOhoChoUodPfxWQhEUMcomBpyeyzZfBQYWwqBtguvKQOJQQiCrUWokP",
|
||||
"secret": "WKXGlKIkvMhyTbJssZiLrcjBnWoHYkWOTgSAIIBGyaqjLuOsYTmyYXdsAIroskpk",
|
||||
"instanceid": "nc1234567890"
|
||||
}
|
||||
'';
|
||||
target = "nextcloud/secrets";
|
||||
};
|
||||
};
|
||||
|
||||
# https://search.nixos.org/options?channel=25.05&show=services.nextcloud.secretFile&from=0&size=50&sort=relevance&type=packages&query=services.nextcloud.
|
||||
services = {
|
||||
nextcloud = {
|
||||
enable = config.beancloud.software.nextcloud.server.enable;
|
||||
package = pkgs.nextcloud30;
|
||||
hostName = "localhost";
|
||||
caching.redis = config.beancloud.software.nextcloud.server.enable;
|
||||
configureRedis = config.beancloud.software.nextcloud.server.enable;
|
||||
config = {
|
||||
dbtype = "mysql";
|
||||
adminpassFile = "/etc/" + config.environment.etc."nextcloud-admin-pass".target;
|
||||
};
|
||||
secretFile = "/etc/" + config.environment.etc."nextcloud-secrets".target;
|
||||
database.createLocally = true;
|
||||
autoUpdateApps.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{ lib, pkgs, osConfig, ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
@ -104,12 +104,16 @@
|
||||
settings = [
|
||||
{
|
||||
toolbar = true; # <- global toolbar
|
||||
bookmarks = [
|
||||
bookmarks = lib.mkMerge [[
|
||||
{
|
||||
name = "kernel.org";
|
||||
url = "https://www.kernel.org";
|
||||
}
|
||||
];
|
||||
(lib.mkIf osConfig.beancloud.software.nextcloud.server.enable {
|
||||
name = "Nextcloud";
|
||||
url = "http://localhost";
|
||||
})
|
||||
]];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user