mirror of
https://github.com/tuxdotrs/nix-config.git
synced 2026-05-07 02:16:33 +05:30
feat: setup base
This commit is contained in:
157
modules/hosts/sirius/config.nix
Normal file
157
modules/hosts/sirius/config.nix
Normal file
@@ -0,0 +1,157 @@
|
||||
{
|
||||
flake.modules.nixos.sirius =
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
hostName,
|
||||
userName,
|
||||
userEmail,
|
||||
...
|
||||
}:
|
||||
{
|
||||
# --- Boot ---
|
||||
boot = {
|
||||
loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
kernelPackages = pkgs.linuxKernel.packages.linux_zen;
|
||||
kernelParams = [ "nvidia-drm.modeset=1" ];
|
||||
};
|
||||
|
||||
# --- Networking ---
|
||||
networking = {
|
||||
hostName = hostName;
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
wifi.backend = "iwd";
|
||||
};
|
||||
wireless.iwd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
Network = {
|
||||
EnableIPv6 = true;
|
||||
};
|
||||
Settings = {
|
||||
AutoConnect = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
firewall.enable = false;
|
||||
};
|
||||
|
||||
# --- Hardware / GPU ---
|
||||
hardware = {
|
||||
graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
nvidia = {
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
modesetting.enable = true;
|
||||
open = false;
|
||||
nvidiaSettings = true;
|
||||
};
|
||||
|
||||
enableAllFirmware = true;
|
||||
usb-modeswitch.enable = true;
|
||||
};
|
||||
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
# --- Locale ---
|
||||
time.timeZone = "Asia/Kolkata";
|
||||
i18n = {
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
extraLocaleSettings = lib.genAttrs [
|
||||
"LC_ADDRESS"
|
||||
"LC_IDENTIFICATION"
|
||||
"LC_MEASUREMENT"
|
||||
"LC_MONETARY"
|
||||
"LC_NAME"
|
||||
"LC_NUMERIC"
|
||||
"LC_PAPER"
|
||||
"LC_TELEPHONE"
|
||||
"LC_TIME"
|
||||
] (_: "en_IN");
|
||||
};
|
||||
|
||||
# --- Desktop ---
|
||||
services = {
|
||||
displayManager.ly.enable = true;
|
||||
desktopManager.plasma6.enable = true;
|
||||
};
|
||||
|
||||
# --- Fonts ---
|
||||
fonts.packages = with pkgs.nerd-fonts; [
|
||||
fira-code
|
||||
jetbrains-mono
|
||||
bigblue-terminal
|
||||
];
|
||||
|
||||
# --- Audio ---
|
||||
services.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa = {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
};
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
# --- SSH ---
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
startWhenNeeded = true;
|
||||
allowSFTP = true;
|
||||
settings = {
|
||||
PermitRootLogin = "no";
|
||||
PasswordAuthentication = false;
|
||||
KbdInteractiveAuthentication = false;
|
||||
AuthenticationMethods = "publickey";
|
||||
PubkeyAuthentication = "yes";
|
||||
UsePAM = false;
|
||||
UseDns = false;
|
||||
X11Forwarding = false;
|
||||
ClientAliveCountMax = 5;
|
||||
ClientAliveInterval = 60;
|
||||
|
||||
KexAlgorithms = [
|
||||
"curve25519-sha256"
|
||||
"curve25519-sha256@libssh.org"
|
||||
"diffie-hellman-group16-sha512"
|
||||
"diffie-hellman-group18-sha512"
|
||||
"sntrup761x25519-sha512@openssh.com"
|
||||
"diffie-hellman-group-exchange-sha256"
|
||||
"mlkem768x25519-sha256"
|
||||
"sntrup761x25519-sha512"
|
||||
];
|
||||
Macs = [
|
||||
"hmac-sha2-512-etm@openssh.com"
|
||||
"hmac-sha2-256-etm@openssh.com"
|
||||
"umac-128-etm@openssh.com"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# --- Programs ---
|
||||
programs.firefox.enable = true;
|
||||
|
||||
# --- Packages ---
|
||||
environment.systemPackages = with pkgs; [
|
||||
neovim
|
||||
discord
|
||||
pciutils
|
||||
brave
|
||||
zed-editor
|
||||
usbutils
|
||||
];
|
||||
|
||||
# !!! DO NOT CHANGE THIS !!!
|
||||
# This should match the version used at initial install.
|
||||
system.stateVersion = "26.05";
|
||||
};
|
||||
}
|
||||
23
modules/hosts/sirius/default.nix
Normal file
23
modules/hosts/sirius/default.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
inputs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hostName = "sirius";
|
||||
userName = "tux";
|
||||
userEmail = "t@tux.rs";
|
||||
system = "x86_64-linux";
|
||||
unstable = true;
|
||||
nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable;
|
||||
in
|
||||
{
|
||||
flake.nixosConfigurations."${hostName}" = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = { inherit hostName userName userEmail; };
|
||||
modules = [
|
||||
config.flake.modules.nixos.core
|
||||
config.flake.modules.nixos.${hostName}
|
||||
];
|
||||
};
|
||||
}
|
||||
48
modules/hosts/sirius/hardware.nix
Normal file
48
modules/hosts/sirius/hardware.nix
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
flake.modules.nixos.sirius =
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/d856ed98-6841-4cbf-89be-e08c6f48b9ea";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/7FE1-55C5";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0077"
|
||||
"dmask=0077"
|
||||
];
|
||||
};
|
||||
|
||||
swapDevices = [ { device = "/dev/disk/by-uuid/69794aa5-51a9-4816-8d45-7791505165d4"; } ];
|
||||
|
||||
# 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.wlp10s0f3u2i2.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
};
|
||||
}
|
||||
24
modules/hosts/sirius/home.nix
Normal file
24
modules/hosts/sirius/home.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
flake.modules.homeManager.sirius = {
|
||||
imports = with config.flake.modules.homeManager; [
|
||||
desktop
|
||||
];
|
||||
|
||||
tnix.services.lan-mouse = {
|
||||
enable = true;
|
||||
settings = {
|
||||
clients = [
|
||||
{
|
||||
position = "right";
|
||||
hostname = "canopus";
|
||||
activate_on_startup = true;
|
||||
ips = [ "192.168.8.2" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
home.stateVersion = "26.05";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user