aboutsummaryrefslogtreecommitdiff
path: root/configuration.nix
diff options
context:
space:
mode:
authorPreston Pan <preston@nullring.xyz>2024-07-20 00:49:49 -0700
committerPreston Pan <preston@nullring.xyz>2024-07-20 00:49:49 -0700
commit82ee51a8e9ff67054788a86c501dad99ed5b070f (patch)
treefd31bbc65a777f2950e9f4d225061f048ce4a67e /configuration.nix
parent5e0544dad7d317607de0be9123fb4ca484027c87 (diff)
refactor existing code
Diffstat (limited to 'configuration.nix')
-rw-r--r--configuration.nix255
1 files changed, 146 insertions, 109 deletions
diff --git a/configuration.nix b/configuration.nix
index dd696e3..150304c 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -1,100 +1,153 @@
{ config, pkgs, ... }:
{
- nixpkgs.config.cudaSupport = true;
imports =
[
./hardware-configuration.nix
];
- nix.settings.experimental-features = "nix-command flakes";
- boot.loader.systemd-boot.enable = true;
- boot.loader.efi.canTouchEfiVariables = true;
+ boot.loader = {
+ systemd-boot.enable = true;
+ efi.canTouchEfiVariables = true;
+ };
- networking.hostName = "continuity";
- networking.networkmanager.enable = true;
- networking.firewall = {
- allowedTCPPorts = [ 80 443 6600 8000 11434 7777 ];
+ networking = {
+ hostName = "continuity";
+ networkmanager.enable = true;
+ firewall = {
+ allowedTCPPorts = [ 80 443 6600 8000 11434 7777 ];
+ };
};
- time.timeZone = "America/Vancouver";
+ hardware = {
+ bluetooth = {
+ enable = true;
+ powerOnBoot = true;
+ };
+ graphics = {
+ enable = true;
+ extraPackages = with pkgs; [
+ vaapiVdpau
+ libvdpau-va-gl
+ nvidia-vaapi-driver
+ ];
+ };
+ nvidia = {
+ modesetting.enable = true;
+ powerManagement = {
+ enable = true;
+ finegrained = false;
+ };
+ nvidiaSettings = true;
+ open = false;
+ package = config.boot.kernelPackages.nvidiaPackages.stable;
+ };
+ pulseaudio.enable = false;
+ };
- i18n.defaultLocale = "en_CA.UTF-8";
+ services = {
+ xserver = {
+ enable = true;
+ displayManager = {
+ startx.enable = true;
+ };
+ desktopManager = {
+ runXdgAutostartIfNone = true;
+ };
+ videoDrivers = [ "nvidia" ];
+ xkb = {
+ layout = "us";
+ variant = "";
+ options = "caps:escape";
+ };
+ };
- services.xserver.enable = true;
- services.xserver.displayManager.startx.enable = true;
- services.xserver.desktopManager.runXdgAutostartIfNone = true;
+ pipewire = {
+ enable = true;
+ alsa = {
+ enable = true;
+ support32Bit = true;
+ };
+ pulse.enable = true;
+ jack.enable = true;
+ #media-session.enable = true;
+ };
- hardware.bluetooth.enable = true;
- hardware.bluetooth.powerOnBoot = true;
- hardware.graphics = {
- enable = true;
- extraPackages = with pkgs; [
- vaapiVdpau
- libvdpau-va-gl
- nvidia-vaapi-driver
- ];
- };
- services.blueman.enable = true;
+ kanata = {
+ enable = true;
+ };
- virtualisation.docker.enable = true;
- services.xserver = {
- videoDrivers = [ "nvidia" ];
- xkb.layout = "us";
- xkb.variant = "";
- xkb.options = "caps:escape";
- };
- hardware.nvidia = {
- modesetting.enable = true;
- powerManagement.enable = true;
- powerManagement.finegrained = false;
- nvidiaSettings = true;
- open = false;
- };
- hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
+ # External
+ calibre-web = {
+ enable = true;
+ user = "preston";
+ openFirewall = true;
+ # group = "preston";
+
+ listen = {
+ port = 9999;
+ ip = "0.0.0.0";
+ };
+
+ options = {
+ enableBookUploading = true;
+ enableKepubify = true;
+ enableBookConversion = true;
+ calibreLibrary = "/home/preston/books/physics/";
+ };
+ };
- services.ollama = {
- enable = true;
- acceleration = "cuda";
- host = "0.0.0.0";
- };
+ ollama = {
+ enable = true;
+ acceleration = "cuda";
+ host = "0.0.0.0";
+ };
- services.printing.enable = true;
+ openssh = {
+ enable = true;
+ settings = {
+ PasswordAuthentication = false;
+ PermitRootLogin = "no";
+ KbdInteractiveAuthentication = false;
+ };
+ };
- sound.enable = true;
- hardware.pulseaudio.enable = false;
- security.rtkit.enable = true;
- services.pipewire = {
- enable = true;
- alsa.enable = true;
- alsa.support32Bit = true;
- pulse.enable = true;
- jack.enable = true;
- #media-session.enable = true;
- };
- services.udisks2.enable = true;
+ nginx = {
+ enable = true;
+ };
- services.kanata = {
- enable = true;
- };
- # services.xserver.libinput.enable = true;
+ # Misc.
+ udev.packages = [
+ pkgs.platformio-core
+ pkgs.platformio-core.udev
+ pkgs.openocd
+ ];
- programs.zsh.enable = true;
+ printing.enable = true;
+ udisks2.enable = true;
+ blueman.enable = true;
+ };
- users.users.root.openssh.authorizedKeys.keys = [
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINSshvS1N/42pH9Unp3Zj4gjqs9BXoin99oaFWYHXZDJ preston@preston-arch"
- ];
+ programs = {
+ zsh.enable = true;
+ light.enable = true;
+ ssh.enableAskPassword = false;
+ };
- users.users.preston = {
- isNormalUser = true;
- description = "Preston Pan";
- extraGroups = [ "networkmanager" "wheel" "video" "docker" ];
- shell = pkgs.zsh;
- packages = with pkgs; [
+ nixpkgs.config = {
+ allowUnfree = true;
+ cudaSupport = true;
+ permittedInsecurePackages = [
+ "nix-2.15.3"
];
};
- nixpkgs.config.allowUnfree = true;
+ xdg.portal = {
+ enable = true;
+ wlr.enable = true;
+ extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal pkgs.xdg-desktop-portal-hyprland ];
+ config.common.default = "*";
+ };
environment.systemPackages = with pkgs; [
curl
@@ -108,44 +161,28 @@
linuxPackages.nvidia_x11
];
- programs.light.enable = true;
-
- xdg.portal = {
- enable = true;
- wlr.enable = true;
- extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal pkgs.xdg-desktop-portal-hyprland ];
- config.common.default = "*";
+ users.users = {
+ root.openssh.authorizedKeys.keys = [
+ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINSshvS1N/42pH9Unp3Zj4gjqs9BXoin99oaFWYHXZDJ preston@preston-arch"
+ ];
+ preston = {
+ isNormalUser = true;
+ description = "Preston Pan";
+ extraGroups = [ "networkmanager" "wheel" "video" "docker" ];
+ shell = pkgs.zsh;
+ packages = with pkgs; [
+ ];
+ };
};
- system.stateVersion = "23.11";
- nixpkgs.config.permittedInsecurePackages = [
- "nix-2.15.3"
- ];
+ nix.settings.experimental-features = "nix-command flakes";
- services.udev.packages = [
- pkgs.platformio-core
- pkgs.platformio-core.udev
- pkgs.openocd
- ];
- services.calibre-server = {
- enable = true;
- host = "0.0.0.0";
- port = 7777;
- user = "preston";
- group = "preston";
- };
- services.calibre-web = {
- enable = true;
- user = "preston";
- group = "preston";
- listen.port = 7777;
- listen.ip = "0.0.0.0";
- openFirewall = true;
- options = {
- enableBookUploading = true;
- enableKepubify = true;
- enableBookConversion = true;
- calibreLibrary = "/home/preston/books/";
- };
- };
+ virtualisation.docker.enable = true;
+ security.rtkit.enable = true;
+ # services.xserver.libinput.enable = true;
+
+ time.timeZone = "America/Vancouver";
+ i18n.defaultLocale = "en_CA.UTF-8";
+
+ system.stateVersion = "23.11";
}