refactor: added flake parts
This commit is contained in:
parent
db7ac35613
commit
88041e86bd
66 changed files with 3538 additions and 2163 deletions
158
modules/hosts/nixos/horizon/configuration.nix
Normal file
158
modules/hosts/nixos/horizon/configuration.nix
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
{...}: {
|
||||
flake.nixosModules.horizonConfiguration = {
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
inputs.nixos-hardware.nixosModules.framework-11th-gen-intel
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
boot = {
|
||||
initrd = {
|
||||
availableKernelModules = ["usb_storage" "sd_mod"];
|
||||
};
|
||||
kernelModules = ["sg"];
|
||||
|
||||
# Bootloader.
|
||||
loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
};
|
||||
|
||||
host = {
|
||||
users = {
|
||||
leyla = {
|
||||
isDesktopUser = true;
|
||||
isTerminalUser = true;
|
||||
isPrincipleUser = true;
|
||||
};
|
||||
eve.isDesktopUser = true;
|
||||
};
|
||||
|
||||
hardware = {
|
||||
directAccess.enable = true;
|
||||
};
|
||||
|
||||
ai = {
|
||||
enable = true;
|
||||
models = {
|
||||
"Llama 3.1 8B" = {
|
||||
model = "llama3.1:8b";
|
||||
roles = ["chat" "edit" "apply"];
|
||||
apiBase = "http://defiant:11434";
|
||||
};
|
||||
"Deepseek Coder:6.7B" = {
|
||||
model = "deepseek-coder:6.7b";
|
||||
roles = ["chat" "edit" "apply"];
|
||||
apiBase = "http://defiant:11434";
|
||||
};
|
||||
"Deepseek Coder:33B" = {
|
||||
model = "deepseek-coder:33b";
|
||||
roles = ["chat" "edit" "apply"];
|
||||
apiBase = "http://defiant:11434";
|
||||
};
|
||||
|
||||
"Deepseek r1:8B" = {
|
||||
model = "deepseek-r1:8b";
|
||||
roles = ["chat"];
|
||||
apiBase = "http://defiant:11434";
|
||||
};
|
||||
|
||||
"Deepseek r1:32B" = {
|
||||
model = "deepseek-r1:32b";
|
||||
roles = ["chat"];
|
||||
apiBase = "http://defiant:11434";
|
||||
};
|
||||
|
||||
"qwen2.5-coder:1.5b-base" = {
|
||||
model = "qwen2.5-coder:1.5b-base";
|
||||
roles = ["autocomplete"];
|
||||
apiBase = "http://defiant:11434";
|
||||
};
|
||||
|
||||
"nomic-embed-text:latest" = {
|
||||
model = "nomic-embed-text:latest";
|
||||
roles = ["embed"];
|
||||
apiBase = "http://defiant:11434";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
cachefilesd
|
||||
webtoon-dl
|
||||
android-tools
|
||||
];
|
||||
services.cachefilesd.enable = true;
|
||||
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
hostName = "horizon"; # Define your hostname.
|
||||
};
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
|
||||
hardware = {
|
||||
graphics.enable = true;
|
||||
};
|
||||
|
||||
sops.secrets = {
|
||||
"vpn-keys/tailscale-authkey/horizon" = {
|
||||
sopsFile = "${inputs.secrets}/vpn-keys.yaml";
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
# sudo fprintd-enroll
|
||||
fprintd = {
|
||||
enable = true;
|
||||
};
|
||||
# firmware update tool
|
||||
fwupd = {
|
||||
enable = true;
|
||||
};
|
||||
tailscale = {
|
||||
enable = true;
|
||||
authKeyFile = config.sops.secrets."vpn-keys/tailscale-authkey/horizon".path;
|
||||
useRoutingFeatures = "client";
|
||||
};
|
||||
|
||||
syncthing.enable = true;
|
||||
|
||||
ollama = {
|
||||
enable = true;
|
||||
loadModels = [
|
||||
"llama3.1:8b"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Enable network-online.target for better network dependency handling
|
||||
systemd.services.NetworkManager-wait-online.enable = true;
|
||||
|
||||
# Enable touchpad support (enabled default in most desktopManager).
|
||||
# services.xserver.libinput.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 = "23.05"; # Did you read the comment?
|
||||
};
|
||||
}
|
||||
20
modules/hosts/nixos/horizon/default.nix
Normal file
20
modules/hosts/nixos/horizon/default.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# leyla laptop
|
||||
{
|
||||
inputs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
flake.nixosConfigurations.horizon = inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
config.flake.nixosModules.nixosModules
|
||||
config.flake.nixosModules.horizonConfiguration
|
||||
config.flake.nixosModules.horizonHardwareConfiguration
|
||||
# config.flake.nixosModules.horizonNetworkMount
|
||||
];
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
syncthingConfiguration = inputs.self.syncthingConfiguration;
|
||||
};
|
||||
};
|
||||
}
|
||||
47
modules/hosts/nixos/horizon/hardware-configuration.nix
Normal file
47
modules/hosts/nixos/horizon/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.
|
||||
flake.nixosModules.horizonHardwareConfiguration = {
|
||||
config,
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = ["kvm-intel"];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/866d422b-f816-4ad9-9846-791839cb9337";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/E138-65B5";
|
||||
fsType = "vfat";
|
||||
};
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{device = "/dev/disk/by-uuid/be98e952-a072-4c3a-8c12-69500b5a2fff";}
|
||||
];
|
||||
|
||||
# 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.tailscale0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp170s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
};
|
||||
}
|
||||
78
modules/hosts/nixos/horizon/network-mount.nix
Normal file
78
modules/hosts/nixos/horizon/network-mount.nix
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
{...}: {
|
||||
flake.nixosModules.horizonNetworkMount = {...}: {
|
||||
boot.supportedFilesystems = ["nfs"];
|
||||
|
||||
fileSystems = {
|
||||
"/mnt/leyla_documents" = {
|
||||
device = "defiant:/exports/leyla_documents";
|
||||
fsType = "nfs";
|
||||
options = [
|
||||
"x-systemd.automount"
|
||||
"noauto"
|
||||
"noatime"
|
||||
"nofail"
|
||||
"soft"
|
||||
"intr" # Allow interruption of NFS calls
|
||||
"timeo=30" # 3 second timeout (30 deciseconds)
|
||||
"retrans=2" # Only 2 retries before giving up
|
||||
"x-systemd.idle-timeout=300" # 5 minute idle timeout for mobile
|
||||
"x-systemd.device-timeout=15" # 15 second device timeout
|
||||
"bg" # Background mount - don't block boot
|
||||
"fsc" # Enable caching
|
||||
"_netdev" # Network device - wait for network
|
||||
"x-systemd.requires=network-online.target" # Require network to be online
|
||||
"x-systemd.after=network-online.target" # Start after network is online
|
||||
"x-systemd.mount-timeout=30" # 30 second mount timeout
|
||||
];
|
||||
};
|
||||
|
||||
"/mnt/users_documents" = {
|
||||
device = "defiant:/exports/users_documents";
|
||||
fsType = "nfs";
|
||||
options = [
|
||||
"x-systemd.automount"
|
||||
"noauto"
|
||||
"nofail"
|
||||
"soft"
|
||||
"intr"
|
||||
"timeo=30"
|
||||
"retrans=2"
|
||||
"x-systemd.idle-timeout=300"
|
||||
"x-systemd.device-timeout=15"
|
||||
"bg"
|
||||
"fsc"
|
||||
"_netdev"
|
||||
"x-systemd.requires=network-online.target"
|
||||
"x-systemd.after=network-online.target"
|
||||
"x-systemd.mount-timeout=30"
|
||||
];
|
||||
};
|
||||
|
||||
"/mnt/media" = {
|
||||
device = "defiant:/exports/media";
|
||||
fsType = "nfs";
|
||||
options = [
|
||||
"x-systemd.automount"
|
||||
"noauto"
|
||||
"noatime"
|
||||
"nofail"
|
||||
"soft"
|
||||
"intr"
|
||||
"timeo=30"
|
||||
"retrans=2"
|
||||
"x-systemd.idle-timeout=300"
|
||||
"x-systemd.device-timeout=15"
|
||||
"bg"
|
||||
# Mobile-optimized read settings
|
||||
"rsize=8192" # Smaller read size for mobile
|
||||
"wsize=8192" # Smaller write size for mobile
|
||||
"fsc"
|
||||
"_netdev"
|
||||
"x-systemd.requires=network-online.target"
|
||||
"x-systemd.after=network-online.target"
|
||||
"x-systemd.mount-timeout=30"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue