feat: NixOS | modular nixos config

This commit is contained in:
2025-02-10 23:57:50 +05:00
parent 25b942ef7a
commit 257be3540d
23 changed files with 269 additions and 289 deletions

View File

@@ -0,0 +1,21 @@
{pkgs, ...}: {
environment = {
systemPackages = with pkgs; [
pciutils
virt-manager
virt-viewer
spice
spice-gtk
spice-protocol
win-virtio
win-spice
sops
sbctl # Secure boot
yubikey-manager
# Gaming stuff
mangohud
protonup-qt
];
};
}

View File

@@ -0,0 +1,12 @@
{pkgs, ...}: {
hardware = {
# Bluetooth.
bluetooth.enable = true;
bluetooth.powerOnBoot = true;
graphics = {
enable = true;
extraPackages = with pkgs; [amdvlk];
};
};
}

16
nixos/imports/i18n.nix Normal file
View File

@@ -0,0 +1,16 @@
{...}: {
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "ur_PK";
LC_IDENTIFICATION = "ur_PK";
LC_MEASUREMENT = "ur_PK";
LC_MONETARY = "ur_PK";
LC_NAME = "ur_PK";
LC_NUMERIC = "ur_PK";
LC_PAPER = "ur_PK";
LC_TELEPHONE = "ur_PK";
LC_TIME = "ur_PK";
};
};
}

View File

@@ -0,0 +1,7 @@
{hostName, ...}: {
networking = {
inherit hostName;
networkmanager.enable = true;
firewall.allowedTCPPorts = [22];
};
}

12
nixos/imports/nix.nix Normal file
View File

@@ -0,0 +1,12 @@
{...}: {
nix = {
settings = {
substituters = ["https://hyprland.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
experimental-features = [
"nix-command"
"flakes"
];
};
};
}

View File

@@ -0,0 +1,29 @@
{
pkgs,
inputs,
...
}: {
programs = {
nix-ld.enable = true;
dconf.enable = true;
gamemode.enable = true;
steam = {
enable = true;
gamescopeSession.enable = true;
};
_1password.enable = true;
_1password-gui = {
enable = true;
polkitPolicyOwners = ["shahab"];
};
hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
portalPackage =
inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
};
};
}

View File

@@ -0,0 +1,5 @@
{...}: {
security = {
rtkit.enable = true;
};
}

View File

@@ -0,0 +1,39 @@
{pkgs, ...}: {
services = {
greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --greeting 'Welcome to NixOS!' --asterisks --remember --remember-user-session --time --cmd ${pkgs.hyprland}/bin/Hyprland";
user = "greeter";
};
};
};
# OpenSSH
openssh.enable = true;
# Cups printing service
printing.enable = true;
# Enable blueman
blueman.enable = true;
# Enable smart card services
pcscd.enable = true;
# Framework firmware updating
fwupd.enable = true;
# Enable sound with pipewire.
pulseaudio.enable = false;
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
spice-vdagentd.enable = true;
};
}

28
nixos/imports/users.nix Normal file
View File

@@ -0,0 +1,28 @@
{pkgs, ...}: {
users = {
mutableUsers = false;
users.shahab = {
shell = pkgs.zsh;
# Only do this if you have already configured zsh in home manager
ignoreShellProgramCheck = true;
isNormalUser = true;
description = "Shahab Dogar";
extraGroups = [
"networkmanager"
"wheel"
"input"
"libvirtd"
];
hashedPassword = "$y$j9T$pvjyL7hL5x2VBarGNTnMl1$mLA2UsWTbfp8Hgp/ug5l8224thi..Mo8.p7ME.tDZ.4";
openssh.authorizedKeys = {
keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPBijtTtb6UT5gssWolNGX1rcjAKsdtfz25fZMMnzq4v"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGD/V4jLpuk7uAovkbHFr6uulfBKZmsH+BqmXIR2aYD0"
];
};
};
};
}

View File

@@ -0,0 +1,34 @@
{pkgs, ...}: {
virtualisation = {
podman = {
enable = true;
dockerSocket.enable = true;
dockerCompat = true;
autoPrune = {
enable = true;
dates = "weekly";
};
};
containers = {
registries = {
search = ["docker.io"];
};
};
libvirtd = {
enable = true;
qemu = {
swtpm.enable = true;
ovmf = {
enable = true;
packages = with pkgs; [OVMFFull.fd];
};
};
};
spiceUSBRedirection.enable = true;
};
}