Initial configuration

This commit is contained in:
Chris Josten 2020-05-12 10:53:09 +02:00
commit 44b011a6b4
15 changed files with 328 additions and 0 deletions

8
common/console.nix Normal file
View file

@ -0,0 +1,8 @@
{ config, ... }:
{
imports = [
./pkgs/console-core.nix
];
nixpkgs.config.allowUnfree = true;
}

8
common/default.nix Normal file
View file

@ -0,0 +1,8 @@
{config, ...}:
{
imports = [
./console.nix
./users.nix
];
}

5
common/devel/default.nix Normal file
View file

@ -0,0 +1,5 @@
{config, ... }:
{
imports = [./pkgs.nix];
}

19
common/devel/pkgs.nix Normal file
View file

@ -0,0 +1,19 @@
{ pkgs, ...}:
{
environment = {
systemPackages = with pkgs; [
# General
git
# C/C++
gcc
cmake
qtcreator
# Java
gradle
jetbrains.idea-ultimate
maven
];
};
}

30
common/gui/default.nix Normal file
View file

@ -0,0 +1,30 @@
# Defines comfig for a "gui" system, in most cases a Desktop or Laptop
{ config, ... }:
{
imports = [ ./pkgs.nix ];
# Basic X11/display manager config
services.xserver = {
enable = true;
displayManager.sddm.enable = true;
desktopManager.plasma5.enable = true;
};
networking.networkmanager.enable = true;
sound.enable = true;
hardware.pulseaudio.enable = true;
# Additional services
services.syncthing.enable = true;
services.flatpak.enable = true;
xdg.portal.enable = true;
# Input config
services.xserver = {
synaptics.tapButtons = false;
libinput.enable = true;
};
}

35
common/gui/pkgs.nix Normal file
View file

@ -0,0 +1,35 @@
{ pkgs, ...}:
{
environment = {
systemPackages = with pkgs; [
# Internet
firefox
keepassxc
riot-desktop
syncthing
qsyncthingtray
# Wire(less) internet support
dnsmasq
hostapd
iw
plasma-nm
# KDE plasma and applications
kate
latte-dock # My PC has enough RAM by now
kleopatra
networkmanager
okular
plasma-desktop
plasma-integration
sddm
# To show of your distro
neofetch
# Communication
tdesktop
];
};
}

View file

@ -0,0 +1,8 @@
{config, ...}:
{
networking = {
# PiHole
networkmanager.insertNameservers = ["192.168.178.151"];
};
}

View file

@ -0,0 +1,11 @@
{ pkgs, ...}:
{
environment = {
systemPackages = with pkgs; [
neovim
tmux
vim
];
};
}

41
common/pkgs/gui.nix Normal file
View file

@ -0,0 +1,41 @@
{ pkgs, ...}:
{
environment = {
systemPackages = with pkgs; [
# Internet
firefox
keepassxc
riot-desktop
syncthing
qsyncthingtray
# Wire(less) internet support
dnsmasq
hostapd
iw
plasma-nm
# KDE plasma and applications
kate
latte-dock # My PC has enough RAM by now
kleopatra
networkmanager
okular
plasma-desktop
plasma-integration
sddm
# To show of your distro
neofetch
# Communication
tdesktop
];
};
#packageOverrides = pkgs: rec {
#latte-dock = pkgs.latte-dock.override (attrs: {
# src = fetc
#};
#}
}

1
common/pkgs/result Symbolic link
View file

@ -0,0 +1 @@
/nix/store/rq2fvc9n4n9qlmqq88maxaw8cr7cy12p-nixos-system-nix-te-vinden-20.03.1754.b0e3df2f843

15
common/users.nix Normal file
View file

@ -0,0 +1,15 @@
{ config, ... }:
{
# Define a user account. Don't forget to set a password with passwd.
# users.users.jane = {
# isNormalUser = true;
# extraGroups = [ "wheel" ]; # Enable sudo for the user.
# };
users.users.chris = {
isNormalUser = true;
home = "/home/chris";
description = "Chris Josten";
extraGroups = ["wheel" "networkmanager" "power"];
};
}

89
configuration.nix Normal file
View file

@ -0,0 +1,89 @@
# 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.
./common
./specific/laptop
];
# Use the grub EFI boot loader.
boot.loader = {
efi = {
canTouchEfiVariables = true;
};
grub = {
device = "nodev";
efiSupport = true;
};
systemd-boot.enable = false;
};
# networking.hostName = "nixos"; # Define your hostname.
# 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.enp0s31f6.useDHCP = true;
networking.interfaces.wlp1s0.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_GB.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# };
# Set your time zone.
time.timeZone = "Europe/Amsterdam";
# 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;
# pinentryFlavor = "gnome3";
# };
# 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;
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable the X11 windowing system.
# services.xserver.enable = true;
# services.xserver.layout = "us";
# services.xserver.xkbOptions = "eurosign:e";
# 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 = "20.03"; # Did you read the comment?
}

View file

@ -0,0 +1,13 @@
{config, ...}:
{
imports = [
../../common/gui
../../common/devel
../../common/networking-home
./fs.nix
./hardware-configuration.nix
];
networking.hostName = "nix-te-vinden";
}

15
specific/laptop/fs.nix Normal file
View file

@ -0,0 +1,15 @@
{ ... }: {
fileSystems = {
"/" = { label = "root"; };
"/boot" = { label = "BOOT"; };
"/home" = { label = "home"; };
};
boot.initrd.luks.devices = {
luks-system = {
device = "/dev/disk/by-uuid/b51ac469-a88d-4cc8-9b92-d0f0c8479eb2";
preLVM = true;
allowDiscards = true;
};
};
}

View file

@ -0,0 +1,30 @@
# 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, ... }:
{
imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/8c86ebcd-7bce-4cff-81fc-bd3059b8a1a9";
fsType = "ext4";
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/227fa1db-887e-4a3f-9b9d-59f425bfe880";
fsType = "ext4";
};
swapDevices = [ ];
nix.maxJobs = lib.mkDefault 8;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
}