This commit is contained in:
Spectre 2024-06-07 01:02:48 +02:00
parent 95ea2899ea
commit 9e441e1aaf
11 changed files with 172 additions and 1 deletions

View file

@ -1 +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" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/080fa116-424e-4079-a2a6-658a230e2721";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/40E8-A12D";
fsType = "vfat";
};
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.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

10
system/audio.nix Normal file
View file

@ -0,0 +1,10 @@
{...}: {
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# jack.enable = true;
};
}

3
system/bluetooth.nix Normal file
View file

@ -0,0 +1,3 @@
{...}: {
hardware.bluetooth.enable = true;
}

6
system/boot.nix Normal file
View file

@ -0,0 +1,6 @@
{pkgs, ...}: {
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
}

10
system/btrfs.nix Normal file
View file

@ -0,0 +1,10 @@
{...}: {
services.btrfs.autoScrub = {
enable = true;
interval = "Fri 07:00";
fileSystems = [
"/persistent"
"/nix"
];
};
}

6
system/env.nix Normal file
View file

@ -0,0 +1,6 @@
{...}: {
environment.variables = {
EDITOR = "hx";
VISUAL = "hx";
};
}

5
system/fonts.nix Normal file
View file

@ -0,0 +1,5 @@
{pkgs, ...}: {
fonts.packages = with pkgs; [
(nerdfonts.override {fonts = ["JetBrainsMono"];})
];
}

26
system/networking.nix Normal file
View file

@ -0,0 +1,26 @@
{conf, ...}: {
networking.hostName = conf.hostname;
networking.networkmanager = {
enable = true;
wifi.macAddress = "random";
ethernet.macAddress = "random";
};
networking.firewall = {
enable = true;
allowedTCPPorts = [
22 # ssh
22000 # syncthing
];
extraCommands = ''
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN
'';
extraStopCommands = ''
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN || true
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN || true
'';
};
}

15
system/nix.nix Normal file
View file

@ -0,0 +1,15 @@
{nixpkgs, ...}: {
nixPath = ["nixpkgs=${nixpkgs}"];
gc = {
automatic = true;
dates = "05:30";
options = "--delete-older-than 7d";
settings = {
keep-outputs = true;
auto-optimise-store = true;
experimental-features = ["nix-command" "flakes"];
trusted-users = ["root" "@wheel"];
};
};
}

39
system/persistence.nix Normal file
View file

@ -0,0 +1,39 @@
{
conf,
impermanence,
...
}: {
imports = [impermanence.nixosModule];
environment.persistence."/persist/data" = {
hideMounts = true;
directories = [
"/etc/NetworkManager/system-connections"
"/var/log"
"/var/lib/bluetooth"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/var/lib/bluetooth"
];
files = [];
users.${conf.user} = (import ../home/persistence.nix).data;
};
environment.persistence."/persist/cache" = {
hideMounts = true;
directories = [
"/root/.cache/nix"
"/var/lib/btrfs"
"/var/lib/nixos"
"/var/lib/systemd/backlight"
"/var/lib/systemd/timers"
"/var/log"
];
files = [
"/etc/machine-id"
];
users.${conf.user} = (import ../home/persistence.nix).cache;
};
}

14
system/steam.nix Normal file
View file

@ -0,0 +1,14 @@
{
lib,
config,
...
}: {
options.gaming.enable = lib.mkEnableOption "Enable gaming";
config = lib.mkIf config.gaming.enable {
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
};
};
}