Update configuration.nix

This commit is contained in:
Aaron Honeycutt 2024-12-05 15:45:57 +00:00
parent 3668175388
commit 837f244655

View file

@ -4,7 +4,6 @@
imports = imports =
[ [
./hardware-configuration.nix ./hardware-configuration.nix
#./home-assistant.nix
]; ];
boot.loader = { boot.loader = {
@ -12,51 +11,80 @@
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
}; };
## Disabled as the drives may not be there when I install the OS.
# boot.swraid = {
# enable = true;
# mdadmConf = ''
# ARRAY /dev/md/edi:DATA metadata=1.2 UUID=f0384881:84c12f70:3dcad802:653ccc30
# MAILADDR root
# '';
# };
boot.kernelParams = [ "console=tty0" ]; boot.kernelParams = [ "console=tty0" ];
boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
# You can find the swraid ARRAY information with this command ## Disabled as the drives may not be there when I install the OS.
# sudo mdadm --detail --scan >> mdadm.conf
# Now just copy that information into the line
# The MAILADDR is to fix a warning for swraid # fileSystems = {
# "/mnt/DATA" = {
boot.swraid = { # device = "/dev/md127";
enable = true; # };
mdadmConf = '' # };
ARRAY /dev/md/edi:DATA metadata=1.2 UUID=f0384881:84c12f70:3dcad802:653ccc30
MAILADDR root nix.settings = {
''; experimental-features = [ "nix-command" "flakes" ];
extra-platforms = [ "aarch64-linux" ];
}; };
fileSystems = { nix.buildMachines = [{
"/home/aaronh/DATA" = {
device = "/dev/md127";
};
};
nix.settings.extra-platforms = [ "aarch64-linux" ];
nix.buildMachines = [{
hostName = "localhost"; hostName = "localhost";
systems = ["x86_64-linux" systems = ["x86_64-linux"
"aarch64-linux"]; "aarch64-linux"];
supportedFeatures = ["kvm" "nixos-test" "big-parallel" "benchmark"]; supportedFeatures = [ "kvm" "nixos-test" "big-parallel" "benchmark" ];
maxJobs = 8; maxJobs = 8;
}]; }];
nixpkgs.config.allowUnfree = true;
# Define user accounts # Define user accounts
users.users.aaronh = { users.users.aaronh = {
description = "Aaron Honeycutt"; description = "Aaron Honeycutt";
home = "/home/aaronh"; home = "/home/aaronh";
extraGroups = [ "wheel" "networkmanager" "adm"]; extraGroups = [ "wheel" "networkmanager" "adm" "video" ];
isNormalUser = true; isNormalUser = true;
hashedPassword = "$6$aAcbLtqiqzySifls$jdKMOQjoWITHD/dWNNZVUH/qNc6aoJ7v4zYofi0U7IJSVTbmOfChS3mzaJbp57AodjdPNKPrnrip8Nlh2Qanx."; hashedPassword = "$6$aAcbLtqiqzySifls$jdKMOQjoWITHD/dWNNZVUH/qNc6aoJ7v4zYofi0U7IJSVTbmOfChS3mzaJbp57AodjdPNKPrnrip8Nlh2Qanx.";
}; };
networking.hostName = "EDI"; # Install some packages
environment.systemPackages =
with pkgs;
[
bottom
busybox
byobu
cloudflared
ffmpeg-full
freshfetch
git
git-lfs
tmux
zola
];
hardware.graphics = {
enable = true;
};
networking.hostName = "edi";
networking.firewall = { networking.firewall = {
enable = true; enable = true;
allowedTCPPorts = [ 80 443 3000 8096 8123 ]; # 2342 = PhotoPrism
# 3000 = Hydra
# 5000 = Kavita
# 8096 = Jellyfin
# 11434 = Ollama
allowedTCPPorts = [ 80 443 2342 3000 5000 8096 9091 11434 ];
}; };
nixpkgs.config.permittedInsecurePackages = [ nixpkgs.config.permittedInsecurePackages = [
@ -69,11 +97,48 @@
PermitRootLogin = "no"; PermitRootLogin = "no";
}; };
# Services
services.hydra = { services.hydra = {
enable = true; enable = true;
hydraURL = "localhost:3000"; hydraURL = "localhost:3000";
buildMachinesFiles = [ "/etc/nix/machines" ];
notificationSender = "hydra@localhost"; notificationSender = "hydra@localhost";
useSubstitutes = true; useSubstitutes = true;
}; };
} services.ollama = {
enable = true;
acceleration = "rocm";
environmentVariables =
{
OLLAMA_HOST = "0.0.0.0";
};
};
services.tailscale.enable = true;
## These are disabled currently as I am testing this.
# systemd.services.git-update = {
# enable = true;
# description = "update website git";
# serviceConfig = {
# ExecStart = "/run/current-system/sw/bin/git -C /mnt/DATA/Website/ahoneybun.net pull";
# };
# wantedBy = [ "multi-user.target" ];
# };
# systemd.services.zola-build = {
# enable = true;
# description = "rebuild zola website";
# serviceConfig = {
# ExecStart = "/run/current-system/sw/bin/zola -r /mnt/DATA/Website/ahoneybun.net build";
# };
# wantedBy = [ "multi-user.target" ];
# };
# System
system.stateVersion = "24.11";
system.autoUpgrade.enable = true;
}