From 72cf59fbeeccb73f2c33b3188cbd8bf209d65cd5 Mon Sep 17 00:00:00 2001 From: Tyler Beckman Date: Thu, 12 Dec 2024 15:33:50 -0700 Subject: [PATCH] Services --- flake.nix | 10 ++++++++-- hosts/laptop-server/default.nix | 1 + hosts/laptop-server/services/default.nix | 15 +++++++++++++++ hosts/laptop-server/services/jellyfin.nix | 17 +++++++++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 hosts/laptop-server/services/default.nix create mode 100644 hosts/laptop-server/services/jellyfin.nix diff --git a/flake.nix b/flake.nix index 2146bb9..c1f5b57 100755 --- a/flake.nix +++ b/flake.nix @@ -48,9 +48,11 @@ url = "github:nix-community/nix-vscode-extensions"; inputs.nixpkgs.follows = "nixpkgs"; }; + # VSCode server support + vscode-server.url = "github:nix-community/nixos-vscode-server"; }; - outputs = inputs@{ nixpkgs, home-manager, plasma-manager, nix-index-database, ... }: let + outputs = inputs@{ nixpkgs, home-manager, plasma-manager, nix-index-database, vscode-server, ... }: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; secrets = import ./secrets.nix; @@ -108,6 +110,10 @@ vscode.enable = false; }; } + + # VSCode server support + vscode-server.nixosModules.default + { services.vscode-server.enable = true; } ]; specialArgs = { @@ -115,4 +121,4 @@ }; }; }; -} \ No newline at end of file +} diff --git a/hosts/laptop-server/default.nix b/hosts/laptop-server/default.nix index 3fb21a3..3daba20 100644 --- a/hosts/laptop-server/default.nix +++ b/hosts/laptop-server/default.nix @@ -10,6 +10,7 @@ imports = [ ./hardware-configuration.nix ./modules + ./services ]; system.stateVersion = "24.11"; diff --git a/hosts/laptop-server/services/default.nix b/hosts/laptop-server/services/default.nix new file mode 100644 index 0000000..d80fe27 --- /dev/null +++ b/hosts/laptop-server/services/default.nix @@ -0,0 +1,15 @@ +{ ... }: +{ + imports = [ + ./jellyfin.nix + ]; + + networking = { + nat = { + enable = true; + internalInterfaces = ["ve-+"]; + externalInterface = "wlp2s0"; + }; + networkmanager.unmanaged = [ "interface-name:ve-*" ]; + }; +} \ No newline at end of file diff --git a/hosts/laptop-server/services/jellyfin.nix b/hosts/laptop-server/services/jellyfin.nix new file mode 100644 index 0000000..7b24fb0 --- /dev/null +++ b/hosts/laptop-server/services/jellyfin.nix @@ -0,0 +1,17 @@ +{ config, ... }: +{ + containers.jellyfin = { + config = { pkgs, ...}: { + system.stateVersion = "25.05"; + + services.jellyfin = { + enable = true; + package = pkgs.jellyfin; + }; + }; + autoStart = true; + privateNetwork = true; + hostAddress = "172.30.0.2"; # TODO define in config option + localAddress = "172.30.0.2"; + }; +} \ No newline at end of file