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.org](https://nixos.org/)
|
||||||
- [NixOS packages](https://search.nixos.org/packages)
|
- [NixOS packages](https://search.nixos.org/packages)
|
||||||
- [NixOS config options](https://search.nixos.org/options?)
|
- [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)
|
- [Nix explained from the ground up](https://www.youtube.com/watch?v=5D3nUU1OVx8)
|
||||||
- [Zero to Nix Quick start](https://zero-to-nix.com/start/)
|
- [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
|
- [The Purely Functional Software Deployment Model](https://edolstra.github.io/pubs/phd-thesis.pdf) thesis from Eelco Dolstra
|
@ -7,6 +7,7 @@
|
|||||||
software = {
|
software = {
|
||||||
container = true;
|
container = true;
|
||||||
desktop = true;
|
desktop = true;
|
||||||
|
nextcloud.server.enable = true;
|
||||||
};
|
};
|
||||||
disk.device.name = "vda";
|
disk.device.name = "vda";
|
||||||
hardware.virtualmachine.type = "kvm";
|
hardware.virtualmachine.type = "kvm";
|
||||||
|
17
options.nix
17
options.nix
@ -125,6 +125,13 @@
|
|||||||
default = false;
|
default = false;
|
||||||
description = "beancloud.software.nextcloud.talk-desktop to activate the nextcloud talk desktop package";
|
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 {
|
beancloud.software.ollama = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
@ -257,12 +264,12 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
virtualmachine = {
|
virtualmachine = {
|
||||||
type = lib.mkOption {
|
type = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
example = "kvm";
|
example = "kvm";
|
||||||
description = "beancloud.hardware.virtualmachine.type[kvm] to enable virtio related kernel modules";
|
description = "beancloud.hardware.virtualmachine.type[kvm] to enable virtio related kernel modules";
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
beancloud.tier = lib.mkOption {
|
beancloud.tier = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
imports = [
|
imports = [
|
||||||
./firmware.nix
|
./firmware.nix
|
||||||
./gnome.nix
|
./gnome.nix
|
||||||
|
./nextcloud.nix
|
||||||
./nix-daemon.nix
|
./nix-daemon.nix
|
||||||
./openssh.nix
|
./openssh.nix
|
||||||
./wine.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 = {
|
programs = {
|
||||||
@ -104,12 +104,16 @@
|
|||||||
settings = [
|
settings = [
|
||||||
{
|
{
|
||||||
toolbar = true; # <- global toolbar
|
toolbar = true; # <- global toolbar
|
||||||
bookmarks = [
|
bookmarks = lib.mkMerge [[
|
||||||
{
|
{
|
||||||
name = "kernel.org";
|
name = "kernel.org";
|
||||||
url = "https://www.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