test: dn-lap test build
This commit is contained in:
parent
36b9f4e2b0
commit
04ce8d76ba
25 changed files with 245 additions and 160 deletions
27
flake.nix
27
flake.nix
|
|
@ -8,21 +8,30 @@
|
|||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self, nixpkgs-unstable, nixpkgs, ... }@inputs:
|
||||
outputs = { self, nixpkgs-unstable, nixpkgs, ... }@inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
pkgsUnstable = nixpkgs-unstable.legacyPackages.${system};
|
||||
nixvim.url = "github:azuwis/lazyvim-nixvim";
|
||||
in {
|
||||
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
|
||||
nixosConfigurations.dn-nix = nixpkgs.lib.nixosSystem {
|
||||
modules =
|
||||
[
|
||||
./system/configuration.nix
|
||||
];
|
||||
specialArgs = { inherit inputs; inherit pkgsUnstable; };
|
||||
formatter.x86_64-linux =
|
||||
nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
|
||||
|
||||
nixosConfigurations.dn-pre7780 = nixpkgs.lib.nixosSystem {
|
||||
modules = [ ./system/dev/dn-pre7780 ];
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
inherit pkgsUnstable;
|
||||
};
|
||||
};
|
||||
|
||||
nixosConfigurations.dn-lap = nixpkgs.lib.nixosSystem {
|
||||
modules = [ ./system/dev/dn-lap ];
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
inherit pkgsUnstable;
|
||||
};
|
||||
};
|
||||
|
||||
# homeConfigurations = {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
let configDir = ../config;
|
||||
in
|
||||
{
|
||||
in {
|
||||
home.file = {
|
||||
".config/nvim" = {
|
||||
source = "${configDir}/nvim";
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@
|
|||
#XDG_BIN_HOME = "\${HOME}/.local/bin";
|
||||
XDG_DATA_HOME = "\${HOME}/.local/share";
|
||||
GTK_IM_MODULE = "";
|
||||
XDG_DATA_DIRS = "\${XDG_DATA_DIRS}:/usr/share:/var/lib/flatpak/exports/share:\${HOME}/.local/share/flatpak/exports/share";
|
||||
XDG_DATA_DIRS =
|
||||
"\${XDG_DATA_DIRS}:/usr/share:/var/lib/flatpak/exports/share:\${HOME}/.local/share/flatpak/exports/share";
|
||||
|
||||
# GPU
|
||||
LIBVA_DRIVER_NAME = "nvidia";
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
let
|
||||
userName = "dachxy";
|
||||
email = "Danny10132024@gmail.com";
|
||||
in
|
||||
{
|
||||
in {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = userName;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
{ pkgs, ... }: {
|
||||
programs = {
|
||||
neovim = {
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
{ pkgs, ... }: {
|
||||
programs = {
|
||||
# nushell = {
|
||||
# enable = true;
|
||||
|
|
@ -12,8 +11,10 @@
|
|||
interactiveShellInit = ''
|
||||
set fish_greeting # Disable greeting
|
||||
'';
|
||||
plugins = [
|
||||
{ name = "grc"; src = pkgs.fishPlugins.grc.src; }
|
||||
plugins = [{
|
||||
name = "grc";
|
||||
src = pkgs.fishPlugins.grc.src;
|
||||
}
|
||||
# Other plugins can be located in config file
|
||||
];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
{ ... }: {
|
||||
dconf.settings = {
|
||||
"org/virt-manager/virt-manager/connections" = {
|
||||
autoconnect = [ "qemu:///system" ];
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
{ lib, pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [ ./hardware-configuration.nix ./modules inputs.home-manager.nixosModules.default ];
|
||||
|
||||
system.stateVersion = "24.11";
|
||||
home-manager = {
|
||||
backupFileExtension = "backup";
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
users = {
|
||||
"danny" = import ../home;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
12
system/dev/dn-lap/boot.nix
Normal file
12
system/dev/dn-lap/boot.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.extraModprobeConfig = ''
|
||||
options hid_apple fnmode=2
|
||||
'';
|
||||
|
||||
boot.initrd.systemd.enable = true;
|
||||
boot.initrd.kernelModules = [ "i915" ];
|
||||
boot.swraid.enable = true;
|
||||
}
|
||||
44
system/dev/dn-lap/default.nix
Normal file
44
system/dev/dn-lap/default.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{ lib, pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
inputs.home-manager.nixosModules.default
|
||||
|
||||
# Modules
|
||||
./boot.nix
|
||||
../../modules/dn-ca.nix
|
||||
../../modules/fonts.nix
|
||||
../../modules/hardware.nix
|
||||
../../modules/hyprland.nix
|
||||
../../modules/internationalisation.nix
|
||||
../../modules/misc.nix
|
||||
../../modules/networking.nix
|
||||
../../modules/nixsettings.nix
|
||||
../../modules/packages.nix
|
||||
../../modules/plymouth.nix
|
||||
../../modules/polkit.nix
|
||||
../../modules/programs.nix
|
||||
../../modules/sddm-theme.nix
|
||||
../../modules/security.nix
|
||||
../../modules/services.nix
|
||||
../../modules/sound.nix
|
||||
../../modules/theme.nix
|
||||
../../modules/time.nix
|
||||
../../modules/users.nix
|
||||
../../modules/virtualization.nix
|
||||
../../modules/wireguard.nix
|
||||
];
|
||||
|
||||
# Overrides
|
||||
networking.hostName = "dn-lap";
|
||||
programs.steam.enable = false;
|
||||
|
||||
system.stateVersion = "24.11";
|
||||
home-manager = {
|
||||
backupFileExtension = "backup";
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
users = { "danny" = import ../home; };
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -2,14 +2,16 @@
|
|||
|
||||
{
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.kernelParams = ["nvidia-drm.fbdev=1" "nvidia.NVreg_PreserveVideoMemoryAllocations=1"];
|
||||
boot.kernelParams =
|
||||
[ "nvidia-drm.fbdev=1" "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ];
|
||||
boot.extraModprobeConfig = ''
|
||||
options hid_apple fnmode=2
|
||||
options nvidia_drm modeset=1 dbdev=1
|
||||
'';
|
||||
|
||||
boot.initrd.systemd.enable = true;
|
||||
boot.initrd.kernelModules = [ "nvidia" "i915" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ];
|
||||
boot.initrd.kernelModules =
|
||||
[ "nvidia" "i915" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ];
|
||||
boot.swraid.enable = true;
|
||||
boot.swraid.mdadmConf =
|
||||
"\n MAILADDR smitty\n ARRAY /dev/md126 metadata=1.2 name=stuff:0\n UUID=3b0b7c51-2681-407e-a22a-e965a8aeece7\n ";
|
||||
22
system/dev/dn-pre7780/default.nix
Normal file
22
system/dev/dn-pre7780/default.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ lib, pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../../modules
|
||||
../../modules/nvidia.nix
|
||||
./boot.nix
|
||||
inputs.home-manager.nixosModules.default
|
||||
];
|
||||
|
||||
# Overrides
|
||||
networking.hostName = "dn-pre7780";
|
||||
|
||||
system.stateVersion = "24.11";
|
||||
home-manager = {
|
||||
backupFileExtension = "backup";
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
users = { "danny" = import ../home; };
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -4,23 +4,31 @@
|
|||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "vmd" "dm-raid" "xhci_pci" "thunderbolt" "nvme" "usbhid" "uas" "sd_mod" "rtsx_pci_sdmmc" ];
|
||||
boot.initrd.availableKernelModules = [
|
||||
"vmd"
|
||||
"dm-raid"
|
||||
"xhci_pci"
|
||||
"thunderbolt"
|
||||
"nvme"
|
||||
"usbhid"
|
||||
"uas"
|
||||
"sd_mod"
|
||||
"rtsx_pci_sdmmc"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelParams = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-label/nixos";
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-label/BOOT";
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-label/BOOT";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0077" "dmask=0077" ];
|
||||
};
|
||||
|
|
@ -36,5 +44,6 @@
|
|||
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
hardware.cpu.intel.updateMicrocode =
|
||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
./boot.nix
|
||||
./plymouth.nix # Boot splash
|
||||
./fonts.nix
|
||||
./gaming.nix
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
security.pki.certificates = [
|
||||
''
|
||||
security.pki.certificates = [''
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIBhzCCAS2gAwIBAgIQUwzjgrU4LTTmE7FTvaCHlzAKBggqhkjOPQQDAjAiMQsw
|
||||
CQYDVQQKEwJETjETMBEGA1UEAxMKRE4gUm9vdCBDQTAeFw0yNDExMTAwMjE5MzRa
|
||||
|
|
@ -14,6 +13,5 @@ FBgyUYt4st+TkVu4WWEfOhuVjbzqMAoGCCqGSM49BAMCA0gAMEUCIGUdeDfQJ+m0
|
|||
tdlSDJgnIXbJyU0u4cSvi8faJa7OtVovAiEAxvEteXU7f4+5U1yyk0NxJ7jg8B6P
|
||||
K5hP1e2clgjFv/k=
|
||||
-----END CERTIFICATE-----
|
||||
''
|
||||
];
|
||||
''];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
# Nvidia only
|
||||
let
|
||||
offload = pkgs.writeShellScriptBin "offload" ''
|
||||
#!/bin/bash
|
||||
|
|
@ -9,6 +10,4 @@ let
|
|||
export __VK_LAYER_NV_optimus=NVIDIA_only
|
||||
exec "$@"
|
||||
'';
|
||||
in {
|
||||
environment.systemPackages = [ offload ];
|
||||
}
|
||||
in { environment.systemPackages = [ offload ]; }
|
||||
|
|
|
|||
|
|
@ -7,7 +7,20 @@
|
|||
experimental-features = [ "nix-command" "flakes" ];
|
||||
auto-optimise-store = true;
|
||||
substituters = [ "https://nix-gaming.cachix.org" ];
|
||||
trusted-public-keys = [ "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" ];
|
||||
trusted-public-keys = [
|
||||
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
hardware.steam-hardware.enable = true;
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nixpkgs.config.allowUnfreePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
"steam"
|
||||
"steam-original"
|
||||
"steam-unwrapped"
|
||||
"steam-run"
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,12 @@
|
|||
{ config, pkgs, nixpkgs, ... }:
|
||||
|
||||
{
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
nixpkgs.config.packageOverrides = pkgs: {
|
||||
intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; };
|
||||
intel-vaapi-driver =
|
||||
pkgs.intel-vaapi-driver.override { enableHybridCodec = true; };
|
||||
};
|
||||
|
||||
|
||||
hardware = {
|
||||
steam-hardware.enable = true;
|
||||
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
|
|
@ -22,6 +18,8 @@
|
|||
FastConnectable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Xbox controller
|
||||
xpadneo.enable = true;
|
||||
|
||||
graphics = {
|
||||
|
|
@ -33,25 +31,6 @@
|
|||
];
|
||||
};
|
||||
|
||||
|
||||
nvidia.open = false;
|
||||
nvidia.modesetting.enable = true;
|
||||
|
||||
nvidia.powerManagement.enable = true;
|
||||
nvidia.powerManagement.finegrained = true;
|
||||
|
||||
nvidia.nvidiaSettings = true;
|
||||
nvidia.dynamicBoost.enable = true;
|
||||
nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
|
||||
nvidia.prime = {
|
||||
offload = {
|
||||
enable = true;
|
||||
enableOffloadCmd = true;
|
||||
};
|
||||
intelBusId = "PCI:0:2:0";
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
};
|
||||
};
|
||||
|
||||
# Enable bluetooth
|
||||
|
|
|
|||
|
|
@ -25,4 +25,18 @@
|
|||
rofi
|
||||
waybar
|
||||
];
|
||||
|
||||
nix = {
|
||||
settings = {
|
||||
warn-dirty = false;
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
auto-optimise-store = true;
|
||||
substituters = [ "https://hyprland.cachix.org" ];
|
||||
|
||||
trusted-public-keys = [
|
||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
{
|
||||
networking = {
|
||||
hostName = "dn-nix";
|
||||
networkmanager.enable = true;
|
||||
enableIPv6 = false;
|
||||
firewall = {
|
||||
|
|
|
|||
|
|
@ -3,27 +3,5 @@
|
|||
{
|
||||
documentation.nixos.enable = false;
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||
"steam"
|
||||
"steam-original"
|
||||
"steam-unwrapped"
|
||||
"steam-run"
|
||||
];
|
||||
nixpkgs.config.rcomSupport = true;
|
||||
|
||||
|
||||
nix = {
|
||||
settings = {
|
||||
warn-dirty = false;
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
auto-optimise-store = true;
|
||||
substituters =
|
||||
[ "https://nix-gaming.cachix.org" "https://hyprland.cachix.org" ];
|
||||
|
||||
trusted-public-keys = [
|
||||
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
|
||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
24
system/modules/nvidia.nix
Normal file
24
system/modules/nvidia.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
nvidia.open = false;
|
||||
nvidia.modesetting.enable = true;
|
||||
|
||||
nvidia.powerManagement.enable = true;
|
||||
nvidia.powerManagement.finegrained = true;
|
||||
|
||||
nvidia.nvidiaSettings = true;
|
||||
nvidia.dynamicBoost.enable = true;
|
||||
nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
|
||||
nvidia.prime = {
|
||||
offload = {
|
||||
enable = true;
|
||||
enableOffloadCmd = true;
|
||||
};
|
||||
# This may different between devices
|
||||
intelBusId = "PCI:0:2:0";
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
};
|
||||
}
|
||||
|
|
@ -4,19 +4,22 @@
|
|||
enable = true;
|
||||
theme = "catppuccin-frappe";
|
||||
themePackages = with pkgs; [
|
||||
(adi1090x-plymouth-themes.override {
|
||||
selected_themes = [ "motion" ];
|
||||
})
|
||||
(catppuccin-plymouth.override {
|
||||
variant = "frappe";
|
||||
}
|
||||
)
|
||||
(adi1090x-plymouth-themes.override { selected_themes = [ "motion" ]; })
|
||||
(catppuccin-plymouth.override { variant = "frappe"; })
|
||||
];
|
||||
};
|
||||
|
||||
consoleLogLevel = 0;
|
||||
initrd.verbose = false;
|
||||
kernelParams = [ "quiet" "splash" "boot.shell_on_fail" "loglevel=3" "rd.systemd.show_status=false" "rd.udev.log_level=3" "udev.log_priority=3" ];
|
||||
kernelParams = [
|
||||
"quiet"
|
||||
"splash"
|
||||
"boot.shell_on_fail"
|
||||
"loglevel=3"
|
||||
"rd.systemd.show_status=false"
|
||||
"rd.udev.log_level=3"
|
||||
"udev.log_priority=3"
|
||||
];
|
||||
loader.timeout = 0;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
networking.firewall = {
|
||||
allowedUDPPorts = [ 51820 ];
|
||||
};
|
||||
networking.firewall = { allowedUDPPorts = [ 51820 ]; };
|
||||
|
||||
networking.wg-quick.interfaces.wg0.configFile = "/etc/wireguard/wg0.conf";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue