restructured and optimized content

This commit is contained in:
2025-04-21 14:21:37 +08:00
parent e1d5d900fb
commit 4af72b9d39
28 changed files with 632 additions and 609 deletions

View File

@@ -1,4 +1,4 @@
{ inputs, outputs, lib, pkgs, config, self, username, useremail, hostname, ... }:
{ inputs, outputs, lib, pkgs, config, self, username, useremail, hostname, sysversion, ... }:
let
inherit (inputs) home-manager hyprland nixpkgs-unstable;
in
@@ -13,22 +13,21 @@ in
# inputs.hardware.nixosModules.common-ssd
# You can also split up your configuration and import pieces of it here:
# ./users.nix
# ./users
# Import your generated (nixos-generate-config) hardware configuration
./hardware-configuration.nix
./networking.nix
"${self}/modules/nixos/core.nix"
./hardware-configuration
./networking
"${self}/modules/nixos/core"
"${self}/modules/nixos/sysatomic.nix"
"${self}/modules/nixos/nvidia.nix"
"${self}/modules/nixos/gnome.nix"
"${self}/modules/nixos/hyprland.nix"
"${self}/modules/nixos/user-group.nix"
"${self}/modules/nixos/user.nix"
"${self}/modules/nixos/samba.nix"
"${self}/modules/nixos/zfs.nix"
"${self}/modules/nixos/adb.nix"
"${self}/modules/nixos/virtualize/libvirtd"
"${self}/modules/nixos/virtualize/android.nix"
"${self}/modules/nixos/virtualize/docker.nix"
"${self}/modules/nixos/fonts"
@@ -38,7 +37,7 @@ in
# home-manager.useGlobalPkgs = true;
# home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit inputs outputs hostname username useremail hyprland;
inherit inputs outputs hostname username useremail hyprland sysversion;
# enable unstable packages
nixpkgs = nixpkgs-unstable;
@@ -59,31 +58,9 @@ in
}
];
boot = {
loader = {
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
grub = {
enable = true;
efiSupport = true;
device = "nodev";
};
};
zfs.extraPools = [ "zroot" ];
# Allow to modify store. It's dangerous!!
readOnlyNixStore = true;
};
environment.systemPackages = with pkgs;[
# audio control software
pamixer
ntfs3g
];
# set hdmi audio default device
@@ -93,55 +70,6 @@ in
extraConfig = "set-card-profile 1 output:alsa_output.pci-0000_00_1f.3.hdmi-stereo";
};
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 = {
substituters = [
"https://mirrors.ustc.edu.cn/nix-channels/store"
"https://nixos-cn.cachix.org"
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
];
trusted-public-keys = [
"nixos-cn.cachix.org-1:L0jEaL6w7kwQOPlLoCR3ADx+E3Q8SEFEcB9Jaibl0Xg="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
};
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
outputs.overlays.nur-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;
};
};
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "23.05";
system.stateVersion = sysversion;
}