add aspects/server/ NixOS modules
Server-specific NixOS configuration: boot, nix, tailscale Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
37f2d5f64a
commit
f5c44965a8
3 changed files with 46 additions and 0 deletions
10
aspects/server/boot.nix
Normal file
10
aspects/server/boot.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# aspects/server/boot.nix
|
||||
{ inputs, ... }:
|
||||
{
|
||||
flake.modules.nixos.server-boot = { config, lib, pkgs, ... }: {
|
||||
# Import parent aspect for inheritance
|
||||
imports = [ inputs.self.modules.nixos.common-boot ];
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages_hardened;
|
||||
};
|
||||
}
|
||||
18
aspects/server/nix.nix
Normal file
18
aspects/server/nix.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# aspects/server/nix.nix
|
||||
{ inputs, ... }:
|
||||
{
|
||||
flake.modules.nixos.server-nix = { config, lib, pkgs, ... }: {
|
||||
# Import parent aspect for inheritance
|
||||
imports = [ inputs.self.modules.nixos.common-nix ];
|
||||
|
||||
environment.etc."channels/nixpkgs".source = inputs.nixpkgs-stable.outPath;
|
||||
|
||||
nix = {
|
||||
registry.nixpkgs.flake = inputs.nixpkgs-stable;
|
||||
nixPath = [
|
||||
"nixpkgs=/etc/channels/nixpkgs"
|
||||
"/nix/var/nix/profiles/per-user/root/channels"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
18
aspects/server/tailscale.nix
Normal file
18
aspects/server/tailscale.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# aspects/server/tailscale.nix
|
||||
{ inputs, ... }:
|
||||
{
|
||||
flake.modules.nixos.server-tailscale = { config, lib, pkgs, ... }: {
|
||||
# Import parent aspect for inheritance
|
||||
imports = [ inputs.self.modules.nixos.common-tailscale ];
|
||||
|
||||
services.tailscale = {
|
||||
extraSetFlags = [ "--advertise-exit-node" ];
|
||||
useRoutingFeatures = "server";
|
||||
};
|
||||
|
||||
boot.kernel.sysctl = {
|
||||
"net.ipv4.ip_forward" = 1;
|
||||
"net.ipv6.conf.all.forwarding" = 1;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue