Compare commits

...

1 commit

Author SHA1 Message Date
81269c0f75
Services 2024-12-12 16:23:35 -07:00
6 changed files with 120 additions and 9 deletions

69
flake.lock generated
View file

@ -145,6 +145,24 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_4": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -288,6 +306,20 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1682134069,
"narHash": "sha256-TnI/ZXSmRxQDt2sjRYK/8j8iha4B4zP2cnQCZZ3vp7k=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fd901ef4bf93499374c5af385b2943f5801c0833",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"plasma-manager": { "plasma-manager": {
"inputs": { "inputs": {
"home-manager": [ "home-manager": [
@ -322,7 +354,8 @@
"nixpkgs-24-11": "nixpkgs-24-11", "nixpkgs-24-11": "nixpkgs-24-11",
"plasma-manager": "plasma-manager", "plasma-manager": "plasma-manager",
"sddm-sugar-candy-nix": "sddm-sugar-candy-nix", "sddm-sugar-candy-nix": "sddm-sugar-candy-nix",
"vscode-extensions": "vscode-extensions" "vscode-extensions": "vscode-extensions",
"vscode-server": "vscode-server"
} }
}, },
"sddm-sugar-candy-nix": { "sddm-sugar-candy-nix": {
@ -375,6 +408,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"vscode-extensions": { "vscode-extensions": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
@ -396,6 +444,25 @@
"repo": "nix-vscode-extensions", "repo": "nix-vscode-extensions",
"type": "github" "type": "github"
} }
},
"vscode-server": {
"inputs": {
"flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1729422940,
"narHash": "sha256-DlvJv33ml5UTKgu4b0HauOfFIoDx6QXtbqUF3vWeRCY=",
"owner": "nix-community",
"repo": "nixos-vscode-server",
"rev": "8b6db451de46ecf9b4ab3d01ef76e59957ff549f",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-vscode-server",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -48,9 +48,11 @@
url = "github:nix-community/nix-vscode-extensions"; url = "github:nix-community/nix-vscode-extensions";
inputs.nixpkgs.follows = "nixpkgs"; 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"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
secrets = import ./secrets.nix; secrets = import ./secrets.nix;
@ -108,6 +110,10 @@
vscode.enable = false; vscode.enable = false;
}; };
} }
# VSCode server support
vscode-server.nixosModules.default
({ pkgs, ... }: { services.vscode-server = { enable = true; nodejsPackage = pkgs.nodejs-18_x; installPath = "$HOME/.vscodium-server"; }; })
]; ];
specialArgs = { specialArgs = {

View file

@ -10,6 +10,7 @@
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./modules ./modules
./services
]; ];
system.stateVersion = "24.11"; system.stateVersion = "24.11";

View file

@ -1,12 +1,17 @@
{ ... }: { ... }:
{ {
networking.hostName = "ty-laptop-server"; networking = {
hostName = "ty-laptop-server";
# Enable firewall # Enable firewall
networking.firewall.enable = true; firewall = {
enable = true;
trustedInterfaces = [ "lo" "ve-jellyfin" ];
};
# Enable NetworkManager # Enable NetworkManager
networking.networkmanager.enable = true; networkmanager.enable = true;
};
# Tailscale overlay network configuration # Tailscale overlay network configuration
services.tailscale = { services.tailscale = {

View file

@ -0,0 +1,15 @@
{ ... }:
{
imports = [
./jellyfin.nix
];
networking = {
nat = {
enable = true;
internalInterfaces = ["ve-jellyfin"];
externalInterface = "wlp2s0";
};
networkmanager.unmanaged = [ "interface-name:ve-jellyfin" ];
};
}

View file

@ -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";
};
}