ezConfigs for smolboi

This commit is contained in:
Chris Dombroski 2024-09-20 21:49:07 -04:00
parent 5dd5cc0c06
commit 0e0076c14c
4 changed files with 112 additions and 149 deletions

View file

@ -93,34 +93,6 @@
} }
); );
}; };
nixosConfigurations = {
smolboi = inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
pkgs-unstable = inputs.nixunstable.legacyPackages.x86_64-linux;
};
modules = [
./systems/smolboi/configuration.nix
inputs.stylix.nixosModules.stylix
inputs.impermanence.nixosModules.impermanence
inputs.nixos-hardware.nixosModules.common-cpu-amd
inputs.nixos-hardware.nixosModules.common-cpu-amd-pstate
inputs.nixos-hardware.nixosModules.common-cpu-amd-zenpower
inputs.nixos-hardware.nixosModules.common-gpu-amd
inputs.nixos-hardware.nixosModules.common-pc
inputs.nixos-hardware.nixosModules.common-pc-ssd
inputs.nixos-hardware.nixosModules.gigabyte-b550
inputs.home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = {
pkgs-unstable = inputs.nixunstable.legacyPackages.x86_64-linux;
};
home-manager.useGlobalPkgs = true;
home-manager.users.cdombroski = import ./systems/smolboi/home.nix;
}
];
};
};
}; };
perSystem = perSystem =
{ pkgs, system, ... }: { pkgs, system, ... }:

View file

@ -1,18 +1,45 @@
{ config, pkgs, ... }: {
config,
pkgs,
ezModules,
inputs,
modulesPath,
lib,
...
}:
let
pkgs-unstable = import inputs.nixunstable { inherit (pkgs.stdenv) system; };
in
{ {
imports = [ imports = [
# Include the results of the hardware scan. inputs.stylix.nixosModules.stylix
./hardware-configuration.nix inputs.impermanence.nixosModules.impermanence
../../nixos-modules inputs.nixos-hardware.nixosModules.common-cpu-amd
../../nixos-modules/aarch64-emu.nix inputs.nixos-hardware.nixosModules.common-cpu-amd-pstate
../../nixos-modules/smartd.nix inputs.nixos-hardware.nixosModules.common-cpu-amd-zenpower
../../nixos-modules/plymouth.nix inputs.nixos-hardware.nixosModules.common-gpu-amd
inputs.nixos-hardware.nixosModules.common-pc
inputs.nixos-hardware.nixosModules.common-pc-ssd
inputs.nixos-hardware.nixosModules.gigabyte-b550
inputs.home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = {
inherit pkgs-unstable;
};
home-manager.useGlobalPkgs = true;
home-manager.users.cdombroski = import ../configs/home.nix;
}
ezModules.aarch64-emu
ezModules.smartd
ezModules.plymouth
]; ];
boot = { boot = {
loader.systemd-boot.enable = true; loader = {
loader.efi.canTouchEfiVariables = true; systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
binfmt.registrations.appimage = { binfmt.registrations.appimage = {
wrapInterpreterInShell = false; wrapInterpreterInShell = false;
interpreter = "${pkgs.appimage-run}/bin/appimage-run"; interpreter = "${pkgs.appimage-run}/bin/appimage-run";
@ -22,23 +49,33 @@
magicOrExtension = "\\x7fELF....AI\\x02"; magicOrExtension = "\\x7fELF....AI\\x02";
}; };
tmp.cleanOnBoot = true; tmp.cleanOnBoot = true;
kernelModules = [ "kvm-amd" ];
initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usb_storage"
"usbhid"
"sd_mod"
];
}; };
networking = { networking = {
hostName = "smolboi"; # Define your hostname. hostName = "smolboi"; # Define your hostname.
networkmanager.enable = true; # Easiest to use and most distros use this by default. networkmanager.enable = true; # Easiest to use and most distros use this by default.
firewall.allowedTCPPorts = [ 22000 ]; firewall.allowedTCPPorts = [ 22000 ];
useDHCP = lib.mkDefault true;
}; };
nixpkgs.config = { nixpkgs = {
config = {
allowUnfree = true; allowUnfree = true;
permittedInsecurePackages = [ permittedInsecurePackages = [ "electron-25.9.0" ];
"electron-25.9.0"
"nix-2.16.2"
];
packageOverrides = pkgs: { packageOverrides = pkgs: {
steam = pkgs.steam.override { extraPkgs = pkgs: with pkgs; [ winetricks ]; }; steam = pkgs.steam.override { extraPkgs = pkgs: with pkgs; [ winetricks ]; };
}; };
}; };
hostPlatform = lib.mkDefault "x86_64-linux";
};
services = { services = {
ratbagd.enable = true; ratbagd.enable = true;
@ -168,32 +205,65 @@
}; };
fileSystems = { fileSystems = {
"/persist".options = [ "/" = {
device = "none";
fsType = "tmpfs";
options = [
"defaults"
"size=2g"
"mode=755"
];
};
"/persist" = {
device = "/dev/disk/by-uuid/d0eb1b09-7fba-49e3-b802-d6fdd9073516";
neededForBoot = true;
fsType = "btrfs";
options = [
"subvol=@nixos/root"
"compress=lzo" "compress=lzo"
"autodefrag" "autodefrag"
"discard=async" "discard=async"
"defaults" "defaults"
]; ];
"/nix".options = [ };
"/nix" = {
device = "/dev/disk/by-uuid/d0eb1b09-7fba-49e3-b802-d6fdd9073516";
fsType = "btrfs";
options = [
"subvol=@nixos/nix"
"compress=lzo" "compress=lzo"
"autodefrag" "autodefrag"
"discard=async" "discard=async"
"noatime" "noatime"
"defaults" "defaults"
]; ];
"/steam-library".options = [ };
"/steam-library" = {
device = "/dev/disk/by-uuid/d0eb1b09-7fba-49e3-b802-d6fdd9073516";
fsType = "btrfs";
options = [
"compress=lzo" "compress=lzo"
"autodefrag" "autodefrag"
"discard=async" "discard=async"
"defaults" "defaults"
]; ];
"/home".options = [ };
"/home" = {
device = "/dev/disk/by-uuid/8597952f-be42-4361-9be1-2c4af6ede9b8";
fsType = "btrfs";
options = [
"subvol=@home"
"compress=lzo" "compress=lzo"
"autodefrag" "autodefrag"
"discard=async" "discard=async"
"defaults" "defaults"
]; ];
}; };
"/boot" = {
device = "/dev/disk/by-uuid/1ADE-808D";
fsType = "vfat";
};
};
stylix = { stylix = {
image = "${pkgs.kdePackages.breeze}/share/wallpapers/Next/contents/images_dark/2560x1440.png"; image = "${pkgs.kdePackages.breeze}/share/wallpapers/Next/contents/images_dark/2560x1440.png";

View file

@ -1,79 +0,0 @@
# 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 = [
"nvme"
"xhci_pci"
"ahci"
"usb_storage"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
options = [
"defaults"
"size=2g"
"mode=755"
];
};
fileSystems."/persist" = {
device = "/dev/disk/by-uuid/d0eb1b09-7fba-49e3-b802-d6fdd9073516";
neededForBoot = true;
fsType = "btrfs";
options = [ "subvol=@nixos/root" ];
};
fileSystems."/steam-library" = {
device = "/dev/disk/by-uuid/d0eb1b09-7fba-49e3-b802-d6fdd9073516";
fsType = "btrfs";
options = [ "subvol=@steam-library" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/1ADE-808D";
fsType = "vfat";
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/8597952f-be42-4361-9be1-2c4af6ede9b8";
fsType = "btrfs";
options = [ "subvol=@home" ];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/d0eb1b09-7fba-49e3-b802-d6fdd9073516";
fsType = "btrfs";
options = [ "subvol=@nixos/nix" ];
};
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.wlp5s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}