Created
October 5, 2023 14:32
-
-
Save sacsbrainz/40f01bedd4b290e487c33f41c1799803 to your computer and use it in GitHub Desktop.
configuration.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page | |
# and in the NixOS manual (accessible by running ‘nixos-help’). | |
{ | |
config, | |
pkgs, | |
lib, | |
... | |
}: { | |
imports = [ | |
# Include the results of the hardware scan. | |
./hardware-configuration.nix | |
# <home-manager/nixos> | |
./cachix.nix | |
]; | |
# Bootloader. | |
boot = { | |
kernelParams = [ | |
"intel_iommu=on" | |
"vfio_iommu_type1.allow_unsafe_interrupts=1" | |
"kvm.ignore_msrs=1" | |
]; | |
kernelModules = [ "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" ]; | |
# my nvidia | |
extraModprobeConfig = "options vfio-pci ids=10de:1c92"; | |
# blacklist the nvidia for pass through | |
blacklistedKernelModules = [ "nvidia" "nouveau" ]; | |
loader = { | |
systemd-boot.enable = true; | |
efi.canTouchEfiVariables = true; | |
}; | |
#Enable ntfs storage to enable it mount | |
supportedFilesystems = [''ntfs'' ''exfat'' ''avfs'' ''ntfs3'']; | |
}; | |
# Allow unfree packages | |
nixpkgs.config.allowUnfree = true; | |
services = { | |
#bluetooth | |
blueman.enable = true; | |
# logind | |
logind = { | |
extraConfig = '' | |
HandlePowerKey=suspend | |
''; | |
lidSwitch = "suspend"; | |
}; | |
# Enable X11 | |
xserver = { | |
enable = true; | |
# Configure keymap in X11.... | |
layout = "ng"; | |
xkbVariant = ""; | |
#.... | |
# displayManager.sddm.enable = true; | |
displayManager.gdm.enable = true; | |
videoDrivers = ["nvidia"]; | |
# desktopManager.gnome.enable = true; | |
}; | |
#Enable dbus | |
dbus.enable = true; | |
#Enable GVFS for thunar | |
gvfs.enable = true; | |
# udisks2.enable = true; | |
# For sound | |
pipewire = { | |
enable = true; | |
alsa.enable = true; | |
alsa.support32Bit = true; | |
pulse.enable = true; | |
wireplumber.enable = true; | |
}; | |
}; | |
#name that will show when to connect to a network | |
networking.hostName = "nixos"; | |
# Enable networking | |
networking.networkmanager.enable = true; | |
#Enable sound | |
hardware.pulseaudio.enable = false; | |
security.rtkit.enable = true; | |
# Set your time zone. | |
time.timeZone = "Africa/Lagos"; | |
# Select internationalisation properties. | |
i18n = { | |
defaultLocale = "en_NG"; | |
extraLocaleSettings = { | |
LC_ADDRESS = "en_NG"; | |
LC_IDENTIFICATION = "en_NG"; | |
LC_MEASUREMENT = "en_NG"; | |
LC_MONETARY = "en_NG"; | |
LC_NAME = "en_NG"; | |
LC_NUMERIC = "en_NG"; | |
LC_PAPER = "en_NG"; | |
LC_TELEPHONE = "en_NG"; | |
LC_TIME = "en_NG"; | |
}; | |
}; | |
users.users = { | |
sacs = { | |
isNormalUser = true; | |
extraGroups = [''networkmanager'' ''wheel'' ''libvirtd'' ''docker'' ''kvm'']; | |
name = "sacs"; | |
home = "/home/sacs"; | |
packages = with pkgs; [ | |
brave | |
transmission-gtk | |
pywal | |
firefox | |
rnnoise | |
minikube | |
obs-studio | |
vscode | |
vlc | |
kitty | |
playerctl | |
swww | |
remmina | |
waybar | |
neofetch | |
font-awesome | |
(nerdfonts.override {fonts = ["FiraCode" "DroidSansMono"];}) | |
nerd-font-patcher | |
spotify | |
insomnia | |
grim | |
wl-clipboard | |
dunst | |
rofi-wayland | |
viewnior | |
jetbrains-mono | |
brightnessctl | |
pavucontrol | |
iw | |
pulseaudioFull | |
ntfs3g | |
keepassxc | |
google-chrome | |
postman | |
xfce.thunar | |
xfce.thunar-volman | |
xfce.thunar-archive-plugin | |
xfce.thunar-media-tags-plugin | |
slurp | |
jq | |
libnotify | |
imagemagick | |
wf-recorder | |
copyq | |
nixfmt | |
cachix | |
virt-manager | |
virt-viewer | |
dmidecode | |
spice | |
spice-gtk | |
spice-protocol | |
win-virtio | |
win-spice | |
gnome.adwaita-icon-theme | |
kubectl | |
bluez5-experimental | |
(import (fetchTarball https://install.devenv.sh/latest)).default | |
]; | |
}; | |
}; | |
programs.direnv.enable = true; | |
# programs.direnv.enableBashIntegration = true; | |
# programs.direnv.enable = true; | |
# programs.bash.enable = true; | |
# Enable automatic login for the user. | |
# services.getty.autologinUser = "sacs"; | |
#enable flake | |
# nix.settings.experimental-features = [ "nix-command" "flakes"]; | |
hardware.steam-hardware.enable = true; | |
hardware = { | |
opengl = { | |
enable = true; | |
driSupport32Bit = true; | |
driSupport = true; | |
}; | |
}; | |
hardware.uinput.enable = true; | |
hardware.nvidia.modesetting.enable = true; | |
hardware.bluetooth.enable = true; | |
hardware.nvidia.prime = { | |
offload.enable = true; | |
amdgpuBusId = "PCI:8:0:0"; | |
nvidiaBusId = "PCI:1:0:0"; | |
}; | |
#fix permission issues thunar | |
security.polkit.extraConfig = '' | |
polkit.addRule(function(action, subject) { | |
if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" || | |
action.id == "org.freedesktop.udisks2.filesystem-mount") && | |
subject.isInGroup("wheel")) { | |
return polkit.Result.YES; | |
} | |
}); | |
''; | |
# enable dconf module | |
programs.dconf.enable = true; | |
# List packages installed in system profile. To search, run: | |
# $ nix search wget | |
environment.systemPackages = with pkgs; [ | |
vim | |
curl | |
wget | |
zip | |
unzip | |
]; | |
#enable git | |
programs.git = { | |
enable = true; | |
}; | |
# hyprland | |
programs.hyprland = { | |
enable = true; | |
xwayland = { | |
enable = true; | |
}; | |
}; | |
#programs.thunar.enable = true; | |
# Manage the virtualisation services | |
virtualisation = { | |
spiceUSBRedirection.enable = true; | |
docker.enable = true; | |
libvirtd = { | |
enable = true; | |
qemu = { | |
ovmf = { | |
enable = true; | |
packages = [ pkgs.OVMF.fd ]; | |
}; | |
}; | |
}; | |
}; | |
services.spice-vdagentd.enable = true; | |
system.stateVersion = "23.05"; # Did you read the comment? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment