adding server config to repo. setting up laptop in repo. other changes.

This commit is contained in:
2026-01-31 10:37:44 -06:00
parent 11af2f699f
commit 4d7713173d
13 changed files with 515 additions and 18 deletions

7
.sops.yaml Normal file
View File

@@ -0,0 +1,7 @@
keys:
- &primary age1mvup35ycxdxum8ergeagtjqxshdprr8av9yg5myl89y5nthwyqhqws86ny
creation_rules:
- path_regex: secrets/secrets.yaml$
key_groups:
- age:
- *primary

24
flake.lock generated
View File

@@ -8,11 +8,11 @@
]
},
"locked": {
"lastModified": 1763759067,
"narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=",
"lastModified": 1768135262,
"narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0",
"rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac",
"type": "github"
},
"original": {
@@ -28,11 +28,11 @@
]
},
"locked": {
"lastModified": 1764998300,
"narHash": "sha256-fZatn/KLfHLDXnF0wy7JxXqGaZmGDTVufT4o/AOlj44=",
"lastModified": 1769813945,
"narHash": "sha256-9ABv9Lo9t6MrFjlnRnU8Zw1C6LVj2+R8PipQ/rxGLHk=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "27a6182347ccae90a88231ae0dc5dfa7d15815bb",
"rev": "475921375def3eb930e1f8883f619ff8609accb6",
"type": "github"
},
"original": {
@@ -43,11 +43,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1764950072,
"narHash": "sha256-BmPWzogsG2GsXZtlT+MTcAWeDK5hkbGRZTeZNW42fwA=",
"lastModified": 1769461804,
"narHash": "sha256-msG8SU5WsBUfVVa/9RPLaymvi5bI8edTavbIq3vRlhI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "f61125a668a320878494449750330ca58b78c557",
"rev": "bfc1b8a4574108ceef22f02bafcf6611380c100d",
"type": "github"
},
"original": {
@@ -66,11 +66,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1765115924,
"narHash": "sha256-taZc/QD5DeZkXsyl+AJiS2Q5Z8EXJPzZz98uWfdXvvs=",
"lastModified": 1769644746,
"narHash": "sha256-1X9o0GjCzku03magX4pM+1OZXA0aUTN7KvEReZ9t3OU=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "cd0443e166c1cd35283e9be0ce3fc2966456bc5a",
"rev": "3c27e1b35ca0fee6a89bfc20840654361ffe888d",
"type": "github"
},
"original": {

View File

@@ -11,14 +11,28 @@
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix.url = "github:Mic92/sops-nix";
};
outputs = { self, nixpkgs, home-manager, nixvim }@inputs: {
outputs = { self, nixpkgs, home-manager, nixvim, sops-nix }@inputs: {
nixosConfigurations = {
lily-desktop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ ./hosts/desktop/configuration.nix ];
specialArgs = { inherit inputs; };
};
laptop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ ./hosts/laptop/configuration.nix ];
specialArgs = { inherit inputs; };
};
lily-server = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./hosts/desktop/configuration.nix
sops-nix.nixosModules.sops
./hosts/server/configuration.nix
];
specialArgs = { inherit inputs; };
};
@@ -28,7 +42,7 @@
pkgs = import nixpkgs { system = "x86_64-linux"; };
modules = [
./users/lily/home.nix
inputs.nixvim.homeModules.nixvim
inputs.nixvim.homeModules.nixvim
];
extraSpecialArgs = { inherit inputs; };
};

View File

@@ -8,8 +8,9 @@
../../modules/nixos/ai/default.nix
../../modules/nixos/desktops/gnome.nix
../../modules/nixos/desktops/river.nix
../../modules/nixos/fonts.nix
../../modules/nixos/applications.nix
../../modules/nixos/fonts.nix
../../modules/nixos/programming.nix
];
# Bootloader.
@@ -60,6 +61,15 @@
];
};
users.users.work = {
isNormalUser = true;
description = "Lily Luna Anderson";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
# thunderbird
];
};
programs.nh = {
enable = true;
flake = "/home/lily/Programming/LiNix";

View File

@@ -0,0 +1,130 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
../../modules/nixos/localization.nix
../../modules/nixos/applications.nix
../../modules/nixos/fonts.nix
../../modules/nixos/programming.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "laptop"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Enable the X11 windowing system.
# You can disable this if you're only using the Wayland session.
services.xserver.enable = true;
# Enable the KDE Plasma Desktop Environment.
services.displayManager.sddm.enable = true;
services.desktopManager.plasma6.enable = true;
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.lily = {
isNormalUser = true;
description = "Lily Luna Anderson";
extraGroups = [ "networkmanager" "wheel" "lily" ];
packages = with pkgs; [
kdePackages.kate
# thunderbird
];
};
users.groups.lily = { };
programs.nh = {
enable = true;
flake = "/home/lily/Programming/LiNix";
};
# Install firefox.
programs.firefox.enable = true;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
git
gimp
home-manager
bluez
kdePackages.plasma-keyboard
kdePackages.bluedevil
kdePackages.bluez-qt
# wget
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "25.11"; # Did you read the comment?
}

View File

@@ -0,0 +1,47 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/mapper/luks-fbc12fd4-a2b8-44b1-a89a-e502662b1fce";
fsType = "btrfs";
options = [ "subvol=@" ];
};
boot.initrd.luks.devices."luks-fbc12fd4-a2b8-44b1-a89a-e502662b1fce".device = "/dev/disk/by-uuid/fbc12fd4-a2b8-44b1-a89a-e502662b1fce";
fileSystems."/home" =
{ device = "/dev/mapper/luks-fbc12fd4-a2b8-44b1-a89a-e502662b1fce";
fsType = "btrfs";
options = [ "subvol=@home" ];
};
fileSystems."/media/nvme" =
{ device = "/dev/mapper/luks-fbc12fd4-a2b8-44b1-a89a-e502662b1fce";
fsType = "btrfs";
#options = [ ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/C51E-CE6C";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -0,0 +1,45 @@
{ config, pkgs, ... }:
{
imports = [
./hardware-configuration.nix
./nginx.nix
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "lily-server";
networking.networkmanager.enable = true;
services.displayManager.sddm.enable = true;
services.desktopManager.plasma6.enable = true;
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
X11Forwarding = false;
};
};
nixpkgs.config.allowUnfree = true;
networking.firewall.allowedTCPPorts = [ 22 80 443 9001 9002 ];
users.users.lily = {
isNormalUser = true;
description = "Lily Luna";
extraGroups = [ "networkmanager" "wheel" "lily" "input" "uinput" ];
};
users.groups.lily = { };
programs.nh = {
enable = true;
flake = "/home/lily/Programming/LiNix26";
};
environment.systemPackages = with pkgs; [ vim firefox ];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
system.stateVersion = "24.11";
}

View File

@@ -0,0 +1,40 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/208d39a0-fa7d-4fe4-be61-8867e7a51bc8";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/AED2-D209";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/ec9d9773-d48b-4221-af73-7c365fe0966d"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

11
hosts/server/jupyter.nix Normal file
View File

@@ -0,0 +1,11 @@
{ config, pkgs, ... }:
{
services.jupyter = {
enable = false;
ip = "0.0.0.0";
port = 9002;
password = "'argon2:$argon2id$v=19$m=10240,t=10,p=8$wcvyvCdrrixsD/IUfOij7A$D05SNCsu0gtkCk7V7QSQw3RkcrUfoKXWzn9N/MJjRIA'";
notebookDir = "/var/www/jupyter.lilyanderson.xyz";
notebookConfig = "c.ServerApp.root_dir = '/var/www/jupyter.lilyanderson.xyz'";
};
}

158
hosts/server/nginx.nix Normal file
View File

@@ -0,0 +1,158 @@
{ config, pkgs, ... }:
{
imports = [ ./jupyter.nix ];
users.users.nginx.extraGroups = [ "acme" ];
systemd.services.webdavPrivate = {
description = "Rclone WebDAV server";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = ''
${pkgs.rclone}/bin/rclone serve webdav --addr :8081 --baseurl / --htpasswd /var/www/basic_auth /var/www/dav.lilyanderson.xyz
'';
Restart = "always";
};
};
services.nginx = {
enable = true;
virtualHosts = {
# "jupyter.lilyanderson.xyz" = {
# enableACME = true;
# forceSSL = true;
# locations."/" = {
# proxyPass = "http://localhost:9002";
# };
# basicAuthFile = "/var/www/basic_auth";
# extraConfig = ''
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection “upgrade”;
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# '';
# };
"lilyanderson.xyz" = {
locations."/" = {
root = "/var/www/web";
};
};
"ai.lilyanderson.xyz" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:9001";
};
extraConfig = ''
client_body_timeout 300;
client_header_timeout 300;
keepalive_timeout 300;
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
# Add WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Disable proxy buffering for better streaming response from models
proxy_buffering off;
'';
};
"dav.lilyanderson.xyz" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:8081";
};
};
"swap.lilyanderson.xyz" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://192.168.0.101:9001";
};
basicAuthFile = "/var/www/basic_auth";
};
"192.168.0.42" = {
};
"git.lilyanderson.xyz" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:3001";
};
};
};
};
services.postgresql = {
ensureDatabases = [ config.services.gitea.user ];
ensureUsers = [
{
name = config.services.gitea.database.user;
ensureDBOwnership = true;
#ensurePermissions."DATABASE ${config.services.gitea.database.name}" = "ALL PRIVILEGES";
}
];
};
sops = {
age.keyFile = "/secrets/age/keys.txt";
defaultSopsFile = ../../secrets/secrets.yaml;
defaultSopsFormat = "yaml";
secrets."postgres/gitea_dbpass" = {
owner = config.services.gitea.user;
};
};
services.gitea = {
enable = true;
appName = "Lily's Gitea Server";
database = {
type = "postgres";
passwordFile = config.sops.secrets."postgres/gitea_dbpass".path;
};
settings.service.DISABLE_REGISTRATION = true;
settings.server = {
DOMAIN = "git.lilyanderson.xyz";
ROOT_URL = "https://git.lilyanderson.xyz";
HTTP_PORT = 3001;
};
};
security.acme = {
acceptTerms = true;
defaults.email = "lilylanderson@zoho.com";
};
services.open-webui = {
enable = true;
host = "0.0.0.0";
port = 9001;
environment = {
ANONYMIZED_TELEMETRY = "False";
DO_NOT_TRACK = "True";
SCARF_NO_ANALYTICS = "True";
ENABLE_LOGIN_FORM = "True";
};
};
}

View File

@@ -0,0 +1,11 @@
{ config, pkgs, inputs, ... }:
{
imports = [ ];
environment.systemPackages = with pkgs; [
cargo
cargo-mommy
gcc
rustc
];
}

23
secrets/secrets.yaml Normal file
View File

@@ -0,0 +1,23 @@
porkbun:
api_pk: ENC[AES256_GCM,data:B2jR1JqqXegJ0xv7N6ydQy53m7GK8cEP0TclKdYynUgHeYjKYhuxbXh4+4wQer1IhZ9Xt9303TyYfjdUrH7Yzmk1yUg=,iv:mgKW9ZUrRA/VyxEdu6Hlq5JnoY7wczt5DatM7ibm840=,tag:S04wFVuGr/C2pLmt3jJ0sg==,type:str]
api_sk: ENC[AES256_GCM,data:MuvdysEmAroa/9A5FlDo3Wg9zrv8PBPXJZeJusHAYWGatXcVATYkEejYUfIj2hZIC73DzUExyVK3k1PCbNJiWV7aPSA=,iv:Ob3GRVIed3PFfNbjheOvihfgu0taB0QtGwXKHxEK/6E=,tag:XfeNRFBjwUVrQxARgdXiTA==,type:str]
postgres:
gitea_dbpass: ENC[AES256_GCM,data:mFs+6HQ5viKWqwyTbzO0XE0frhg=,iv:j1nGCUHH7ZdL5XcSwxPngJ1XrIyQdh2Ynr9hl7b2wmY=,tag:KcSDYKVYxV2pdVBmkIxHfQ==,type:str]
env_file: ENC[AES256_GCM,data:O8lNrxeG//OuM2Hgmo71oVncRSnfUMg7Db2YE6/NY2g+iP7T+EWKcujL/OATklMOAVEptRSDXHgCPHJbZFLp4SALmrE2qhnr4NZY3mJU4dJf7CERhFhnLtN60Pj3xmsdoswdf4goYOBlM3iv+x7D3btr5G4AlUFIUnsqU316SZ0CiGT7wHtbdrIIBVGQ5iTfnlK0lio2tTjtqUCTN6ED3xmzZemOtJopkE9GuoDb58q2z0j1uWe5vcg=,iv:44HlK6Owy47VYdt1r+g/X7mUqHM/OAiecKsVgdiAJkI=,tag:3chEB6bWNfWJXXr123y+mg==,type:str]
nextcloud:
pass: ENC[AES256_GCM,data:EY5FH2CCCj4qxCauLHnuGQ==,iv:lxCgsfdT8K/3GmRI5PtMNTFGHlx5uzjTn51ORb9V0/c=,tag:ReYl31yDuhtY7mekhX/uwg==,type:str]
sops:
age:
- recipient: age1mvup35ycxdxum8ergeagtjqxshdprr8av9yg5myl89y5nthwyqhqws86ny
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBxQ3hKR09JSXAvTnh2VDhu
ZzE2V093Z0I2Qzk4elFJaWJNMUF3cGwzWVdBCkRUcGxlNVFlQk1TZnNSSU5Bd2or
Z3VIL3drOEtSbmlxdWY1SnBGallXS2sKLS0tIGxKNjFRMlhiRnlpeGpvMEptTFYv
cGNCaHpWV0hsSlptN041Z1pRMjliUUEKaowR90GNNfov6jGOEufBF1fnj647mn9E
cQGbvv6PeEXJaUgQrr37WNXCdBVCrksd/ofB6hQ/J4qiOajO8ztTLQ==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2025-05-22T04:36:40Z"
mac: ENC[AES256_GCM,data:5NsT0r5JLYV3QOPG46kXvN81eWPEyv7WFizpAO8jXJuJovzMSf5T8/BRqspTepd3y8dBifR3Fyc6K6RcklUA5xCOsZde0Kx5pJI6KaPcSwJAw9iVX7P+ahGdt+gRc9XwNgNKRtBgoqMe8Q76mr4ohxiCLsG0TBboLO/SotrQIeE=,iv:fLCq7Un+ugPmgZL4qpVadw0em1aRCsZ/VRDDXHZ480M=,tag:desvrZhekZulhqd+xxME3g==,type:str]
unencrypted_suffix: _unencrypted
version: 3.10.2

View File

@@ -2,7 +2,7 @@
{
imports = [
../../modules/home/vim.nix
#../../modules/home/vim.nix
../../modules/home/river.nix
../../modules/home/games.nix
../../modules/home/alacritty.nix
@@ -59,6 +59,7 @@
};
home.sessionVariables = {
NH_FLAKE = "/home/lily/Programming/LiNix";
# EDITOR = "emacs";
};