Created
December 28, 2020 16:33
-
-
Save entroky/25f18be9d2116ee8ee62134c5adf9f7a to your computer and use it in GitHub Desktop.
config.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, ... }: | |
let | |
unstableTarball = | |
fetchTarball | |
https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz; | |
all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {}; | |
in | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix | |
]; | |
nixpkgs.config = { | |
allowUnfree = true; | |
oraclejdk.accept_license = true; | |
packageOverrides = pkgs: { | |
unstable = import unstableTarball { | |
config = config.nixpkgs.config; | |
}; | |
nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") | |
{ | |
inherit pkgs; | |
}; | |
}; | |
}; | |
nix = { | |
package = pkgs.nixFlakes; | |
extraOptions = '' | |
experimental-features = nix-command flakes | |
''; | |
}; | |
nix = { | |
binaryCaches = [ "https://hydra.iohk.io" "https://iohk.cachix.org" ]; | |
binaryCachePublicKeys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" "iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo=" ]; | |
}; | |
# Use the systemd-boot EFI boot loader. | |
boot.loader.systemd-boot.enable = true; | |
boot.loader.efi.canTouchEfiVariables = true; | |
networking.hostName = "nixos"; # Define your hostname. | |
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. | |
networking.networkmanager.enable = true; | |
# Set your time zone. | |
time.timeZone = "Asia/Kolkata"; | |
nixpkgs.config.allowUnfree = true; | |
# Enable Virtualbox | |
boot = { | |
kernelPackages = pkgs.linuxPackages_latest; | |
# Works with EVDI | |
# kernelPackages = pkgs.linuxPackages_5_4; | |
# Testing | |
# kernelPackages = pkgs.linuxPackages_5_5; | |
}; | |
# 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. | |
networking.useDHCP = false; | |
networking.interfaces.enp3s0f1.useDHCP = true; | |
networking.interfaces.wlp2s0.useDHCP = true; | |
# Configure network proxy if necessary | |
# networking.proxy.default = "http://user:password@proxy:port/"; | |
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; | |
# Select internationalisation properties. | |
i18n.defaultLocale = "en_US.UTF-8"; | |
console = { | |
font = "Lat2-Terminus16"; | |
keyMap = "us"; | |
}; | |
# Enable the GNOME 3 Desktop Environment. | |
services.xserver.enable = true; | |
services.xserver.displayManager.gdm.enable = true; | |
services.xserver.desktopManager.gnome3.enable = true; | |
services = { | |
httpd = { | |
enable = true; | |
adminAddr = "[email protected]"; | |
virtualHosts = { | |
localhost = { | |
documentRoot = "/webroot"; | |
}; | |
}; | |
}; | |
}; | |
services.xserver.videoDrivers = [ "intel" ]; | |
services.xserver.deviceSection = '' | |
Option "DRI" "2" | |
Option "TearFree" "true" | |
''; | |
# 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 = { | |
# Hardware settings | |
cpu.intel.updateMicrocode = true; | |
# enableAllFirmware = true; | |
enableRedistributableFirmware = true; | |
pulseaudio.enable = true; | |
pulseaudio.package = pkgs.pulseaudioFull; | |
opengl.driSupport32Bit = true; # Required for Steam | |
pulseaudio.support32Bit = true; # Required for Steam | |
bluetooth.enable = true; | |
}; | |
# Enable touchpad support (enabled default in most desktopManager). | |
services.xserver.libinput.enable = true; | |
security.sudo = { | |
enable = true; | |
wheelNeedsPassword = true; | |
}; | |
# Define a user account. Don't forget to set a password with ‘passwd’. | |
users.users.mohamed = { | |
isNormalUser = true; | |
home = "/home/mohamed"; | |
extraGroups = [ "networkmanager" "wheel" "audio"]; # Enable ‘sudo’ for the user. | |
}; | |
nix.trustedUsers = [ "root" "mohamed" ]; | |
# List packages installed in system profile. To search, run: | |
# $ nix search wget | |
environment.systemPackages = with pkgs; [ | |
gnumake | |
autoconf | |
xdotool # used by Keepass to paste stuff | |
unixtools.quota # used by the disk report widget | |
htop | |
jdiskreport | |
flameshot | |
unstable.oraclejre | |
peek # GIF recorder | |
gparted | |
hardinfo | |
geekbench | |
git | |
maven | |
ark | |
kate | |
keepass | |
unstable.qbittorrent | |
unstable.dropbox | |
unstable.google-chrome | |
unstable.firefox | |
anki | |
meld | |
nixui | |
nox | |
nix-info | |
nix-index | |
appimage-run | |
dpkg | |
openraPackages.mods.raclassic | |
python3Full | |
python.pkgs.pip | |
uget | |
aria | |
zoom-us | |
obs-studio | |
# unstable.playonlinux | |
unstable.steam | |
(unstable.steam.override { extraPkgs = pkgs: [ mono gtk3 gtk3-x11 libgdiplus zlib ]; nativeOnly = true; withPrimus = true; withJava = true; }).run | |
unstable.emacs | |
neovim | |
vim | |
haskell.compiler.ghc884 | |
haskellPackages.cabal-install | |
haskellPackages.stack | |
haskellPackages.ghcid | |
unstable.haskellPackages.cabal2nix | |
haskellPackages.stack2nix | |
(all-hies.selection { selector = p: { inherit (p) ghc884; }; }) | |
]; | |
# 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; | |
fonts = { | |
enableFontDir = true; | |
enableGhostscriptFonts = true; | |
fonts = with pkgs ; [ | |
corefonts | |
liberation_ttf | |
ttf_bitstream_vera | |
dejavu_fonts | |
terminus_font | |
bakoma_ttf | |
clearlyU | |
cm_unicode | |
andagii | |
bakoma_ttf | |
inconsolata | |
gentium | |
ubuntu_font_family | |
source-sans-pro | |
source-code-pro | |
]; | |
}; | |
services.emacs.enable = true; | |
# 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. It‘s 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 = "20.09"; # Did you read the comment? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment