You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dotfiles/nixos/configuration.nix

196 lines
5.4 KiB
Nix

5 years ago
# 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
./lenovo-configuration.nix
];
# Use the systemd-boot EFI boot loader.
fileSystems.boot.device = "/dev/sda1";
fileSystems.boot.mountPoint = "/boot";
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.loader.grub = {
enable = true;
device = "nodev";
version = 2;
efiSupport = true;
enableCryptodisk = true;
useOSProber = true;
splashImage = "/home/anton/pics/nix-dark-small-red.png";
};
boot.initrd.luks.devices = [
{
name = "root";
device = "/dev/disk/by-uuid/02799bea-98ce-4a38-8772-886303170455";
preLVM = true;
allowDiscards = true;
}
];
boot.kernelParams = [ "noapic" ];
boot.tmpOnTmpfs = true;
networking.hostName = "hostname"; # Define your hostname.
networking.networkmanager = {
wifi.macAddress = "random";
wifi.scanRandMacAddress = true;
# ethernet.macAddress = "random";
enable = true;
};
networking.nameservers = [
"194.150.168.168"
"212.82.226.212"
"1.1.1.1"
];
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# 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.enp2s0.useDHCP = true;
networking.interfaces.wlp4s0.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 = {
consoleFont = "Lat2-Terminus16";
consoleKeyMap = "de";
defaultLocale = "en_US.UTF-8";
};
# Set your time zone.
time.timeZone = "Europe/Amsterdam";
# List packages installed in system profile. To search, run:
# $ nix search wget
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
wget vim neovim manpages termite pass coreutils
unzip gzip htop nload firefox ghc vlc gcc python3
fish git file ripgrep os-prober vscode thunderbird
mate.atril xorg.xbacklight gnupg lxqt.pavucontrol-qt
inkscape xorg.xrandr redshift tree flameshot
# file system utils
exfat-utils fuse_exfat ntfs3g
jmtpfs # android
5 years ago
(texlive.combine {
inherit(texlive) scheme-full;
})
];
environment.variables = {
EDITOR = "nvim";
TERMINAL = [ "termite" ];
};
# 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;
services = {
#redshift = {
# enable = true;
# temperature.night = 2300;
# extraOptions = [ "-l 50.11552:8.68417" ];
#};
xserver = {
enable = true;
layout = "de";
xkbVariant = "nodeadkeys";
windowManager.i3 = {
enable = true;
package = pkgs.i3-gaps;
};
windowManager.default = "i3";
displayManager.lightdm.enable = true;
libinput.enable = true;
desktopManager.xterm.enable = false;
};
compton.enable = true;
timesyncd.servers = [ "0.nixos.pool.ntp.org" ];
};
programs = {
fish.enable = true;
bash.enableCompletion = true;
};
location = {
latitude = 50.11552;
longitude = 8.68417;
};
# bat state service
# started after xserver is initiated
systemd.user.services.batstate = {
description = "Handles redshift, but flashes the screen red, if the batery level jump below a specific level";
wantedBy = [ "graphical-session.target" ];
enable = true;
environment = { BAT_CRITICAL_LEVEL = "8"; BAT_ALARM_TEMP = "1800"; DISPLAY = ":0"; };
script = "/home/anton/.bin/bat-state";
path = with pkgs; [ fish redshift xorg.xrandr ];
};
systemd.user.services.flameshot = {
description = "Flameshot screenshot service";
wantedBy = [ "graphical-session.target" ];
enable = true;
script = "flameshot";
path = with pkgs; [ flameshot ];
};
# Docker
virtualisation.docker.enable = true;
5 years ago
# Open ports in the firewall.
networking.firewall.allowedTCPPortRanges = [ {from= 4000; to= 5000;} ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
networking.firewall.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.anton = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "power" "audio" "video" "plugdev" ];
uid = 1000;
createHome = true;
home = "/home/anton";
shell = pkgs.fish;
};
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
system.stateVersion = "19.09"; # Did you read the comment?
}