feat(deertopia): Add Copyparty module
This commit is contained in:
90
flake.lock
generated
90
flake.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"devshell": "devshell",
|
"devshell": "devshell",
|
||||||
"nix-fetcher-data": "nix-fetcher-data",
|
"nix-fetcher-data": "nix-fetcher-data",
|
||||||
"nixpkgs": "nixpkgs_6"
|
"nixpkgs": "nixpkgs_7"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1732920288,
|
"lastModified": 1732920288,
|
||||||
@@ -20,6 +20,25 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"copyparty": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1740346641,
|
||||||
|
"narHash": "sha256-0djPRTfFhRo2FTYVNGkw9zFh8SbH0e0lyIwsrvwA1OY=",
|
||||||
|
"owner": "9001",
|
||||||
|
"repo": "copyparty",
|
||||||
|
"rev": "598a29a7339f0824bc042f35c31697e239475095",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "9001",
|
||||||
|
"repo": "copyparty",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"devshell": {
|
"devshell": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -44,7 +63,7 @@
|
|||||||
},
|
},
|
||||||
"disko": {
|
"disko": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1738148035,
|
"lastModified": 1738148035,
|
||||||
@@ -79,6 +98,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1678901627,
|
||||||
|
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils_2": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
@@ -98,7 +132,7 @@
|
|||||||
},
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1736441698,
|
"lastModified": 1736441698,
|
||||||
@@ -134,7 +168,7 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"niri-stable": "niri-stable",
|
"niri-stable": "niri-stable",
|
||||||
"niri-unstable": "niri-unstable",
|
"niri-unstable": "niri-unstable",
|
||||||
"nixpkgs": "nixpkgs_3",
|
"nixpkgs": "nixpkgs_4",
|
||||||
"nixpkgs-stable": "nixpkgs-stable",
|
"nixpkgs-stable": "nixpkgs-stable",
|
||||||
"xwayland-satellite-stable": "xwayland-satellite-stable",
|
"xwayland-satellite-stable": "xwayland-satellite-stable",
|
||||||
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
|
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
|
||||||
@@ -211,18 +245,17 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737879851,
|
"lastModified": 1680334310,
|
||||||
"narHash": "sha256-H+FXIKj//kmFHTTW4DFeOjR7F1z2/3eb2iwN6Me4YZk=",
|
"narHash": "sha256-ISWz16oGxBhF7wqAxefMPwFag6SlsA9up8muV79V9ck=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "5d3221fd57cc442a1a522a15eb5f58230f45a304",
|
"rev": "884e3b68be02ff9d61a042bc9bd9dd2a358f95da",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"id": "nixpkgs",
|
||||||
"ref": "nixpkgs-unstable",
|
"ref": "nixos-22.11",
|
||||||
"repo": "nixpkgs",
|
"type": "indirect"
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-lib": {
|
"nixpkgs-lib": {
|
||||||
@@ -254,6 +287,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1737879851,
|
||||||
|
"narHash": "sha256-H+FXIKj//kmFHTTW4DFeOjR7F1z2/3eb2iwN6Me4YZk=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "5d3221fd57cc442a1a522a15eb5f58230f45a304",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1736012469,
|
"lastModified": 1736012469,
|
||||||
"narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=",
|
"narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=",
|
||||||
@@ -269,7 +318,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1738410390,
|
"lastModified": 1738410390,
|
||||||
"narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=",
|
"narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=",
|
||||||
@@ -285,7 +334,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_4": {
|
"nixpkgs_5": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1738517419,
|
"lastModified": 1738517419,
|
||||||
"narHash": "sha256-tttEXgKimgbtPvxFl+Avos4P4lssIqxHhxpLbbvNekk=",
|
"narHash": "sha256-tttEXgKimgbtPvxFl+Avos4P4lssIqxHhxpLbbvNekk=",
|
||||||
@@ -301,7 +350,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_5": {
|
"nixpkgs_6": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731763621,
|
"lastModified": 1731763621,
|
||||||
"narHash": "sha256-ddcX4lQL0X05AYkrkV2LMFgGdRvgap7Ho8kgon3iWZk=",
|
"narHash": "sha256-ddcX4lQL0X05AYkrkV2LMFgGdRvgap7Ho8kgon3iWZk=",
|
||||||
@@ -317,7 +366,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_6": {
|
"nixpkgs_7": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1728492678,
|
"lastModified": 1728492678,
|
||||||
"narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=",
|
"narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=",
|
||||||
@@ -333,7 +382,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_7": {
|
"nixpkgs_8": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737632463,
|
"lastModified": 1737632463,
|
||||||
"narHash": "sha256-38J9QfeGSej341ouwzqf77WIHAScihAKCt8PQJ+NH28=",
|
"narHash": "sha256-38J9QfeGSej341ouwzqf77WIHAScihAKCt8PQJ+NH28=",
|
||||||
@@ -351,18 +400,19 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"copyparty": "copyparty",
|
||||||
"disko": "disko",
|
"disko": "disko",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"impermanence": "impermanence",
|
"impermanence": "impermanence",
|
||||||
"niri": "niri",
|
"niri": "niri",
|
||||||
"nixpkgs": "nixpkgs_4",
|
"nixpkgs": "nixpkgs_5",
|
||||||
"sops-nix": "sops-nix",
|
"sops-nix": "sops-nix",
|
||||||
"sydnix-cli": "sydnix-cli"
|
"sydnix-cli": "sydnix-cli"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sops-nix": {
|
"sops-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_5"
|
"nixpkgs": "nixpkgs_6"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1738291974,
|
"lastModified": 1738291974,
|
||||||
@@ -381,8 +431,8 @@
|
|||||||
"sydnix-cli": {
|
"sydnix-cli": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"clj-nix": "clj-nix",
|
"clj-nix": "clj-nix",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils_2",
|
||||||
"nixpkgs": "nixpkgs_7"
|
"nixpkgs": "nixpkgs_8"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737870551,
|
"lastModified": 1737870551,
|
||||||
|
|||||||
11
flake.nix
11
flake.nix
@@ -3,20 +3,15 @@
|
|||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
disko.url = "github:nix-community/disko";
|
disko.url = "github:nix-community/disko";
|
||||||
|
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
|
||||||
impermanence.url = "github:nix-community/impermanence";
|
impermanence.url = "github:nix-community/impermanence";
|
||||||
|
|
||||||
# We're using my branch until #6259 is merged.
|
# We're using my branch until #6259 is merged.
|
||||||
home-manager.url = "github:msyds/home-manager/service-mpdscribble";
|
home-manager.url = "github:msyds/home-manager/service-mpdscribble";
|
||||||
# home-manager.url = "path:///persist/dots/DELETE-ME/home-manager";
|
# home-manager.url = "path:///persist/dots/DELETE-ME/home-manager";
|
||||||
|
|
||||||
niri.url = "github:sodiboo/niri-flake";
|
niri.url = "github:sodiboo/niri-flake";
|
||||||
|
|
||||||
sops-nix.url = "github:Mic92/sops-nix";
|
sops-nix.url = "github:Mic92/sops-nix";
|
||||||
|
|
||||||
sydnix-cli.url = "path:///persist/dots/scripts/sydnix-cli";
|
sydnix-cli.url = "path:///persist/dots/scripts/sydnix-cli";
|
||||||
|
copyparty.url = "github:9001/copyparty";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { nixpkgs, ... }@inputs:
|
outputs = { nixpkgs, ... }@inputs:
|
||||||
@@ -30,9 +25,7 @@
|
|||||||
collectModules = path:
|
collectModules = path:
|
||||||
let modules = list-nix-directory path;
|
let modules = list-nix-directory path;
|
||||||
in { pkgs, lib, ... }: {
|
in { pkgs, lib, ... }: {
|
||||||
imports =
|
imports = builtins.map (m: ./${path}/${m}) modules;
|
||||||
lib.debug.traceVal
|
|
||||||
(builtins.map (m: ./${path}/${m}) modules);
|
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
# REVIEW: Why don't we put each module under nixosModules.<name>?
|
# REVIEW: Why don't we put each module under nixosModules.<name>?
|
||||||
|
|||||||
@@ -99,6 +99,7 @@
|
|||||||
nginx.enable = true;
|
nginx.enable = true;
|
||||||
slskd.enable = true;
|
slskd.enable = true;
|
||||||
webdav.enable = true;
|
webdav.enable = true;
|
||||||
|
copyparty.enable = true;
|
||||||
|
|
||||||
# A simple default webpage. This should probably live somewhere else.
|
# A simple default webpage. This should probably live somewhere else.
|
||||||
nginx.vhosts."www" = {
|
nginx.vhosts."www" = {
|
||||||
|
|||||||
54
modules/nixos/deertopia/copyparty.nix
Normal file
54
modules/nixos/deertopia/copyparty.nix
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
{ config, lib, pkgs, ... }@inputs:
|
||||||
|
|
||||||
|
let cfg = config.sydnix.deertopia.copyparty;
|
||||||
|
in {
|
||||||
|
options.sydnix.deertopia.copyparty = {
|
||||||
|
enable = lib.mkEnableOption "Copyparty";
|
||||||
|
port = lib.mkOption {
|
||||||
|
type = lib.types.port;
|
||||||
|
description = ''
|
||||||
|
Port on which Copyparty is to listen.
|
||||||
|
'';
|
||||||
|
default = 3923;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
sydnix.impermanence.directories = [
|
||||||
|
];
|
||||||
|
|
||||||
|
nixpkgs.overlays = [ inputs.copyparty.overlays.default ];
|
||||||
|
|
||||||
|
services.copyparty = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
xff-src = "lan";
|
||||||
|
idp-h-usr = "remote-user";
|
||||||
|
idp-h-grp = "remote-groups";
|
||||||
|
};
|
||||||
|
volumes = {
|
||||||
|
"/Jellyfin" = {
|
||||||
|
path = "/persist/vault/jellyfin";
|
||||||
|
# View and upload, but no deleting.
|
||||||
|
access.rw = "*";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
sydnix.deertopia.nginx.vhosts."files" = {
|
||||||
|
directory = null;
|
||||||
|
vhost = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
extraConfig = ''
|
||||||
|
include ${./authelia/authelia-location.conf};
|
||||||
|
'';
|
||||||
|
locations."/".extraConfig = ''
|
||||||
|
include ${./authelia/authelia-authrequest.conf};
|
||||||
|
include ${./authelia/proxy.conf};
|
||||||
|
proxy_pass http://localhost:${builtins.toString cfg.port};
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -21,6 +21,7 @@ let
|
|||||||
mkHost = hostName:
|
mkHost = hostName:
|
||||||
let system = import ../hosts/${hostName}/system.nix;
|
let system = import ../hosts/${hostName}/system.nix;
|
||||||
in nixpkgs.lib.nixosSystem {
|
in nixpkgs.lib.nixosSystem {
|
||||||
|
# Pass `inputs` to all modules as a 'special arg,' like `config` or `lib`.
|
||||||
specialArgs = inputs;
|
specialArgs = inputs;
|
||||||
inherit system;
|
inherit system;
|
||||||
modules = [
|
modules = [
|
||||||
@@ -28,9 +29,11 @@ let
|
|||||||
|
|
||||||
inputs.self.nixosModules.default
|
inputs.self.nixosModules.default
|
||||||
|
|
||||||
|
# TODO: Move imports to their own respective modules.
|
||||||
inputs.disko.nixosModules.disko
|
inputs.disko.nixosModules.disko
|
||||||
inputs.sops-nix.nixosModules.sops
|
inputs.sops-nix.nixosModules.sops
|
||||||
inputs.impermanence.nixosModules.impermanence
|
inputs.impermanence.nixosModules.impermanence
|
||||||
|
inputs.copyparty.nixosModules.default
|
||||||
|
|
||||||
# Directory name should always match host name.
|
# Directory name should always match host name.
|
||||||
({ ... }: { networking.hostName = hostName; })
|
({ ... }: { networking.hostName = hostName; })
|
||||||
|
|||||||
Reference in New Issue
Block a user