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,22 +49,32 @@
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 = {
allowUnfree = true; config = {
permittedInsecurePackages = [ allowUnfree = true;
"electron-25.9.0" permittedInsecurePackages = [ "electron-25.9.0" ];
"nix-2.16.2" packageOverrides = pkgs: {
]; steam = pkgs.steam.override { extraPkgs = pkgs: with pkgs; [ winetricks ]; };
packageOverrides = pkgs: { };
steam = pkgs.steam.override { extraPkgs = pkgs: with pkgs; [ winetricks ]; };
}; };
hostPlatform = lib.mkDefault "x86_64-linux";
}; };
services = { services = {
@ -168,31 +205,64 @@
}; };
fileSystems = { fileSystems = {
"/persist".options = [ "/" = {
"compress=lzo" device = "none";
"autodefrag" fsType = "tmpfs";
"discard=async" options = [
"defaults" "defaults"
]; "size=2g"
"/nix".options = [ "mode=755"
"compress=lzo" ];
"autodefrag" };
"discard=async" "/persist" = {
"noatime" device = "/dev/disk/by-uuid/d0eb1b09-7fba-49e3-b802-d6fdd9073516";
"defaults" neededForBoot = true;
]; fsType = "btrfs";
"/steam-library".options = [ options = [
"compress=lzo" "subvol=@nixos/root"
"autodefrag" "compress=lzo"
"discard=async" "autodefrag"
"defaults" "discard=async"
]; "defaults"
"/home".options = [ ];
"compress=lzo" };
"autodefrag" "/nix" = {
"discard=async" device = "/dev/disk/by-uuid/d0eb1b09-7fba-49e3-b802-d6fdd9073516";
"defaults" fsType = "btrfs";
]; options = [
"subvol=@nixos/nix"
"compress=lzo"
"autodefrag"
"discard=async"
"noatime"
"defaults"
];
};
"/steam-library" = {
device = "/dev/disk/by-uuid/d0eb1b09-7fba-49e3-b802-d6fdd9073516";
fsType = "btrfs";
options = [
"compress=lzo"
"autodefrag"
"discard=async"
"defaults"
];
};
"/home" = {
device = "/dev/disk/by-uuid/8597952f-be42-4361-9be1-2c4af6ede9b8";
fsType = "btrfs";
options = [
"subvol=@home"
"compress=lzo"
"autodefrag"
"discard=async"
"defaults"
];
};
"/boot" = {
device = "/dev/disk/by-uuid/1ADE-808D";
fsType = "vfat";
};
}; };
stylix = { stylix = {

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;
}