This commit is contained in:
2025-04-21 11:17:23 +08:00
parent f1df0aae36
commit d97fa21cc4
26 changed files with 620 additions and 423 deletions

View File

@@ -16,126 +16,24 @@ in
# ./users.nix
# Import your generated (nixos-generate-config) hardware configuration
./hardware-configuration.nix
"${self}/modules/nixos/core.nix"
"${self}/modules/nixos/user-group.nix"
"${self}/modules/nixos/tmpsys.nix"
./hardware-configuration
./networking
"${self}/modules/nixos/core"
"${self}/modules/nixos/user"
"${self}/modules/nixos/sysatomic"
home-manager.nixosModules.home-manager
{
# home-manager.useGlobalPkgs = true;
# home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit inputs outputs hostname username useremail hyprland sysversion;
inherit inputs outputs hostname username hyprland sysversion;
};
home-manager.users."${username}" = import ../../home/desktop.nix;
home-manager.users."${username}" = import "${self}/home/desktop";
}
];
boot.loader = {
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
grub = {
enable = true;
efiSupport = true;
device = "nodev";
};
};
networking = {
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 = false; # disable ipv6
interfaces.enp0s3 = {
useDHCP = false;
ipv4.addresses = [
{
address = "10.7.45.130";
prefixLength = 32;
}
];
};
defaultGateway = "10.7.45.1";
nameservers = [
"119.29.29.29" # DNSPod
"223.5.5.5" # AliDNS
];
};
users.users."${username}".packages = with pkgs; [
vim
];
# This setups a SSH server. Very important if you're setting up a headless system.
# Feel free to remove if you don't need it.
services.openssh = {
enable = true;
# Forbid root login through SSH.
# Use keys only. Remove if you want to SSH using password (not recommended)
settings = {
# permitRootLogin = "no";
# passwordAuthentication = false;
};
};
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = lib.mkDefault false;
nix = {
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
# This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well, awesome!
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
settings = {
# Enable flakes and new 'nix' command
experimental-features = "nix-command flakes";
# Deduplicate and optimize nix store
auto-optimise-store = true;
};
};
nixpkgs = {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
};
};
networking.hostName = "${hostname}";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = sysversion;