adding server config to repo. setting up laptop in repo. other changes.
This commit is contained in:
@@ -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";
|
||||
|
||||
130
hosts/laptop/configuration.nix
Normal file
130
hosts/laptop/configuration.nix
Normal 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. It‘s 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?
|
||||
|
||||
}
|
||||
47
hosts/laptop/hardware-configuration.nix
Normal file
47
hosts/laptop/hardware-configuration.nix
Normal 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;
|
||||
}
|
||||
45
hosts/server/configuration.nix
Normal file
45
hosts/server/configuration.nix
Normal 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";
|
||||
}
|
||||
40
hosts/server/hardware-configuration.nix
Normal file
40
hosts/server/hardware-configuration.nix
Normal 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
11
hosts/server/jupyter.nix
Normal 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
158
hosts/server/nginx.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user