nix/nixos/dragon/default.nix

110 lines
2.8 KiB
Nix
Raw Normal View History

2023-10-03 11:52:44 -05:00
{
2023-10-03 12:13:30 -05:00
flake,
2023-10-03 11:52:44 -05:00
inputs,
outputs,
lib,
config,
pkgs,
2023-10-03 14:50:00 -05:00
modulesPath,
2023-10-03 11:52:44 -05:00
...
}: {
2023-10-03 12:13:30 -05:00
networking.hostName = "dragon";
imports =
[
2023-10-03 14:50:00 -05:00
(modulesPath + "/installer/scan/not-detected.nix")
2023-10-03 12:13:30 -05:00
inputs.disko.nixosModules.disko
flake.diskoConfigurations.standard
2023-10-04 13:49:48 -05:00
inputs.hardware.nixosModules.common-cpu-amd
inputs.hardware.nixosModules.common-pc-ssd
2023-10-03 12:13:30 -05:00
]
++ (with outputs.nixosModules; [
# If you want to use modules your own flake exports (from modules/nixos):
2023-10-04 12:39:01 -05:00
# melee
2023-10-03 12:13:30 -05:00
desktop-usage
podman
postgres
wifi
])
++ [
# Or modules from other flakes (such as nixos-hardware):
# inputs.hardware.nixosModules.common-cpu-amd
# inputs.hardware.nixosModules.common-ssd
# You can also split up your configuration and import pieces of it here:
# ./users.nix
];
2023-10-03 11:52:44 -05:00
2023-10-06 20:36:31 -05:00
# TODO: https://nixos.wiki/wiki/Remote_LUKS_Unlocking
2023-10-03 12:13:30 -05:00
nixpkgs = {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
2023-10-03 11:52:44 -05:00
2023-10-03 12:13:30 -05:00
# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
2023-10-03 11:52:44 -05:00
2023-10-03 12:13:30 -05:00
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
};
};
2023-10-03 11:52:44 -05:00
2023-10-03 12:13:30 -05:00
nix = {
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
# This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well, awesome!
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
settings = {
# Enable flakes and new 'nix' command
experimental-features = "nix-command flakes";
# Deduplicate and optimize nix store
auto-optimise-store = true;
};
};
2023-10-03 11:52:44 -05:00
# hardware
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.enable = true;
2023-10-03 14:50:00 -05:00
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "ahci"];
boot.kernelModules = ["kvm-amd"];
2023-10-03 11:52:44 -05:00
hardware.bluetooth.enable = true;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
services.printing.enable = true;
environment = {
systemPackages = with pkgs; [
radeontop
];
};
networking = {
firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [22];
allowedUDPPorts = [];
};
};
2023-10-03 12:13:30 -05:00
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
2023-10-03 11:52:44 -05:00
system.stateVersion = "23.11";
}