{ config, lib, pkgs, ... }: with lib; { boot.kernelPackages = pkgs.linuxPackages_6_1; # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; nix = { extraOptions = "experimental-features = nix-command flakes"; # package = pkgs.nixFlakes; gc = { automatic = true; dates = "weekly"; options = "--delete-older-than 20d"; }; settings = { auto-optimise-store = true; }; }; # nixpkgs.config.allowUnFree = true; system.autoUpgrade = { enable = true; dates = "04:40"; allowReboot = true; flake = "${config.users.users.chris.home}/conf"; flags = [ "--update-input" "nixpkgs" "--commit-lock-file" ]; rebootWindow = { lower = "04:40"; upper = "05:20"; }; }; # Set your time zone. time.timeZone = "America/Chicago"; # Select internationalisation properties. i18n.defaultLocale = "en_US.utf8"; # Configure keymap in X11 services.xserver = { xkb.layout = "us"; xkb.variant = ""; }; # Enable networking networking.networkmanager.enable = true; services.avahi = { enable = true; publish.enable = true; publish.userServices = true; }; # Define a user account. Don't forget to set a password with ‘passwd’. users.users.chris = { isNormalUser = true; description = "Chris"; extraGroups = [ "networkmanager" "wheel" ]; packages = with pkgs; []; }; environment.homeBinInPath = true; programs.fish.enable = true; virtualisation.docker.enable = true; # virtualisation.containers.cdi.dynamic.nvidia.enable = true; hardware.nvidia-container-toolkit.enable = true ; services.openssh.enable = true; services.fstrim.enable = true; services = { grafana = { enable = true; settings.server = { http_port = 4358; http_addr = "127.0.0.1"; }; }; prometheus = { enable = true; port = 4359; exporters = { node = { enable = true; enabledCollectors = [ "systemd" "processes" "drm" ]; port = 9002; }; smartctl.enable = true; process = { enable = true; settings.process_names = [ { name = "{{.Matches.Wrapped}} {{ .Matches.Args }}"; cmdline = [ "^/nix/store[^ ]*/(?P[^ /]*) (?P.*)" ]; } ]; }; }; scrapeConfigs = [ { job_name = "shen"; static_configs = [{ targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" "127.0.0.1:${toString config.services.prometheus.exporters.smartctl.port}" ]; }]; } ]; }; }; }