add fileshare
This commit is contained in:
24
flake.lock
generated
24
flake.lock
generated
@@ -634,11 +634,11 @@
|
||||
},
|
||||
"nixos-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1716987116,
|
||||
"narHash": "sha256-uuEkErFVsFdg2K0cKbNQ9JlFSAm/xYqPr4rbPLI91Y8=",
|
||||
"lastModified": 1717248095,
|
||||
"narHash": "sha256-e8X2eWjAHJQT82AAN+mCI0B68cIDBJpqJ156+VRrFO0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "8251761f93d6f5b91cee45ac09edb6e382641009",
|
||||
"rev": "7b49d3967613d9aacac5b340ef158d493906ba79",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -779,11 +779,11 @@
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1717191071,
|
||||
"narHash": "sha256-wue0+NHKFhTiY7dTtP0jyNwVgUCMOBfcP7mSHVa6PMw=",
|
||||
"lastModified": 1717269089,
|
||||
"narHash": "sha256-PUxRImLJThMBjC8reFM/EXfLrv95miC7U8euZyDqSns=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixvim",
|
||||
"rev": "d15fade62b743839a20d927d3506d503858f49f0",
|
||||
"rev": "9a9d6c69d8be9c5fa66f0714de22564df72aaa96",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -794,11 +794,11 @@
|
||||
},
|
||||
"nur": {
|
||||
"locked": {
|
||||
"lastModified": 1717242279,
|
||||
"narHash": "sha256-ovx7RavkxxTXRokC5h1rmKtMZj8QautKLw9XhwGs8R4=",
|
||||
"lastModified": 1717271186,
|
||||
"narHash": "sha256-BEVwC1UI1Zh3b1jh43Fz9JGchxla98mkceDKs0TmZyk=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NUR",
|
||||
"rev": "5b704d93015b0e73a5d528fc97598b33e71cda69",
|
||||
"rev": "803e2370d6ca2a0a5f06a7a936bdf238d93a861a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -840,11 +840,11 @@
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1717212835,
|
||||
"narHash": "sha256-fSNsRokB3YaTmJOcSdDzKJOFWq/bQ/FCoMGpF12sF5c=",
|
||||
"lastModified": 1717268716,
|
||||
"narHash": "sha256-hKM/D6Ni3+Ihvmy8pF+rOFgIqhphOEHUWqxJd+5ZV6Y=",
|
||||
"owner": "danth",
|
||||
"repo": "stylix",
|
||||
"rev": "266db7f00cad4a465e0ce43d91798fda10716212",
|
||||
"rev": "3befd5d693a2669dc7d2086b57298838ff71f24b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
};
|
||||
outputs = { self, nur, nixpkgs, nixos-hardware, nixos-wsl, nixpkgs-unstable
|
||||
, agenix, home-manager, home-manager-unstable, nix-colors, nixos-cosmic
|
||||
, nixvim, stylix, disko, flake-utils }@inputs:
|
||||
, nixvim, stylix, disko, flake-utils, ... }@inputs:
|
||||
let
|
||||
inherit (self) outputs;
|
||||
system = "x86_64-linux";
|
||||
|
||||
1
home-manager/nixvim/barbar.nix
Normal file
1
home-manager/nixvim/barbar.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ plugins.barbar = { enable = true; }; }
|
||||
@@ -1 +0,0 @@
|
||||
{ plugins.bufferline = { enable = true; }; }
|
||||
@@ -99,7 +99,7 @@
|
||||
options.desc = "Gitsigns reset current buffer";
|
||||
}
|
||||
|
||||
# Tabs
|
||||
# Tabs (barbar)
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>tn";
|
||||
@@ -109,19 +109,19 @@
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>td";
|
||||
action = "<CMD>tabclose<CR>";
|
||||
action = "<CMD>BufferClose<CR>";
|
||||
options.desc = "Close tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>tt";
|
||||
action = "<CMD>tabnext<CR>";
|
||||
action = "<CMD>BufferNext<CR>";
|
||||
options.desc = "Go to the sub-sequent tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>tp";
|
||||
action = "<CMD>tabprevious<CR>";
|
||||
action = "<CMD>BufferPrevious<CR>";
|
||||
options.desc = "Go to the previous tab";
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ let
|
||||
./auto-pairs.nix
|
||||
./autosave.nix
|
||||
./blankline.nix
|
||||
./bufferline.nix
|
||||
./barbar.nix
|
||||
./cmp.nix
|
||||
./fidget.nix
|
||||
./refactoring.nix
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
./fileshelter.nix
|
||||
./wireguard.nix
|
||||
./kop-monitor.nix
|
||||
./kop-fileshare.nix
|
||||
./adam-site.nix
|
||||
];
|
||||
}
|
||||
|
||||
62
modules/services/kop-fileshare.nix
Normal file
62
modules/services/kop-fileshare.nix
Normal file
@@ -0,0 +1,62 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
with lib;
|
||||
let cfg = config.custom.services.kop-fileshare;
|
||||
in {
|
||||
options = {
|
||||
custom.services.kop-fileshare = {
|
||||
enable = mkEnableOption "Enable the file upload server";
|
||||
port = mkOption {
|
||||
type = types.int;
|
||||
default = 7777;
|
||||
description = "Port for the file upload server";
|
||||
};
|
||||
dataDir = mkOption {
|
||||
type = types.str;
|
||||
default = "/var/lib/file-upload";
|
||||
description = "Directory to store uploaded files";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
users.users.kop-fileshare = {
|
||||
home = cfg.dataDir;
|
||||
createHome = true;
|
||||
isSystemUser = true;
|
||||
group = "kop-fileshare";
|
||||
};
|
||||
users.groups.kop-fileshare = {};
|
||||
systemd.services.kop-fileshare = {
|
||||
description = "File Upload Server";
|
||||
wants = [ "network-online.target" ];
|
||||
after = [ "network.target" "network-online.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.kop-fileshare}/bin/kop-fileshare";
|
||||
WorkingDirectory = cfg.dataDir;
|
||||
User = "kop-fileshare";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "5s";
|
||||
PrivateMounts = mkDefault true;
|
||||
PrivateTmp = mkDefault true;
|
||||
PrivateUsers = mkDefault true;
|
||||
ProtectClock = mkDefault true;
|
||||
ProtectControlGroups = mkDefault true;
|
||||
ProtectHome = mkDefault true;
|
||||
ProtectHostname = mkDefault true;
|
||||
ProtectKernelLogs = mkDefault true;
|
||||
ProtectKernelModules = mkDefault true;
|
||||
ProtectKernelTunables = mkDefault true;
|
||||
ProtectSystem = mkDefault "strict";
|
||||
# Needs network access
|
||||
PrivateNetwork = mkDefault false;
|
||||
};
|
||||
|
||||
environment = {
|
||||
PORT = "${toString cfg.port}";
|
||||
UPLOAD_PATH = "${toString cfg.dataDir}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -4,5 +4,6 @@
|
||||
kop-website =
|
||||
pkgs.callPackage ./website/default.nix { inherit kop-hub ente-frontend; };
|
||||
kop-monitor = pkgs.callPackage ./kop-monitor/default.nix { };
|
||||
kop-fileshare = pkgs.callPackage ./kop-fileshare/default.nix { };
|
||||
adam-site = pkgs.callPackage ./adam-site/default.nix { };
|
||||
}
|
||||
|
||||
18
pkgs/kop-fileshare/default.nix
Normal file
18
pkgs/kop-fileshare/default.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ buildGoModule, stdenv, pkgs, lib, ... }:
|
||||
buildGoModule rec {
|
||||
pname = "kop-fileshare";
|
||||
version = "0.0.1";
|
||||
|
||||
src = fetchGit {
|
||||
url = "git@github.com:kropatz/kop-fileshare.git";
|
||||
ref = "master";
|
||||
rev = "3556ccab052233c0d5d70baa631ba8b56ee8ebdb";
|
||||
};
|
||||
vendorHash = "sha256-OQ6rNgOQHrrhE7DT+ulwpWJCDJ4DeJiDzriAu3mfS7I=";
|
||||
|
||||
meta = {
|
||||
description = "Simple drag and drop file uploading/sharing website";
|
||||
homepage = "https://github.com/Kropatz/kop-fileshare";
|
||||
license = lib.licenses.gpl3;
|
||||
};
|
||||
}
|
||||
@@ -15,7 +15,10 @@
|
||||
ld.enable = true;
|
||||
settings.enable = true;
|
||||
};
|
||||
services = { adam-site.enable = true; };
|
||||
services = {
|
||||
#adam-site.enable = true;
|
||||
kop-fileshare.enable = true;
|
||||
};
|
||||
graphical = { lxqt.enable = true; };
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user