Added sharkey-service nixos module
This commit is contained in:
parent
73c128dbcb
commit
03df443aa8
31
flake.nix
31
flake.nix
|
|
@ -3,36 +3,9 @@
|
||||||
|
|
||||||
outputs = { self, nixpkgs }: {
|
outputs = { self, nixpkgs }: {
|
||||||
|
|
||||||
nixosConfigurations.container = nixpkgs.lib.nixosSystem {
|
nixosModules.sharkey-service = args : import ./sharkey-service.nix ( args // { sharkey = self.packages.sharkey; } );
|
||||||
system = "x86_64-linux";
|
|
||||||
modules =
|
|
||||||
[
|
|
||||||
( import ./sharkey-service.nix )
|
|
||||||
({ pkgs, ... }: {
|
|
||||||
boot.isContainer = true;
|
|
||||||
|
|
||||||
# Let 'nixos-version --json' know about the Git revision
|
packages."x86_64-linux".sharkey = nixpkgs.legacyPackages."x86_64-linux".callPackage ./sharkey.nix { };
|
||||||
# of this flake.
|
|
||||||
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
|
|
||||||
|
|
||||||
# Network configuration.
|
|
||||||
networking.useDHCP = false;
|
|
||||||
networking.firewall.allowedTCPPorts = [ 3000 ];
|
|
||||||
|
|
||||||
system.stateVersion = "24.04";
|
|
||||||
|
|
||||||
services.sharkey = {
|
|
||||||
enable = true;
|
|
||||||
package = (pkgs.callPackage ./sharkey.nix {});
|
|
||||||
settings = {
|
|
||||||
url = "https://sharkey.localhost";
|
|
||||||
};
|
|
||||||
redis.createLocally = true;
|
|
||||||
database.createLocally = true;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
|
sharkey,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
|
@ -186,9 +187,11 @@ in
|
||||||
|
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
services.sharkey = {
|
services.sharkey = {
|
||||||
enable = lib.mkEnableOption "sharkey";
|
enable = lib.mkEnableOption "sharkey";
|
||||||
package = (pkgs.callPackage ./sharkey.nix { });
|
|
||||||
inherit settings;
|
inherit settings;
|
||||||
database = {
|
database = {
|
||||||
createLocally = lib.mkOption {
|
createLocally = lib.mkOption {
|
||||||
|
|
@ -340,7 +343,7 @@ in
|
||||||
${pkgs.replace-secret}/bin/replace-secret '@MEILISEARCH_KEY@' "${cfg.meilisearch.keyFile}" /run/sharkey/default.yml
|
${pkgs.replace-secret}/bin/replace-secret '@MEILISEARCH_KEY@' "${cfg.meilisearch.keyFile}" /run/sharkey/default.yml
|
||||||
'');
|
'');
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${cfg.package}/bin/sharkey migrateandstart";
|
ExecStart = "${sharkey}/bin/sharkey migrateandstart";
|
||||||
RuntimeDirectory = "sharkey";
|
RuntimeDirectory = "sharkey";
|
||||||
RuntimeDirectoryMode = "700";
|
RuntimeDirectoryMode = "700";
|
||||||
StateDirectory = "sharkey";
|
StateDirectory = "sharkey";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue