mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-24 00:29:43 -04:00
still working
This commit is contained in:
parent
64235f2775
commit
0712b63194
14 changed files with 508 additions and 174 deletions
8
sysConfig/desktop/default.nix
Normal file
8
sysConfig/desktop/default.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware.nix
|
||||
./system.nix
|
||||
];
|
||||
}
|
||||
73
sysConfig/desktop/hardware.nix
Normal file
73
sysConfig/desktop/hardware.nix
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
# Kernel
|
||||
boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
boot.kernelParams = [ "intel_iommu=on" ];
|
||||
boot.kernelModules = [ "kvm-intel" "virtio" "vfio-pci" "coretemp" ];
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
# Bootloader
|
||||
boot.loader = {
|
||||
grub = {
|
||||
enable = true;
|
||||
useOSProber = true;
|
||||
devices = [ "nodev" ];
|
||||
efiSupport = true;
|
||||
configurationLimit = 5;
|
||||
};
|
||||
|
||||
efi = {
|
||||
canTouchEfiVariables = true;
|
||||
};
|
||||
};
|
||||
|
||||
# FStab
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/af24c5b3-8a6e-4333-a61d-922a97928cae";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/home" =
|
||||
{ device = "/dev/disk/by-uuid/1639ee20-28d6-4649-814d-ba981c138b35";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/74B9-4AAF";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
# GPU
|
||||
programs.sway.extraOptions = "--unsupported-gpu";
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
hardware = {
|
||||
opengl.enable = true;
|
||||
nvidia = {
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
modesetting.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Virtualisation
|
||||
nix.system-features = "kvm";
|
||||
environment.systemPackages = pkgs.virt-manager;
|
||||
|
||||
virtualisation.libvirtd = {
|
||||
enable = true;
|
||||
qemu = {
|
||||
package = pkgs.qemu_kvm;
|
||||
runAsRoot = true;
|
||||
ovmf.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# CPU
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
|
||||
79
sysConfig/desktop/partitions.nix
Normal file
79
sysConfig/desktop/partitions.nix
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
{ disks ? [ "/dev/nvme0n1" "/dev/sda" ], ... }: {
|
||||
disko.devices = {
|
||||
disk = {
|
||||
one = {
|
||||
type = "disk";
|
||||
device = builtins.elemAt disks 0;
|
||||
content = {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
{
|
||||
name = "boot";
|
||||
start = "0";
|
||||
end = "100M";
|
||||
fs-type = "fat32";
|
||||
bootable = true;
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "primary";
|
||||
start = "100M";
|
||||
end = "100%";
|
||||
content = {
|
||||
type = "lvm_pv";
|
||||
vg = "pool";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
disk = {
|
||||
two = {
|
||||
type = "disk";
|
||||
device = builtins.elemAt disks 1;
|
||||
content = {
|
||||
|
||||
}
|
||||
};
|
||||
};
|
||||
lvm_vg = {
|
||||
pool = {
|
||||
type = "lvm_vg";
|
||||
lvs = {
|
||||
aaa = {
|
||||
size = "1M";
|
||||
};
|
||||
zzz = {
|
||||
size = "1M";
|
||||
};
|
||||
root = {
|
||||
size = "100M";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
];
|
||||
};
|
||||
};
|
||||
home = {
|
||||
size = "100%FREE";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/home";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
127
sysConfig/desktop/system.nix
Normal file
127
sysConfig/desktop/system.nix
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
system.stateVersion = "23.05";
|
||||
environment.defaultPackages = [ ];
|
||||
|
||||
nix = {
|
||||
extraOptions = "experimental-features = nix-command flakes";
|
||||
settings = {
|
||||
auto-optimise-store = true;
|
||||
};
|
||||
gc = {
|
||||
automatics = true;
|
||||
options = "weekly";
|
||||
};
|
||||
};
|
||||
|
||||
users.users.bryan = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" "networkmanager" "home-manager" "input" "video" "audio" "kvm" "libvirtd" "docker" ];
|
||||
};
|
||||
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
|
||||
# GUI
|
||||
programs = {
|
||||
sway = {
|
||||
enable = true;
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
rofi-wayland
|
||||
grim
|
||||
slurp
|
||||
wl-clipboard
|
||||
|
||||
xdg-utils
|
||||
|
||||
fontconfig
|
||||
qogir-icon-theme
|
||||
emote
|
||||
|
||||
pavucontrol
|
||||
];
|
||||
|
||||
extraSessionCommands = ''
|
||||
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
|
||||
exec sway
|
||||
fi
|
||||
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||
'';
|
||||
};
|
||||
xwayland.enable = true;
|
||||
xdg.portal.wlr.enable = true;
|
||||
|
||||
gnupg = {
|
||||
agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
audio.enable = true;
|
||||
|
||||
wireplumber.enable = true;
|
||||
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
};
|
||||
|
||||
fonts = {
|
||||
fonts = with pkgs; [
|
||||
terminus_font
|
||||
nerdfonts
|
||||
|
||||
noto-fonts
|
||||
noto-fonts-cjk
|
||||
|
||||
emojione
|
||||
];
|
||||
};
|
||||
|
||||
# System Services
|
||||
services = {
|
||||
trezord.enable = true;
|
||||
|
||||
cron = {
|
||||
enable = true;
|
||||
systemCronJobs = [
|
||||
"0 0 * * * bryan /home/bryan/Documents/scripts/lnbackup_script.sh"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
console = {
|
||||
font = "Lat2-Terminus16";
|
||||
useXkbConfig = true;
|
||||
};
|
||||
|
||||
# Locale
|
||||
time = {
|
||||
timeZone = "America/New_York";
|
||||
};
|
||||
|
||||
services.timesyncd = {
|
||||
enable = true;
|
||||
servers = [
|
||||
"0.pool.ntp.org"
|
||||
"1.pool.ntp.org"
|
||||
"2.pool.ntp.org"
|
||||
"3.pool.ntp.org"
|
||||
];
|
||||
};
|
||||
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
# Networking
|
||||
networking = {
|
||||
hostName = "socrates";
|
||||
useDHCP = lib.mkDefault true;
|
||||
networkmanager.enable = true;
|
||||
firewall.enable = true;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue