调整项目结构和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,39 @@
{ self, pkgs, username, 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/samba.nix"
"${self}/modules/nixos/virtualize/appimage.nix"
"${self}/modules/nixos/virtualize/docker.nix"
"${self}/modules/nixos/gnome.nix"
];
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
vaapiIntel
intel-media-driver
];
};
services = {
gnome.gnome-keyring.enable = true;
};
security.pam.services.swaylock = { };
programs.zsh = {
enable = true;
};
users.users."${username}".shell = pkgs.zsh;
# 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,91 @@
# 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.
{ lib, username, ... }: {
swapDevices = [{
device = "/swap/swapfile";
size = 16 * 1024;
}];
fileSystems = {
"/" = {
options = lib.mkOptionDefault [ "compress=zstd" ];
};
"/nix" = {
options = lib.mkOptionDefault [ "compress=zstd" "noatime" ];
};
"/home" = {
options = lib.mkOptionDefault [ "compress=zstd" ];
};
"/swap" = {
options = lib.mkOptionDefault [ "compress=no" ];
};
"/tmp" =
{
device = "tmpfs";
fsType = "tmpfs";
};
# data目录
"/data/cache" =
{
device = "/dev/mapper/vcache-data";
fsType = "ext4";
};
"/data/arch" =
{
device = "/dev/mapper/varch-data";
fsType = "ext4";
};
# 用户目录
"/home/${username}/tmp" =
{
device = "tmpfs";
fsType = "tmpfs";
options = [ "uid=1000" "gid=100" "defaults" "size=16G" "mode=755" ];
};
"/home/${username}/data" =
{
device = "/dev/disk/by-uuid/c52805e6-7d25-4930-806d-585f303b5572";
fsType = "btrfs";
options = [ "compress=zstd" "subvol=data" ];
};
"/home/${username}/srv" =
{
device = "/dev/disk/by-uuid/c52805e6-7d25-4930-806d-585f303b5572";
fsType = "btrfs";
options = [ "compress=zstd" "subvol=srv" ];
};
"/home/${username}/priv" =
{
device = "/dev/disk/by-uuid/c52805e6-7d25-4930-806d-585f303b5572";
fsType = "btrfs";
options = [ "compress=zstd" "subvol=priv" ];
};
# 微信相关
"/home/${username}/.local/WeChat/xwechat_files/zerociqher_516a/temp/ImageUtils" =
{
device = "tmpfs";
fsType = "tmpfs";
options = [ "uid=1000" "gid=100" "defaults" "size=4G" "mode=755" ];
};
"/home/${username}/.local/WeChat/xwechat_files/zerociqher_516a/temp/InputTemp" =
{
device = "tmpfs";
fsType = "tmpfs";
options = [ "uid=1000" "gid=100" "defaults" "size=4G" "mode=755" ];
};
};
}

View File

@@ -0,0 +1,42 @@
{ config, pkgs, hostname, ... }: {
networking = {
hostId = "6fa8b74d";
hostName = "${hostname}";
networkmanager = {
enable = true;
ensureProfiles.profiles = {
"eno1" = {
connection = {
id = "eno1";
type = "ethernet"; # 有线连接
autoconnect = true; # 自动连接
};
ipv4 = {
method = "manual"; # 设置为手动配置 IPv4
addresses = "10.7.43.10/24,10.7.43.30";
# 如果需要,可以添加 DNS 服务器
# dns = [ "10.7.43.1" "8.8.8.8" ];
};
ipv6 = {
method = "auto"; # 设置为自动配置 IPv6 (动态)
};
ethernet = {
wake-on-lan=64;
};
};
};
};
interfaces = {
eno1 = {
wakeOnLan = {
enable = true;
policy = [
"magic"
];
};
};
};
};
}