调整项目结构和readme
This commit is contained in:
22
profiles/gaea/nixos/default.nix
Normal file
22
profiles/gaea/nixos/default.nix
Normal 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;
|
||||
}
|
||||
58
profiles/gaea/nixos/hardware-configuration.nix
Normal file
58
profiles/gaea/nixos/hardware-configuration.nix
Normal 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;
|
||||
}
|
||||
26
profiles/gaea/nixos/mount.nix
Normal file
26
profiles/gaea/nixos/mount.nix
Normal 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;
|
||||
}];
|
||||
}
|
||||
42
profiles/gaea/nixos/network.nix
Normal file
42
profiles/gaea/nixos/network.nix
Normal 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" ];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user