Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@

hosts = {
wopr = "x86_64-linux";
javelin = "x86_64-linux";
};

forEachSystem = nixpkgs.lib.genAttrs systems;
Expand Down
31 changes: 31 additions & 0 deletions hosts/javelin/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
...
}:
{
imports = [
./hardware.nix
];

host = {
owner = "ndavd";
name = "javelin";

primaryMonitor = {
output = "DP-1";
width = 2560;
height = 1440;
refreshRate = 240;
scale = 1.0;
};
secondaryMonitor = {
output = "HDMI-A-1";
width = 1920;
height = 1080;
refreshRate = 60;
scale = 1.0;
};

gpu = "amd";
gaming.enable = true;
};
}
70 changes: 70 additions & 0 deletions hosts/javelin/hardware.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
config,
lib,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];

boot = {
initrd = {
availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usbhid"
"usb_storage"
"sd_mod"
];
kernelModules = [ ];
luks.devices."cryptroot".device = "/dev/disk/by-uuid/16331fde-6c45-417c-8a8b-efaf2c195a88";
};
kernelModules = [ "kvm-amd" ];
extraModulePackages = [ ];
};

fileSystems = {
"/" = {
device = "/dev/mapper/cryptroot";
fsType = "btrfs";
options = [
"subvol=@"
"noatime"
"compress=zstd:1"
];
};
"/home" = {
device = "/dev/mapper/cryptroot";
fsType = "btrfs";
options = [
"subvol=@home"
"noatime"
"compress=zstd:1"
];
};
"/nix" = {
device = "/dev/mapper/cryptroot";
fsType = "btrfs";
options = [
"subvol=@nix"
"noatime"
"compress=zstd:1"
];
};
"/boot" = {
device = "/dev/disk/by-uuid/8C10-7D2F";
fsType = "vfat";
options = [
"fmask=0022"
"dmask=0022"
];
};
};

swapDevices = [ ];

hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
5 changes: 2 additions & 3 deletions hosts/wopr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
scale = 1.25;
};

nvidiaGpu.enable = true;
cpu = "amd";

gpu = "nvidia";
gaming.enable = true;
laptop.enable = true;
};
}
20 changes: 20 additions & 0 deletions modules/amd.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
config,
lib,
...
}:
let
inherit (config.host) gpu;
in
{
config = lib.mkIf (gpu == "amd") {
hardware = {
graphics = {
enable = true;
enable32Bit = true;
};
amdgpu.opencl.enable = true;
};
nixpkgs.config.rocmSupport = true;
};
}
13 changes: 10 additions & 3 deletions modules/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
...
}:
let
inherit (config.host) owner name browser;
inherit (config.host)
owner
name
browser
laptop
;
in
{
imports = [
Expand Down Expand Up @@ -71,9 +76,10 @@ in
};

services = {
power-profiles-daemon.enable = true;
upower.enable = true;
power-profiles-daemon.enable = laptop.enable;
upower.enable = laptop.enable;
udisks2.enable = true;
hardware.openrgb.enable = true;
resolved = {
enable = true;
settings.Resolve = {
Expand Down Expand Up @@ -103,6 +109,7 @@ in
obs-pipewire-audio-capture
];
};
coolercontrol.enable = true;
};

virtualisation.docker.enable = true;
Expand Down
1 change: 1 addition & 0 deletions modules/gaming.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ in
protonup-ng
winetricks
heroic
mangohud
];
};
};
Expand Down
4 changes: 2 additions & 2 deletions modules/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
let
inherit (config.host)
owner
nvidiaGpu
gpu
launcher
primaryMonitor
secondaryMonitor
Expand Down Expand Up @@ -100,7 +100,7 @@ in
ELECTRON_OZONE_PLATFORM_HINT = "auto";
QT_QPA_PLATFORM = "wayland";
}
// lib.optionalAttrs nvidiaGpu.enable {
// lib.optionalAttrs (gpu == "nvidia") {
LIBVA_DRIVER_NAME = "nvidia";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
NVD_BACKEND = "direct";
Expand Down
12 changes: 10 additions & 2 deletions modules/nix.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
config,
pkgs,
lib,
...
}:
let
inherit (config.host) owner;
inherit (config.host) owner gpu;
in
{
nixpkgs.config.allowUnfree = true;
Expand All @@ -24,7 +25,10 @@ in

settings = {
builders-use-substitutes = true;
trusted-users = [ owner ];
trusted-users = [
"root"
"@wheel"
];
download-buffer-size = 500000000;

experimental-features = [
Expand All @@ -37,13 +41,17 @@ in
"https://cache.nixos.org"
"https://nix-community.cachix.org"
"https://hyprland.cachix.org"
]
++ lib.optionals (gpu == "nvidia") [
"https://cache.nixos-cuda.org"
];

trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
]
++ lib.optionals (gpu == "nvidia") [
"cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M="
];
};
Expand Down
4 changes: 2 additions & 2 deletions modules/nvidia.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
...
}:
let
inherit (config.host) nvidiaGpu;
inherit (config.host) gpu;
in
{
config = lib.mkIf nvidiaGpu.enable {
config = lib.mkIf (gpu == "nvidia") {
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
open = true;
Expand Down
17 changes: 7 additions & 10 deletions modules/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,15 @@ in
type = lib.types.nonEmptyStr;
};

gaming.enable = lib.mkEnableOption "gaming capabilities";
laptop.enable = lib.mkEnableOption "laptop capabilities";

nvidiaGpu.enable = lib.mkEnableOption "NVIDIA GPU";
gaming.enable = lib.mkEnableOption "gaming capabilities";

cpu = lib.mkOption {
type = lib.types.nullOr (
lib.types.enum [
"amd"
"intel"
]
);
default = null;
gpu = lib.mkOption {
type = lib.types.enum [
"nvidia"
"amd"
];
};

primaryMonitor = lib.mkOption {
Expand Down
2 changes: 2 additions & 0 deletions modules/quickshell/config/Config.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ Singleton {
readonly property int rightSideSpacing: 12

readonly property int kibPerGib: 1048576

readonly property bool hasStatusBarBattery: Quickshell.env("QS_STATUSBAR_BATTERY") !== "0"
}
9 changes: 7 additions & 2 deletions modules/quickshell/config/StatusBar.qml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import Quickshell
Expand Down Expand Up @@ -57,8 +58,12 @@ PanelWindow {
rootWindow: root
}

Battery {
rootWindow: root
Loader {
active: Config.hasStatusBarBattery
visible: active
sourceComponent: Battery {
rootWindow: root
}
}

Clock {
Expand Down
13 changes: 9 additions & 4 deletions modules/quickshell/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
...
}:
let
inherit (config.host) owner;
inherit (config.host) owner laptop;
in
{
environment.systemPackages = with pkgs; [
quickshell
];
environment = {
systemPackages = with pkgs; [
quickshell
];
sessionVariables = {
QS_STATUSBAR_BATTERY = if laptop.enable then "1" else "0";
};
};

hjem.users.${owner}.xdg.config.files."quickshell".source = ./config;
}
Loading