This commit is contained in:
2022-02-08 19:28:32 +05:30
commit 90cd68c5a0
5 changed files with 310 additions and 0 deletions

156
configuration.nix Executable file
View File

@@ -0,0 +1,156 @@
# 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, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./stuff.nix
./networking.nix
./nvdia.nix
];
#virtualisation.libvirtd.enable = true;
#programs.dconf.enable = true;
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Set your time zone.
time.timeZone = "Asia/Kolkata";
nix = {
package = pkgs.nixUnstable; # or versioned attributes like nix_2_4
extraOptions = ''
experimental-features = nix-command flakes
'';
};
###
# services.xserver.videoDrivers = [ "nvidia" ];
###
#for gpu
# nixpkgs.config.allowUnfree = true;
# boot.extraModulePackages = [ pkgs.linuxPackages.nvidia_x11 ];
# boot.blacklistedKernelModules = [ "nouveau" "nvidia_drm" "nvidia_modeset" "nvidia" ];
# packages = [ pkgs.linuxPackages.nvidia_x11 ];
nixpkgs.config = {
allowBroken = true;
allowUnfree = true;
pulseaudio = true;
};
nix.autoOptimiseStore = true;
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable the X11 windowing system
services.xserver.enable = true;
services.xserver.displayManager.lightdm.enable = true;
services.xserver.windowManager = {
dwm.enable = true;
xmonad.enable = true;
xmonad.enableContribAndExtras = true;
xmonad.extraPackages = hpkgs: [
hpkgs.xmonad
hpkgs.xmonad-extras
];
};
# Configure keymap in X11
# services.xserver.layout = "us";
# services.xserver.xkbOptions = "eurosign:e";
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
sound.enable = true;
hardware.pulseaudio.enable = true;
services.mpd.enable = true;
services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.dumball = {
isNormalUser = true;
extraGroups = [ "wheel" ];
};
environment.systemPackages = with pkgs; [
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
virt-manager
firefox
glib
wget
wirelesstools
networkmanager
xclip
pciutils usbutils
git
neovim
alacritty
##for xmonad
picom
scrot
trayer
emacs
ntfs3g
kbd
ripgrep
bc
gnumake
];
programs.zsh.enable = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.05"; # Did you read the comment?
}

57
hardware-configuration.nix Executable file
View File

@@ -0,0 +1,57 @@
#867-43c8-b314-e254ce2ff77f Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
boot.supportedFilesystems = [ "ntfs" ];
# fileSystems."home/dumball/mnt/home4" =
# { device = "/dev/disk/by-uuid/8e086312-a867-43c8-b314-e254ce2ff77f";
# fsType = "btrfs";
# options = ["rw" "uid=1000" "compress-force=zstd:3" ];
# };
fileSystems."/" =
{ device = "/dev/disk/by-uuid/a0848f1a-fc0c-424b-b9b9-e62ca8b61c14";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/4CF2-4701";
fsType = "vfat";
};
fileSystems."/home2" =
{ device = "/dev/disk/by-uuid/B6CAFD08CAFCC5A1";
fsType = "ntfs";
options = [ "rw" "uid=1000"];
};
fileSystems."/mnt/home3" =
{ device = "/dev/disk/by-uuid/1A784CA0784C7C8F";
fsType = "ntfs";
options = [ "rwx" "uid=1000"];
};
swapDevices = [ ];
zramSwap = {
enable = true;
algorithm = "lz4";
memoryPercent = 30;
priority = -1;
};
}

34
networking.nix Normal file
View File

@@ -0,0 +1,34 @@
{ config, pkgs, ... }:
{
networking = {
hostName = "dumball"; # Define your hostname.
wireless.enable = true; # Enables wireless support via wpa_supplicant.
wireless.interfaces = ["wlp4s0"];
wireless.networks.Akshat.pskRaw = "4fb4def18646584f6e6bea59c72173c392c4b09faf71e5d1c1e1ebafb6e8bb82";
#networking.networkmanager.enable = true;
interfaces = {
wlp4s0 = {
useDHCP = true;
ipv4.addresses = [{
prefixLength = 24;
address = "223.178.248.231";
}];
};
};
};
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
}

39
nvdia.nix Normal file
View File

@@ -0,0 +1,39 @@
{config, pkgs, ... }:
let
nvidia-offload = pkgs.writeShellScriptBin "nvi" ''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec -a "$0" "$@"
'';
in
{
environment.systemPackages = with pkgs; [
nvidia-offload
];
hardware = {
opengl = {
driSupport32Bit = true;
# extraPackages32 = with pkgs.pkgsi686Linux; [ libva ];
enable = true;
};
nvidia = {
prime = {
# sync.enable = true;
offload = { enable = true; };
amdBusId = "PCI:5:0:0";
nvidiaBusId = "PCI:1:0:1";
};
modesetting = { enable = true; };
powerManagement = {
enable = true;
finegrained = true;
};
};
};
services.xserver = {
videoDrivers = [ "nvidia" ];
dpi = 96;
};
}

24
stuff.nix Normal file
View File

@@ -0,0 +1,24 @@
{lib, config, agenix, pkgs, ...}:
{
fonts.fonts = with pkgs; [
fira-mono
lohit-fonts.devanagari
lohit-fonts.gurmukhi
nerdfonts
font-awesome
monoid
office-code-pro
noto-fonts-cjk
];
users.users.dumball = {
isNormalUser = true;
shell = pkgs.zsh;
home = "/home/dumball";
extraGroups = [ "wheel" "adbusers" "video" "libvirtd" "docker" ];
};
gtk.iconCache.enable = true;
}