new server

This commit is contained in:
Kopatz
2024-11-19 15:44:43 +00:00
parent 9ec7ed0e4a
commit 62191ae411
4 changed files with 140 additions and 1 deletions

View File

@@ -180,6 +180,9 @@
./systems/proxmox-test-vm/configuration.nix ./systems/proxmox-test-vm/configuration.nix
]; ];
}; };
"amd-server" = mkHost {
modules = [ ./users/kopatz ./systems/amd-server/configuration.nix ];
};
# build vm -> nixos-rebuild build-vm --flake .#vm # build vm -> nixos-rebuild build-vm --flake .#vm
"vm" = "vm" =
mkHost { modules = [ ./users/vm ./systems/vm/configuration.nix ]; }; mkHost { modules = [ ./users/vm ./systems/vm/configuration.nix ]; };

View File

@@ -78,7 +78,7 @@ in
libheif #convert heic to jpg with `heif-convert something.heic something.jpg` libheif #convert heic to jpg with `heif-convert something.heic something.jpg`
imagemagick #convert images imagemagick #convert images
tree tree
kop-newproject # creates a shell.nix and .envrc #kop-newproject # creates a shell.nix and .envrc
nix-tree # show nix derivations nix-tree # show nix derivations
]; ];
}; };

View File

@@ -0,0 +1,98 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
custom = {
tmpfs.enable = true;
nftables.enable = true;
cli-tools.enable = true;
nix = {
index.enable = true;
ld.enable = true;
settings.enable = true;
};
static-ip = {
enable = true;
ip = "192.168.0.20";
interface = "enp6s0";
dns = "192.168.0.10";
};
# static-ip = {
# enable = true;
# interface = "enp42s0";
# ip = "192.168.0.11";
# #dns = "127.0.0.1";
# dns = "192.168.10";
# #gateway = "192.168.0.10";
# };
# It uses 1.1.1.1 for some reason? set in /etc/dnsmasq-resolv.conf. no idea why
#services.dnsmasq = {
# enable = true;
# server = [ "192.168.0.10" ];
#};
misc = { docker.enable = true; };
services = { syncthing = { enable = true; }; };
hardware = {
firmware.enable = true;
ssd.enable = true;
wooting.enable = true;
};
graphical = {
audio.enable = true;
sddm.enable = true;
nightlight.enable = true;
i3.enable = true;
shared.enable = true;
games = {
enable = true;
};
};
};
mainUser.layout = "de";
mainUser.variant = "us";
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.initrd.kernelModules = [ "amdgpu" ];
services.xserver.enable = true;
services.xserver.videoDrivers = [ "amdgpu" ];
#zenpower for ryzen
boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ];
boot.kernelModules = ["zenpower"];
boot.blacklistedKernelModules = [ "k10temp" ];
services.xserver.desktopManager = {
xfce.enable = true;
xterm.enable = false;
};
networking.hostName = "amd-server"; # Define your hostname.
nixpkgs.config.permittedInsecurePackages =
[ "electron-28.3.3" "electron-27.3.11" ];
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
wget
git
];
# Enable the OpenSSH daemon.
services.openssh.enable = true;
system.stateVersion = "24.05"; # Did you read the comment?
}

View File

@@ -0,0 +1,38 @@
# 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.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/a3c34c9e-06be-49dc-a5d3-4156defa11e7";
fsType = "btrfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/AE1C-16B9";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [ ];
# 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.enp6s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}