1
0
Fork 0
mirror of https://codeberg.org/icewind/shelve.git synced 2026-06-03 12:04:09 +02:00
This commit is contained in:
Robin Appelman 2025-06-02 21:00:23 +02:00
commit d3d50bfb2c
6 changed files with 56 additions and 51 deletions

View file

@ -1,12 +1,12 @@
{ config
, lib
, pkgs
, ...
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.services.shelve;
in
{
in {
options.services.shelve = {
enable = mkEnableOption "Enables the shelve service";
@ -24,8 +24,8 @@ in
tokens = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "foo" "bar" ];
default = [];
example = ["foo" "bar"];
description = "upload tokens";
};
@ -51,14 +51,14 @@ in
config = mkIf cfg.enable {
networking.firewall.allowedTCPPorts = lib.optional cfg.openPort cfg.port;
users.groups.shelve = { };
users.groups.shelve = {};
users.users.shelve = {
isSystemUser = true;
group = "shelve";
};
systemd.services.shelve = {
wantedBy = [ "multi-user.target" ];
wantedBy = ["multi-user.target"];
environment = {
ROCKET_PORT = toString cfg.port;
ROCKET_ADDRESS = cfg.bindAddress;

View file

@ -1,3 +1,3 @@
final: prev: {
shelve = final.callPackage ./package.nix { };
shelve = final.callPackage ./package.nix {};
}

View file

@ -1,21 +1,20 @@
{ stdenv
, rustPlatform
, lib
,
}:
let
{
stdenv,
rustPlatform,
lib,
}: let
inherit (lib.sources) sourceByRegex;
inherit (builtins) fromTOML readFile;
src = sourceByRegex ../. [ "Cargo.*" "(src|templates)(/.*)?" ];
src = sourceByRegex ../. ["Cargo.*" "(src|templates)(/.*)?"];
cargoPackage = (fromTOML (readFile ../Cargo.toml)).package;
in
rustPlatform.buildRustPackage rec {
pname = cargoPackage.name;
inherit (cargoPackage) version;
rustPlatform.buildRustPackage rec {
pname = cargoPackage.name;
inherit (cargoPackage) version;
inherit src;
inherit src;
cargoLock = {
lockFile = ../Cargo.lock;
};
}
cargoLock = {
lockFile = ../Cargo.lock;
};
}