treewide: sorting
This commit is contained in:
parent
946d971b0c
commit
64379f0e6a
50 changed files with 73 additions and 98 deletions
|
@ -3,7 +3,5 @@
|
||||||
../../modules
|
../../modules
|
||||||
|
|
||||||
./nix
|
./nix
|
||||||
./packages
|
|
||||||
./system
|
|
||||||
];
|
];
|
||||||
}
|
}
|
6
darwin/profiles/device-type/desktop/default.nix
Normal file
6
darwin/profiles/device-type/desktop/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
./packages
|
||||||
|
./system
|
||||||
|
];
|
||||||
|
}
|
29
flake.nix
29
flake.nix
|
@ -167,18 +167,19 @@
|
||||||
specialArgs = {inherit inputs;};
|
specialArgs = {inherit inputs;};
|
||||||
modules = [
|
modules = [
|
||||||
# OS
|
# OS
|
||||||
./nixos/profiles/desktop
|
./nixos/profiles/core
|
||||||
./nixos/profiles/core/addtional/zram-generator.nix
|
./nixos/profiles/device-type/laptop
|
||||||
./nixos/profiles/desktop/addtional/gaming.nix
|
./nixos/profiles/use-cases/zram-generator.nix
|
||||||
./nixos/profiles/desktop/addtional/virtualbox.nix
|
./nixos/profiles/use-cases/gaming.nix
|
||||||
./nixos/profiles/desktop/addtional/wayland.nix
|
./nixos/profiles/use-cases/wayland.nix
|
||||||
./nixos/profiles/desktop/addtional/virt-manager.nix
|
./nixos/profiles/use-cases/virt-manager.nix
|
||||||
|
|
||||||
# User
|
# User
|
||||||
./users/guanranwang/nixos/profiles/desktop
|
./users/guanranwang/nixos/profiles/core
|
||||||
./users/guanranwang/nixos/profiles/core/addtional/clash-meta-client.nix
|
./users/guanranwang/nixos/profiles/device-type/laptop
|
||||||
./users/guanranwang/nixos/profiles/desktop/addtional/gaming.nix
|
./users/guanranwang/nixos/profiles/use-cases/clash-meta-client.nix
|
||||||
./users/guanranwang/nixos/profiles/desktop/addtional/torrenting.nix
|
./users/guanranwang/nixos/profiles/use-cases/gaming.nix
|
||||||
|
./users/guanranwang/nixos/profiles/use-cases/torrenting.nix
|
||||||
|
|
||||||
# Hardware
|
# Hardware
|
||||||
./nixos/hardware/lenovo/legion/81fw/Aristotle
|
./nixos/hardware/lenovo/legion/81fw/Aristotle
|
||||||
|
@ -194,10 +195,12 @@
|
||||||
system = "x86_64-darwin";
|
system = "x86_64-darwin";
|
||||||
specialArgs = {inherit inputs;};
|
specialArgs = {inherit inputs;};
|
||||||
modules = [
|
modules = [
|
||||||
./darwin/profiles/desktop
|
./darwin/profiles/core
|
||||||
|
./darwin/profiles/device-type/desktop
|
||||||
|
|
||||||
./users/guanranwang/darwin/profiles/desktop
|
./users/guanranwang/darwin/profiles/core
|
||||||
./users/guanranwang/darwin/profiles/core/addtional/networking/clash-meta-client.nix
|
./users/guanranwang/darwin/profiles/device-type/desktop
|
||||||
|
./users/guanranwang/darwin/profiles/use-cases/clash-meta-client.nix
|
||||||
|
|
||||||
./darwin/hardware/apple/imac/18-3
|
./darwin/hardware/apple/imac/18-3
|
||||||
|
|
||||||
|
|
|
@ -7,5 +7,4 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
_module.args.disks = ["/dev/nvme0n1"]; # Disko
|
_module.args.disks = ["/dev/nvme0n1"]; # Disko
|
||||||
boot.initrd.systemd.enable = true; # LUKS TPM unlocking
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,17 +27,5 @@ in {
|
||||||
"systemd.show_status=auto"
|
"systemd.show_status=auto"
|
||||||
"rd.udev.log_level=3"
|
"rd.udev.log_level=3"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
### Misc
|
|
||||||
boot.loader = {
|
|
||||||
efi.canTouchEfiVariables = true;
|
|
||||||
systemd-boot = {
|
|
||||||
enable = lib.mkDefault true; # mkDefault for Lanzaboote
|
|
||||||
editor = false; # Disabled for security
|
|
||||||
### Utilities
|
|
||||||
#netbootxyz.enable = true;
|
|
||||||
#memtest86.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,9 +18,7 @@ in {
|
||||||
driSupport32Bit = true;
|
driSupport32Bit = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.initrd.kernelModules = ["i915"]; # if not enabled, plymouth's distro logo wont show for some reason
|
|
||||||
nixpkgs.config.packageOverrides = pkgs: {vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;};};
|
nixpkgs.config.packageOverrides = pkgs: {vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;};};
|
||||||
|
|
||||||
hardware.opengl = {
|
hardware.opengl = {
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
intel-media-driver # libva_driver_name=ihd
|
intel-media-driver # libva_driver_name=ihd
|
||||||
|
|
|
@ -12,37 +12,39 @@ in {
|
||||||
|
|
||||||
# https://nixos.wiki/wiki/Nvidia
|
# https://nixos.wiki/wiki/Nvidia
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
# Enable OpenGL
|
||||||
hardware.opengl = {
|
hardware.opengl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
driSupport = true;
|
driSupport = true;
|
||||||
driSupport32Bit = true;
|
driSupport32Bit = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.xserver.videoDrivers = ["nvidia"]; # tell xorg to use the nvidia driver, also valid for wayland
|
# Load nvidia driver for Xorg and Wayland
|
||||||
|
services.xserver.videoDrivers = ["nvidia"];
|
||||||
|
|
||||||
|
#nixpkgs.config.nvidia.acceptLicense = true;
|
||||||
hardware.nvidia = {
|
hardware.nvidia = {
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
#package = config.boot.kernelPackages.nvidiaPackages.legacy_470;
|
||||||
open = false;
|
|
||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
#dynamicboost.enable = true;
|
|
||||||
powerManagement = {
|
|
||||||
enable = true; # experimental power management feature
|
|
||||||
#finegrained = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# cfg.prime
|
# cfg.prime
|
||||||
hardware.nvidia.prime = lib.mkIf cfg.prime {
|
hardware.nvidia.prime = lib.mkIf cfg.prime {
|
||||||
sync.enable = false;
|
|
||||||
offload = {
|
offload = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableOffloadCmd = true;
|
enableOffloadCmd = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#sync.enable = true;
|
||||||
|
#reverseSync.enable = true;
|
||||||
|
|
||||||
### Device specific, please put those configuration in `machines/your-machine.nix`
|
### Device specific, please put those configuration in `machines/your-machine.nix`
|
||||||
# nvidiaBusId = "PCI:1:0:0";
|
# nvidiaBusId = "PCI:1:0:0";
|
||||||
# intelBusId = "PCI:0:2:0";
|
# intelBusId = "PCI:0:2:0";
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.sessionVariables = {
|
environment.sessionVariables = {
|
||||||
"GAMEMODERUNEXEC" = lib.mkIf (cfg.prime || config.programs.gamemode.enable) "env __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus=NVIDIA_only"; # gamemode: nvidia offload
|
"GAMEMODERUNEXEC" = lib.mkIf (config.hardware.nvidia.prime.offload.enable || config.programs.gamemode.enable) "nvidia-offload"; # gamemode: nvidia offload
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,22 +3,34 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
# Imported by default, check out ./desktop.nix or ./server.nix
|
# Imported by default
|
||||||
imports = [
|
imports = [
|
||||||
../../modules # idk where should i import it
|
../../modules
|
||||||
|
|
||||||
./nix
|
./nix
|
||||||
./packages
|
./packages
|
||||||
./sysctl.nix
|
./sysctl.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
boot.initrd.systemd.enable = true;
|
||||||
|
boot.loader = {
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
systemd-boot = {
|
||||||
|
enable = lib.mkDefault true; # mkDefault for Lanzaboote
|
||||||
|
editor = false; # Disabled for security
|
||||||
|
### Utilities
|
||||||
|
#netbootxyz.enable = true;
|
||||||
|
#memtest86.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
users.mutableUsers = false;
|
users.mutableUsers = false;
|
||||||
|
|
||||||
# Programs
|
# Programs
|
||||||
environment.defaultPackages = []; # make sure to add another editor and set the $EDITOR variable, in this case I am using neovim
|
environment.defaultPackages = [];
|
||||||
programs = {
|
programs = {
|
||||||
dconf.enable = true;
|
dconf.enable = true;
|
||||||
nano.enable = false;
|
nano.enable = false; # make sure to add another editor and set the $EDITOR variable, in this case I am using neovim
|
||||||
neovim = {
|
neovim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
viAlias = true;
|
viAlias = true;
|
||||||
|
@ -36,7 +48,7 @@
|
||||||
"--my-next-gpu-wont-be-nvidia")
|
"--my-next-gpu-wont-be-nvidia")
|
||||||
|
|
||||||
(lib.strings.optionalString config.myFlake.nixos.hardware.gpu.amd.enable
|
(lib.strings.optionalString config.myFlake.nixos.hardware.gpu.amd.enable
|
||||||
"[ 5.996722] amdgpu 0000:67:00.0: Fatal error during GPU init--my-next-gpu-wont-be-nvidia")
|
"[ 5.996722] amdgpu 0000:67:00.0: Fatal error during GPU init")
|
||||||
];
|
];
|
||||||
|
|
||||||
openssh = {
|
openssh = {
|
||||||
|
@ -67,7 +79,7 @@
|
||||||
# ref: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/profiles/hardened.nix
|
# ref: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/profiles/hardened.nix
|
||||||
# ref: https://madaidans-insecurities.github.io/guides/linux-hardening.html
|
# ref: https://madaidans-insecurities.github.io/guides/linux-hardening.html
|
||||||
#
|
#
|
||||||
# also see: nixos/boot/sysctl.nix
|
# also see: ./sysctl.nix
|
||||||
|
|
||||||
environment.etc.machine-id.text = "b08dfa6083e7567a1921a715000001fb"; # whonix id
|
environment.etc.machine-id.text = "b08dfa6083e7567a1921a715000001fb"; # whonix id
|
||||||
security = {
|
security = {
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
{...}: {
|
|
||||||
powerManagement.cpuFreqGovernor = "performance";
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
{...}: {
|
|
||||||
imports = [
|
|
||||||
./cpu-governor.nix
|
|
||||||
./system76-scheduler.nix
|
|
||||||
#./tlp.nix # ] Conflicts with each other, only choose one
|
|
||||||
./power-profiles-daemon.nix # ]
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
{...}: {
|
|
||||||
services.power-profiles-daemon.enable = true;
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
{...}: {
|
|
||||||
# Auto-configure CFS and process priorities for improved desktop responsiveness
|
|
||||||
services.system76-scheduler.enable = true;
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
{...}: {
|
|
||||||
services.tlp = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
|
||||||
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
|
||||||
|
|
||||||
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
|
||||||
CPU_ENERGY_PERF_POLICY_ON_BAT = "powersave";
|
|
||||||
|
|
||||||
CPU_MIN_PERF_ON_AC = 0;
|
|
||||||
CPU_MAX_PERF_ON_AC = 100;
|
|
||||||
CPU_MIN_PERF_ON_BAT = 0;
|
|
||||||
CPU_MAX_PERF_ON_BAT = 20;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,12 +1,11 @@
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
imports = [
|
imports = [
|
||||||
../core
|
|
||||||
|
|
||||||
./power-management
|
|
||||||
./graphical
|
./graphical
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.kernelPackages = pkgs.linuxPackages_zen;
|
boot.kernelPackages = pkgs.linuxPackages_zen;
|
||||||
boot.plymouth.enable = true;
|
boot.plymouth.enable = true;
|
||||||
networking.stevenblack.enable = true;
|
networking.stevenblack.enable = true;
|
||||||
|
services.system76-scheduler.enable = true;
|
||||||
|
services.power-profiles-daemon.enable = true;
|
||||||
}
|
}
|
5
nixos/profiles/device-type/laptop/default.nix
Normal file
5
nixos/profiles/device-type/laptop/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
../desktop
|
||||||
|
];
|
||||||
|
}
|
|
@ -3,6 +3,5 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(modulesPath + "/profiles/minimal.nix")
|
(modulesPath + "/profiles/minimal.nix")
|
||||||
../core
|
|
||||||
];
|
];
|
||||||
}
|
}
|
|
@ -1,10 +1,6 @@
|
||||||
{...}: {
|
{...}: {
|
||||||
imports = [
|
|
||||||
../core
|
|
||||||
];
|
|
||||||
|
|
||||||
### home-manager
|
### home-manager
|
||||||
home-manager.users.guanranwang.imports = map (n: ../../../home-manager/${n}) [
|
home-manager.users.guanranwang.imports = map (n: ../../../../home-manager/${n}) [
|
||||||
"modules/terms/alacritty.nix"
|
"modules/terms/alacritty.nix"
|
||||||
"modules/shell/fish.nix"
|
"modules/shell/fish.nix"
|
||||||
"modules/shell/bash.nix"
|
"modules/shell/bash.nix"
|
|
@ -4,18 +4,16 @@
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
../core
|
|
||||||
|
|
||||||
### Flakes
|
### Flakes
|
||||||
../../../../../nixos/flake-modules/home-manager.nix
|
../../../../../../nixos/flake-modules/home-manager.nix
|
||||||
../../../../../nixos/flake-modules/berberman.nix
|
../../../../../../nixos/flake-modules/berberman.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
myFlake.nixos.boot.noLoaderMenu = lib.mkDefault true;
|
myFlake.nixos.boot.noLoaderMenu = lib.mkDefault true;
|
||||||
|
|
||||||
### home-manager
|
### home-manager
|
||||||
home-manager.users.guanranwang.imports = map (n: ../../../home-manager/${n}) [
|
home-manager.users.guanranwang.imports = map (n: ../../../../home-manager/${n}) [
|
||||||
"profiles/command-line/nixos/fancy-stuff.nix"
|
"profiles/command-line/nixos/fancy-stuff.nix"
|
||||||
"profiles/graphical-stuff/nixos"
|
"profiles/graphical-stuff/nixos"
|
||||||
"profiles/media/nixos"
|
"profiles/media/nixos"
|
|
@ -0,0 +1,7 @@
|
||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
../desktop
|
||||||
|
];
|
||||||
|
|
||||||
|
home-manager.users.guanranwang.services.batsignal.enable = true;
|
||||||
|
}
|
|
@ -7,7 +7,7 @@
|
||||||
etcDirectory = "clash-meta";
|
etcDirectory = "clash-meta";
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
../../../../../../nixos/flake-modules/sops-nix.nix
|
../../../../../nixos/flake-modules/sops-nix.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
### sops-nix
|
### sops-nix
|
|
@ -1,5 +1,5 @@
|
||||||
{...}: {
|
{...}: {
|
||||||
home-manager.users.guanranwang.imports = [
|
home-manager.users.guanranwang.imports = [
|
||||||
../../../../home-manager/profiles/gaming/nixos
|
../../../home-manager/profiles/gaming/nixos
|
||||||
];
|
];
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
{...}: {
|
{...}: {
|
||||||
home-manager.users.guanranwang.imports = [
|
home-manager.users.guanranwang.imports = [
|
||||||
../../../../home-manager/profiles/torrenting/nixos
|
../../../home-manager/profiles/torrenting/nixos
|
||||||
];
|
];
|
||||||
}
|
}
|
Loading…
Reference in a new issue