nextcloud: Fetch apps using nvfetcher

This commit is contained in:
Tristan Daniël Maat 2022-10-17 11:00:02 +01:00
parent c4fa991b62
commit 61d3008bc3
Signed by: tlater
GPG key ID: 49670FD774E43268
9 changed files with 318 additions and 66 deletions

View file

@ -8,6 +8,10 @@
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nvfetcher = {
url = "github:berberman/nvfetcher";
inputs.nixpkgs.follows = "nixpkgs";
};
tlaternet-webserver = {
url = "git+https://gitea.tlater.net/tlaternet/tlaternet.git";
inputs.nixpkgs.follows = "nixpkgs";
@ -18,6 +22,7 @@
self,
nixpkgs,
sops-nix,
nvfetcher,
deploy-rs,
tlaternet-webserver,
}: let
@ -89,22 +94,35 @@
####################
# VM launch script #
####################
apps.${system}.default = let
inherit (self.nixosConfigurations.vm.config.system.build) vm;
apps.${system} = let
inherit (nixpkgs.legacyPackages.${system}) writeShellScript;
qemuNetOpts = self.lib.makeQemuNetOpts {
"2222" = "2222";
"3080" = "80";
"3443" = "443";
"21025" = "21025"; # Starbound
};
in {
type = "app";
program = builtins.toString (writeShellScript "run-vm" ''
export QEMU_OPTS="-m 3941 -smp 2 -display curses"
export QEMU_NET_OPTS="${qemuNetOpts}"
"${vm}/bin/run-tlaternet-vm"
'');
default = let
inherit (self.nixosConfigurations.vm.config.system.build) vm;
qemuNetOpts = self.lib.makeQemuNetOpts {
"2222" = "2222";
"3080" = "80";
"3443" = "443";
"21025" = "21025"; # Starbound
};
in {
type = "app";
program = builtins.toString (writeShellScript "run-vm" ''
export QEMU_OPTS="-m 3941 -smp 2 -display curses"
export QEMU_NET_OPTS="${qemuNetOpts}"
"${vm}/bin/run-tlaternet-vm"
'');
};
update-nextcloud-apps = let
nvfetcher-bin = "${nvfetcher.defaultPackage.${system}}/bin/nvfetcher";
in {
type = "app";
program = builtins.toString (writeShellScript "update-nextcloud-apps" ''
cd "$(git rev-parse --show-toplevel)/pkgs"
${nvfetcher-bin} -o _sources_nextcloud -c nextcloud-apps.toml
'');
};
};
###########################