nix

configuration files that power my machines
Log | Files | Refs | README | LICENSE

commit 1086e1aef7a37b41705f6b0b4691d23b89736cbd
parent 98c405d969557cd7e1146cbd9b2d5d2a669a08ce
Author: mtmn <miro@haravara.org>
Date:   Mon, 13 Apr 2026 09:57:43 +0200

chore: rename to corpus

Diffstat:
Mflake.lock | 68++++++++++++++++++++++++++++++++++----------------------------------
Mflake.nix | 6+++---
Mhosts/nixaran/configuration.nix | 0
Amodules/services/corpus.nix | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dmodules/services/scorpus.nix | 65-----------------------------------------------------------------
Msecrets.nix | 1+
Asecrets/corpus.age | 0
7 files changed, 103 insertions(+), 102 deletions(-)

diff --git a/flake.lock b/flake.lock @@ -8,7 +8,7 @@ "ragenix", "nixpkgs" ], - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1761656077, @@ -24,6 +24,25 @@ "type": "github" } }, + "corpus": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1776067383, + "narHash": "sha256-ANOE4wBOkYu1i4MepeVNN5mhAEQZcltH9gr+U2VtFhU=", + "ref": "refs/heads/master", + "rev": "21a3bf5a0431b9295f9b072fbb0f8b25d96190dc", + "revCount": 51, + "type": "git", + "url": "ssh://git@codeberg.org/mtmn/corpus.git" + }, + "original": { + "type": "git", + "url": "ssh://git@codeberg.org/mtmn/corpus.git" + } + }, "crane": { "locked": { "lastModified": 1760924934, @@ -122,7 +141,7 @@ }, "flake-utils": { "inputs": { - "systems": "systems_3" + "systems": "systems" }, "locked": { "lastModified": 1731533236, @@ -163,11 +182,11 @@ ] }, "locked": { - "lastModified": 1776030105, - "narHash": "sha256-b4cNpWPDSH+/CTTiw8++yGh1UYG2kQNrbIehV2iGoeo=", + "lastModified": 1776046499, + "narHash": "sha256-Wzc4nn07/0RL21ypPHRzNDQZcjhIC8LaYo7QJQjM5T4=", "owner": "nix-community", "repo": "home-manager", - "rev": "49088dc2e7a876e338e510c5f5f60f659819c650", + "rev": "287f84846c1eb3b72c986f5f6bebcff0bd67440d", "type": "github" }, "original": { @@ -220,11 +239,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1775888245, - "narHash": "sha256-nwASzrRDD1JBEu/o8ekKYEXm/oJW6EMCzCRdrwcLe90=", + "lastModified": 1775793324, + "narHash": "sha256-omax7atcZbol+6HJ2RLpP+ZCFcPa5bZ65Hn71RufeWQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "13043924aaa7375ce482ebe2494338e058282925", + "rev": "9d29d5f667d7467f98efc31881e824fa586c927e", "type": "github" }, "original": { @@ -236,11 +255,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1775793324, - "narHash": "sha256-omax7atcZbol+6HJ2RLpP+ZCFcPa5bZ65Hn71RufeWQ=", + "lastModified": 1775888245, + "narHash": "sha256-nwASzrRDD1JBEu/o8ekKYEXm/oJW6EMCzCRdrwcLe90=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9d29d5f667d7467f98efc31881e824fa586c927e", + "rev": "13043924aaa7375ce482ebe2494338e058282925", "type": "github" }, "original": { @@ -254,7 +273,7 @@ "inputs": { "agenix": "agenix", "crane": "crane", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "nixpkgs": [ "nixpkgs" ], @@ -276,13 +295,13 @@ }, "root": { "inputs": { + "corpus": "corpus", "deploy-rs": "deploy-rs", "disko": "disko", "home-manager": "home-manager", "nix-index-database": "nix-index-database", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "ragenix": "ragenix", - "scorpus": "scorpus", "tools": "tools" } }, @@ -307,25 +326,6 @@ "type": "github" } }, - "scorpus": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1776031188, - "narHash": "sha256-1OwH38hzswkol26qfqsoM9n/cZgFtoFi87kARldwl8s=", - "ref": "refs/heads/master", - "rev": "aa9ace4b5c5ccb23983417e8b366962d8ab95030", - "revCount": 43, - "type": "git", - "url": "ssh://git@codeberg.org/mtmn/scorpus.git" - }, - "original": { - "type": "git", - "url": "ssh://git@codeberg.org/mtmn/scorpus.git" - } - }, "systems": { "locked": { "lastModified": 1681028828, @@ -404,7 +404,7 @@ }, "utils": { "inputs": { - "systems": "systems" + "systems": "systems_2" }, "locked": { "lastModified": 1731533236, diff --git a/flake.nix b/flake.nix @@ -34,8 +34,8 @@ flake = false; }; - scorpus = { - url = "git+ssh://git@codeberg.org/mtmn/scorpus.git"; + corpus = { + url = "git+ssh://git@codeberg.org/mtmn/corpus.git"; }; }; @@ -173,7 +173,7 @@ "attic" "static" "miniflux" - "scorpus" + "corpus" "napkins" "listenbrainz-mpd" "redlib" diff --git a/hosts/nixaran/configuration.nix b/hosts/nixaran/configuration.nix Binary files differ. diff --git a/modules/services/corpus.nix b/modules/services/corpus.nix @@ -0,0 +1,65 @@ +{ + config, + lib, + pkgs, + inputs, + ... +}: let + cfg = config.services.haravara.corpus; +in { + options.services.haravara.corpus = { + enable = lib.mkEnableOption "Scorpus - ListenBrainz frontend"; + + port = lib.mkOption { + type = lib.types.port; + default = 8321; + }; + + domain = lib.mkOption { + type = lib.types.str; + }; + + dataDir = lib.mkOption { + type = lib.types.str; + default = "/var/lib/corpus"; + }; + }; + + config = lib.mkIf cfg.enable { + age.secrets.corpus = { + file = ../../secrets/corpus.age; + owner = "corpus"; + }; + + systemd.services.corpus = { + description = "Scorpus - ListenBrainz frontend"; + wantedBy = ["multi-user.target"]; + after = ["network.target"]; + + environment = { + PORT = toString cfg.port; + DATABASE_FILE = "${cfg.dataDir}/corpus.db"; + }; + + serviceConfig = { + ExecStart = "${inputs.corpus.packages.${pkgs.stdenv.hostPlatform.system}.default}/bin/scorpus-server"; + EnvironmentFile = config.age.secrets.corpus.path; + Restart = "always"; + User = "corpus"; + Group = "corpus"; + StateDirectory = "corpus"; + WorkingDirectory = cfg.dataDir; + }; + }; + + users.users.corpus = { + isSystemUser = true; + group = "corpus"; + }; + users.groups.corpus = {}; + + services.caddy.virtualHosts."${cfg.domain}".extraConfig = '' + reverse_proxy 127.0.0.1:${toString cfg.port} + ''; + }; +} diff --git a/modules/services/scorpus.nix b/modules/services/scorpus.nix @@ -1,65 +0,0 @@ -{ - config, - lib, - pkgs, - inputs, - ... -}: let - cfg = config.services.haravara.scorpus; -in { - options.services.haravara.scorpus = { - enable = lib.mkEnableOption "Scorpus - ListenBrainz frontend"; - - port = lib.mkOption { - type = lib.types.port; - default = 8321; - }; - - domain = lib.mkOption { - type = lib.types.str; - }; - - dataDir = lib.mkOption { - type = lib.types.str; - default = "/var/lib/scorpus"; - }; - }; - - config = lib.mkIf cfg.enable { - age.secrets.scorpus = { - file = ../../secrets/scorpus.age; - owner = "scorpus"; - }; - - systemd.services.scorpus = { - description = "Scorpus - ListenBrainz frontend"; - wantedBy = ["multi-user.target"]; - after = ["network.target"]; - - environment = { - PORT = toString cfg.port; - DATABASE_FILE = "${cfg.dataDir}/scorpus.db"; - }; - - serviceConfig = { - ExecStart = "${inputs.scorpus.packages.${pkgs.stdenv.hostPlatform.system}.default}/bin/scorpus-server"; - EnvironmentFile = config.age.secrets.scorpus.path; - Restart = "always"; - User = "scorpus"; - Group = "scorpus"; - StateDirectory = "scorpus"; - WorkingDirectory = cfg.dataDir; - }; - }; - - users.users.scorpus = { - isSystemUser = true; - group = "scorpus"; - }; - users.groups.scorpus = {}; - - services.caddy.virtualHosts."${cfg.domain}".extraConfig = '' - reverse_proxy 127.0.0.1:${toString cfg.port} - ''; - }; -} diff --git a/secrets.nix b/secrets.nix @@ -17,4 +17,5 @@ in { "secrets/listenbrainz-token.age".publicKeys = allKeys; "secrets/mpd-host.age".publicKeys = allKeys; "secrets/scorpus.age".publicKeys = allKeys; + "secrets/corpus.age".publicKeys = allKeys; } diff --git a/secrets/corpus.age b/secrets/corpus.age Binary files differ.