2023-04-03 22:41:22 +08:00
|
|
|
# This is your system's configuration file.
|
|
|
|
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
|
|
|
|
|
|
|
|
{ inputs, outputs, lib, config, pkgs, ... }: {
|
|
|
|
# You can import other NixOS modules here
|
|
|
|
imports = [
|
|
|
|
# If you want to use modules your own flake exports (from modules/nixos):
|
|
|
|
# outputs.nixosModules.example
|
|
|
|
|
|
|
|
# Or modules from other flakes (such as nixos-hardware):
|
|
|
|
# inputs.hardware.nixosModules.common-cpu-amd
|
|
|
|
# inputs.hardware.nixosModules.common-ssd
|
|
|
|
|
|
|
|
# You can also split up your configuration and import pieces of it here:
|
2023-05-04 16:34:27 +08:00
|
|
|
|
2023-07-01 21:46:27 +08:00
|
|
|
# Import common configurations
|
|
|
|
../common/system-tools.nix
|
|
|
|
|
2023-04-03 22:41:22 +08:00
|
|
|
# Import your generated (nixos-generate-config) hardware configuration
|
|
|
|
./hardware-configuration.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
nixpkgs = {
|
|
|
|
# You can add overlays here
|
|
|
|
overlays = [
|
|
|
|
# Add overlays your own flake exports (from overlays and pkgs dir):
|
|
|
|
outputs.overlays.additions
|
|
|
|
outputs.overlays.modifications
|
|
|
|
outputs.overlays.unstable-packages
|
|
|
|
|
|
|
|
# You can also add overlays exported from other flakes:
|
|
|
|
# neovim-nightly-overlay.overlays.default
|
|
|
|
|
|
|
|
# Or define it inline, for example:
|
|
|
|
# (final: prev: {
|
|
|
|
# hi = final.hello.overrideAttrs (oldAttrs: {
|
|
|
|
# patches = [ ./change-hello-to-hi.patch ];
|
|
|
|
# });
|
|
|
|
# })
|
|
|
|
];
|
|
|
|
# Configure your nixpkgs instance
|
|
|
|
config = {
|
|
|
|
# Disable if you don't want unfree packages
|
|
|
|
allowUnfree = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nix = {
|
2023-05-23 23:02:16 +08:00
|
|
|
gc = {
|
|
|
|
# Automatically run the garbage collector an a specified time.
|
|
|
|
automatic = true;
|
|
|
|
dates = "weekly";
|
|
|
|
options = "--delete-older-than 30d";
|
|
|
|
};
|
|
|
|
|
2023-04-03 22:41:22 +08:00
|
|
|
# This will add each flake input as a registry
|
2023-04-07 06:51:34 +08:00
|
|
|
# To make nix commands consistent with your flake
|
2023-04-03 22:41:22 +08:00
|
|
|
registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
|
|
|
|
|
|
|
|
# This will additionally add your inputs to the system's legacy channels
|
|
|
|
# Making legacy nix commands consistent as well, awesome!
|
|
|
|
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
# Enable flakes and new 'nix' command
|
|
|
|
experimental-features = "nix-command flakes";
|
|
|
|
# Deduplicate and optimize nix store
|
|
|
|
auto-optimise-store = true;
|
|
|
|
};
|
|
|
|
};
|
2023-04-07 06:51:34 +08:00
|
|
|
|
|
|
|
# Select internationalisation properties
|
|
|
|
i18n.defaultLocale = "en_AU.UTF-8";
|
|
|
|
# Set timezone
|
|
|
|
time.timeZone = "Australia/Perth";
|
|
|
|
|
|
|
|
boot = {
|
|
|
|
# Kernel to install
|
|
|
|
kernelPackages = pkgs.linuxPackages_latest;
|
|
|
|
# Autoload stage 2 modules
|
|
|
|
kernelModules = [ "i2c-dev" "i2c-piix4" ];
|
|
|
|
# Autoload stage 1 modules
|
|
|
|
initrd.kernelModules = [ "amdgpu" ];
|
|
|
|
|
|
|
|
loader = {
|
|
|
|
systemd-boot.enable = true;
|
|
|
|
|
|
|
|
efi = {
|
|
|
|
canTouchEfiVariables = true;
|
|
|
|
efiSysMountPoint = "/boot/efi";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
hardware = {
|
|
|
|
bluetooth.enable = true;
|
|
|
|
|
|
|
|
# Setup sound server (Audio Support)
|
|
|
|
pulseaudio = {
|
|
|
|
enable = true;
|
|
|
|
support32Bit = true; # If compatibility with 32-bit applications is desired.
|
|
|
|
};
|
|
|
|
|
|
|
|
# Configure OpenGL
|
|
|
|
opengl = {
|
|
|
|
enable = true;
|
|
|
|
# Vulkan
|
|
|
|
driSupport = true;
|
|
|
|
driSupport32Bit = true;
|
|
|
|
# OpenCL
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
rocm-opencl-icd
|
|
|
|
rocm-opencl-runtime
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
hostName = "fuchsia";
|
|
|
|
domain = "kanto.dev";
|
|
|
|
networkmanager.enable = true;
|
2023-05-25 00:54:04 +08:00
|
|
|
# firewall = {
|
|
|
|
# enable = true;
|
|
|
|
# allowedTCPPorts = [ ];
|
|
|
|
# allowedUDPPorts = [ ];
|
|
|
|
# };
|
2023-04-07 06:51:34 +08:00
|
|
|
};
|
2023-04-03 22:41:22 +08:00
|
|
|
|
2023-04-07 06:51:34 +08:00
|
|
|
fonts = {
|
|
|
|
# Install system fonts
|
|
|
|
fonts = with pkgs; [
|
|
|
|
fantasque-sans-mono
|
|
|
|
fira-code
|
|
|
|
ibm-plex
|
|
|
|
inconsolata
|
|
|
|
iosevka
|
|
|
|
jetbrains-mono
|
2023-04-28 19:14:12 +08:00
|
|
|
nerdfonts
|
2023-04-07 06:51:34 +08:00
|
|
|
];
|
|
|
|
};
|
2023-04-03 22:41:22 +08:00
|
|
|
|
2023-04-07 06:51:34 +08:00
|
|
|
# Setup environment
|
|
|
|
environment = {
|
|
|
|
# Symlink /bin/sh to POSIX-Complient shell
|
|
|
|
binsh = "${pkgs.bash}/bin/bash";
|
|
|
|
shells = with pkgs; [ zsh ];
|
2023-04-03 22:41:22 +08:00
|
|
|
|
2023-04-07 06:51:34 +08:00
|
|
|
# Install packages, prefix with 'unstable.' to use overlay
|
|
|
|
systemPackages = with pkgs; [
|
2023-07-21 07:06:10 +08:00
|
|
|
# Audio
|
|
|
|
pulsemixer
|
|
|
|
|
2023-04-07 06:51:34 +08:00
|
|
|
# Code editors
|
|
|
|
emacs vscode
|
|
|
|
|
|
|
|
# Browsers
|
|
|
|
firefox
|
|
|
|
|
|
|
|
# Graphics
|
|
|
|
gimp inkscape krita
|
|
|
|
|
|
|
|
# Modelling
|
2023-06-30 17:58:27 +08:00
|
|
|
blender freecad openscad cura
|
2023-04-07 06:51:34 +08:00
|
|
|
|
|
|
|
# Misc
|
2023-06-15 10:11:11 +08:00
|
|
|
openrgb protonup-ng
|
|
|
|
|
|
|
|
# Mouse
|
2023-07-01 21:46:27 +08:00
|
|
|
libratbag piper
|
2023-04-07 06:51:34 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
# Completions for system packages
|
|
|
|
pathsToLink = [ "/share/zsh" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
programs = {
|
|
|
|
zsh.enable = true;
|
|
|
|
|
|
|
|
# GPG and SSH support for yubikey
|
|
|
|
gnupg.agent = {
|
|
|
|
enable = true;
|
|
|
|
enableSSHSupport = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
steam = {
|
|
|
|
enable = true;
|
|
|
|
remotePlay.openFirewall = true; # Open ports in the firewall for steam Remote Play
|
|
|
|
dedicatedServer.openFirewall = true; # Open ports in the firewall for Dedicated Server
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services = {
|
|
|
|
udev.packages = with pkgs; [
|
|
|
|
yubikey-personalization
|
|
|
|
openrgb
|
|
|
|
qmk-udev-rules
|
|
|
|
];
|
|
|
|
|
|
|
|
xserver = {
|
|
|
|
enable = true;
|
|
|
|
layout = "au";
|
|
|
|
videoDrivers = [ "amdgpu" ];
|
2023-06-03 11:17:29 +08:00
|
|
|
libinput = {
|
|
|
|
enable = true;
|
|
|
|
mouse = {
|
|
|
|
# Disable mouse acceleration.
|
|
|
|
accelProfile = "flat";
|
|
|
|
};
|
|
|
|
};
|
2023-05-02 08:52:44 +08:00
|
|
|
displayManager.startx.enable = true;
|
2023-04-03 22:41:22 +08:00
|
|
|
};
|
2023-05-13 08:30:46 +08:00
|
|
|
|
|
|
|
ratbagd = {
|
|
|
|
enable = true;
|
|
|
|
};
|
2023-04-03 22:41:22 +08:00
|
|
|
};
|
|
|
|
|
2023-04-07 06:51:34 +08:00
|
|
|
# Install docker
|
|
|
|
virtualisation.docker = {
|
2023-04-03 22:41:22 +08:00
|
|
|
enable = true;
|
2023-04-07 06:51:34 +08:00
|
|
|
# Reduce container downtime due to daemon crashes
|
|
|
|
liveRestore = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Login and use sudo with our yubikey
|
|
|
|
security.pam.services = {
|
|
|
|
login.u2fAuth = true;
|
|
|
|
sudo.u2fAuth = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Users
|
|
|
|
users.users.sajenim = {
|
|
|
|
isNormalUser = true;
|
|
|
|
extraGroups = [ "audio" "docker" "networkmanager" "wheel" ];
|
|
|
|
shell = pkgs.zsh;
|
2023-04-03 22:41:22 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
|
|
|
system.stateVersion = "22.11";
|
|
|
|
}
|