Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Nix modular configuration
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
/etc/nixos/hardware-configuration.nix
];
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
networking.firewall = {
enable = true;
allowedUDPPorts = [ 61501 61502 61503 61504 ];
};
# Select internationalisation properties.
i18n = {
consoleFont = "lat9w-16";
consoleKeyMap = "de";
defaultLocale = "de_DE.UTF-8";
};
# List services that you want to enable:
services = {
# Enable the OpenSSH daemon.
openssh.enable = true;
# Enable CUPS to print documents.
# printing.enable = true;
# Enable the X11 windowing system.
xserver = {
enable = true;
layout = "de";
xkbOptions = "eurosign:e";
# Display manager configuration
displayManager.slim.enable = true;
# Enable the i3 window manager.
windowManager.i3.enable = true;
windowManager.default = "i3";
};
# Enable synergy!
synergy.client = {
enable = true;
autoStart = true;
screenName = "nox";
serverAddress = "192.168.200.86";
};
};
users.defaultUserShell = "/var/run/current-system/sw/bin/fish";
# Define a user account. Don't forget to set a password with ‘passwd’.
users.extraUsers.m = {
name = "m";
group = "users";
uid = 1000;
createHome = true;
home = "/home/m";
extraGroups = [ "wheel" "audio" "video" "power" ];
shell = "/var/run/current-system/sw/bin/fish";
openssh.authorizedKeys.keys = [ "<REMOVED>" ];
}
time.timeZone = "Europe/Berlin";
nixpkgs.config.packageOverrides = pkgs: {
packageSets = {
inherit (pkgs);
basePackageSet = {
inherit (pkgs)
acpid
acpitool
bashCompletion
coreutils
lsof
man
mosh
file
powertop
ruby
stdmanpages
tcpdump
tmux
nmap
# openvpn
unrar
vim
w3m
wget
which
zip
;
};
desktopPackageSet = {
inherit (pkgs)
dmenu # for i3
# docker
dwb
# easytag
feh
fish
gnupg
htop
imagemagick
mplayer
# mutt
chromiumWrapper
rxvt_unicode
scrot
unetbootin
vlc
# wireshark
xpdf
zathura
;
};
devPackageSet = {
inherit (pkgs)
vim
git
tig
;
};
};
};
}
{ config, pkgs, ... }:
let
configDir = /home/m/config/nixos;
packages = packageSets.basePackageSet // packageSets.desktopPackageSet // packageSets.devPackageSet;
in
{
imports = [
"${configDir}/base-configuration.nix"
];
# Define on which hard drive you want to install Grub.
boot.loader.grub.device = "/dev/sda";
# Additional FS
fileSystems."/home" = {
device = "/dev/sda6";
fsType = "ext4";
};
networking.hostName = "nox";
networking.wireless.enable = true;
nixpkgs.config = {
allowUnfree = true;
# Overrides for chromium, as stated in http://nixos.org/wiki/Enable_Browser_Plugins
chromium = {
enablePepperFlash = true; # Chromium removed support for Mozilla (NPAPI) plugins so Adobe Flash no longer works
enablePepperPDF = true;
};
};
environment.systemPackages = pkgs.lib.attrValues packages;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment