调整项目结构和readme

This commit is contained in:
2025-05-09 14:40:19 +08:00
parent 79d3ca7ec4
commit 05c8ab6c82
28 changed files with 373 additions and 345 deletions

View File

@@ -0,0 +1,22 @@
{ self, pkgs, version, ... }: {
imports = [
./mount.nix
./network.nix
./hardware-configuration.nix
"${self}/modules/nixos/core"
"${self}/modules/nixos/fonts"
"${self}/modules/nixos/user.nix"
"${self}/modules/nixos/audio.nix"
"${self}/modules/nixos/nvidia.nix"
"${self}/modules/nixos/samba.nix"
"${self}/modules/nixos/zfs.nix"
"${self}/modules/nixos/sysatomic.nix"
"${self}/modules/nixos/virtualize/libvirtd"
"${self}/modules/nixos/virtualize/docker.nix"
];
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = version;
}

View File

@@ -0,0 +1,58 @@
# 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" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/9d79b1dc-da5a-456c-a691-9bda5aebcea3";
fsType = "btrfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/FE53-DFFA";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/9d79b1dc-da5a-456c-a691-9bda5aebcea3";
fsType = "btrfs";
options = [ "subvol=nix" ];
};
fileSystems."/swap" =
{ device = "/dev/disk/by-uuid/9d79b1dc-da5a-456c-a691-9bda5aebcea3";
fsType = "btrfs";
options = [ "subvol=swap" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/9d79b1dc-da5a-456c-a691-9bda5aebcea3";
fsType = "btrfs";
options = [ "subvol=home" ];
};
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.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.enp2s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -0,0 +1,26 @@
# 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, username, ... }:
{
fileSystems."/home/${username}/tmp" =
{
device = "none";
fsType = "tmpfs";
options = [ "uid=1000" "gid=100" "defaults" "size=8G" "mode=755" ];
};
fileSystems."/tmp" =
{
device = "tmpfs";
fsType = "tmpfs";
};
swapDevices = [{
device = "/var/swapfile";
size = 16 * 1024;
}];
}

View File

@@ -0,0 +1,42 @@
{ config, pkgs, hostname, ... }: {
networking = {
hostId = "5def12be";
hostName = "${hostname}";
wireless.enable = false; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# proxy.default = "http://user:password@proxy:port/";
# proxy.noProxy = "127.0.0.1,localhost,internal.domain";
networkmanager = {
enable = true;
};
enableIPv6 = true;
# Set up bridge network
interfaces.eno1 = {
useDHCP = false;
};
bridges = {
br0 = { interfaces = [ "eno1" ]; };
};
interfaces.br0 = {
useDHCP = false;
ipv4.addresses = [
{
address = "10.7.43.20";
prefixLength = 24;
}
];
};
defaultGateway = {
address = "10.7.43.1";
interface = "br0";
};
nameservers = [ "119.29.29.29" "223.5.5.5" ];
};
}