Personal-NixOS-Configuration/global.nix

169 lines
4.7 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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, lib, inputs, ... }:
{
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# For USBIP Server configuration, to share USBKeys etc with my server (Which is the client)
boot.extraModulePackages = with config.boot.kernelPackages; [ usbip ];
boot.kernelModules = [ "usbip_host" ];
environment.systemPackages = with pkgs; [
inetutils
linuxPackages.usbip
];
# Set your time zone.
time.timeZone = "Europe/London";
# Select internationalisation properties.
i18n.defaultLocale = "en_GB.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_GB.UTF-8";
LC_IDENTIFICATION = "en_GB.UTF-8";
LC_MEASUREMENT = "en_GB.UTF-8";
LC_MONETARY = "en_GB.UTF-8";
LC_NAME = "en_GB.UTF-8";
LC_NUMERIC = "en_GB.UTF-8";
LC_PAPER = "en_GB.UTF-8";
LC_TELEPHONE = "en_GB.UTF-8";
LC_TIME = "en_GB.UTF-8";
};
# Configure keymap in X11
services.xserver.xkb = {
layout = "gb";
variant = "";
};
# Console (TTY) Configuration
console = {
# Configure console keymap
keyMap = "uk";
# Configure console colors (Gruvbox Light) - More colourschemes at https://github.com/kolunmi/ttyscheme/blob/main/ttyscheme
colors = [
"fbf1c7"
"cc241d"
"98971a"
"d79921"
"458588"
"b16286"
"689d6a"
"7c6f64"
"928374"
"9d0006"
"79740e"
"b57614"
"076678"
"8f3f71"
"427b58"
"3c3836"
];
};
fonts.packages = with pkgs; [
nerdfonts
];
# Define a user account. Don't forget to set a password with passwd.
users.users.cspark = {
isNormalUser = true;
description = "Curt Spark";
extraGroups = [ "networkmanager" "wheel" "libvirtd" "libvirt" "kvm" "input" ];
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# Due to NixOS not using FHS paths, many DAWs will not know where to look for VSTs and other plugins. You can solve this by setting
environment.variables = let
makePluginPath = format:
(lib.strings.makeSearchPath format [
"$HOME/.nix-profile/lib"
"/run/current-system/sw/lib"
"/etc/profiles/per-user/$USER/lib"
])
+ ":$HOME/.${format}";
in {
DSSI_PATH = makePluginPath "dssi";
LADSPA_PATH = makePluginPath "ladspa";
LV2_PATH = makePluginPath "lv2";
LXVST_PATH = makePluginPath "lxvst";
VST_PATH = makePluginPath "vst";
VST3_PATH = makePluginPath "vst3";
# Dotnet libicu not found fix
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT = "1";
};
# NixOS Dynamic Libraries Fix
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [
# Add any missing dynamic libraries for unpackaged programs
# here, NOT in environment.systemPackages
icu
];
# Systemwide Java support
programs.java = {
enable = true;
package = pkgs.jdk17;
};
# Emacs Config Init Service - For root user also
systemd.services.emacs-config-initialiser = {
description = "Initialises default emacs configuration if not available";
wantedBy = [ "multi-user.target" ];
path = with pkgs; [ coreutils git ];
enable = true;
serviceConfig = {
User = "root";
Group = "root";
};
script = "
if [[ ! -d $HOME/.emacs.d ]]; then
git clone https://git.cspark.dev/cspark/Emacs-Configuration $HOME/.emacs.d
else
exit 0
fi
";
};
# Virt Manager Installation
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
virtualisation.spiceUSBRedirection.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 = "23.11"; # Did you read the comment?
}