2025-01-05 11:52:11 +08:00
|
|
|
|
# base.nix
|
|
|
|
|
# configuration for all my computers
|
|
|
|
|
|
2025-01-05 11:52:46 +08:00
|
|
|
|
{ pkgs, config, lib, ... }:
|
2024-11-10 15:47:39 +08:00
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
imports =
|
2025-01-05 11:49:14 +08:00
|
|
|
|
[
|
2025-01-05 07:59:40 +08:00
|
|
|
|
./gnome.nix
|
|
|
|
|
./systemd.nix
|
|
|
|
|
./fonts.nix
|
2025-01-16 05:47:58 +08:00
|
|
|
|
./intel-gpu.nix
|
2024-11-10 15:47:39 +08:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# Bootloader.
|
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
|
boot.loader.grub.configurationLimit = 10;
|
|
|
|
|
|
|
|
|
|
# Clear /tmp during boot
|
|
|
|
|
boot.tmp.cleanOnBoot = true;
|
|
|
|
|
|
|
|
|
|
# Housekeeping: Garbage collection
|
|
|
|
|
nix.optimise.automatic = true;
|
|
|
|
|
|
|
|
|
|
nix.gc = {
|
|
|
|
|
automatic = true;
|
|
|
|
|
dates = "daily";
|
|
|
|
|
options = "--delete-older-than 7d";
|
|
|
|
|
};
|
|
|
|
|
|
2025-01-25 15:50:09 +08:00
|
|
|
|
nix.settings.auto-optimise-store = true;
|
|
|
|
|
|
2024-12-14 08:59:59 +08:00
|
|
|
|
# increase buffer size
|
|
|
|
|
nix.settings.download-buffer-size = "2G";
|
|
|
|
|
|
2024-11-10 15:47:39 +08:00
|
|
|
|
# Enable networking
|
|
|
|
|
networking.networkmanager.enable = true;
|
|
|
|
|
|
|
|
|
|
# Disable sudo password for the wheel group
|
|
|
|
|
security.sudo.wheelNeedsPassword = false;
|
|
|
|
|
|
|
|
|
|
# Set your time zone.
|
|
|
|
|
time.timeZone = "Asia/Taipei";
|
|
|
|
|
|
|
|
|
|
# Select internationalisation properties.
|
|
|
|
|
i18n.defaultLocale = "en_US.UTF-8";
|
|
|
|
|
i18n.supportedLocales = [ "en_US.UTF-8/UTF-8" "zh_CN.UTF-8/UTF-8" "zh_TW.UTF-8/UTF-8" ];
|
|
|
|
|
|
|
|
|
|
i18n.extraLocaleSettings = {
|
|
|
|
|
LC_ADDRESS = "en_US.UTF-8";
|
|
|
|
|
LC_IDENTIFICATION = "en_US.UTF-8";
|
|
|
|
|
LC_MEASUREMENT = "en_US.UTF-8";
|
|
|
|
|
LC_MONETARY = "en_US.UTF-8";
|
|
|
|
|
LC_NAME = "en_US.UTF-8";
|
|
|
|
|
LC_NUMERIC = "en_US.UTF-8";
|
|
|
|
|
LC_PAPER = "en_US.UTF-8";
|
|
|
|
|
LC_TELEPHONE = "en_US.UTF-8";
|
|
|
|
|
LC_TIME = "en_US.UTF-8";
|
|
|
|
|
};
|
2024-12-14 17:00:20 +08:00
|
|
|
|
|
2025-01-12 21:00:40 +08:00
|
|
|
|
i18n.inputMethod = {
|
2025-01-19 14:18:16 +08:00
|
|
|
|
enable = true;
|
|
|
|
|
type = "fcitx5";
|
2025-01-19 13:41:59 +08:00
|
|
|
|
fcitx5.addons = with pkgs; [
|
2025-01-19 13:41:03 +08:00
|
|
|
|
fcitx5-chewing
|
|
|
|
|
fcitx5-chinese-addons
|
2025-01-19 14:09:14 +08:00
|
|
|
|
fcitx5-table-extra
|
2025-01-19 13:41:03 +08:00
|
|
|
|
];
|
|
|
|
|
};
|
2024-12-14 17:00:20 +08:00
|
|
|
|
|
2024-11-10 15:47:39 +08:00
|
|
|
|
# Enable the X11 windowing system.
|
|
|
|
|
services.xserver.enable = true;
|
|
|
|
|
|
|
|
|
|
# Enable the GNOME Desktop Environment.
|
|
|
|
|
services.xserver.displayManager.gdm.enable = true;
|
|
|
|
|
services.xserver.desktopManager.gnome.enable = true;
|
|
|
|
|
# remove xterm
|
|
|
|
|
services.xserver.excludePackages = [ pkgs.xterm ];
|
|
|
|
|
services.xserver.desktopManager.xterm.enable = false;
|
|
|
|
|
|
|
|
|
|
# Configure keymap in X11
|
|
|
|
|
services.xserver.xkb = {
|
|
|
|
|
layout = "us";
|
|
|
|
|
variant = "";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Enable CUPS to print documents.
|
|
|
|
|
services.printing.enable = false;
|
|
|
|
|
|
|
|
|
|
# Enable sound with pipewire.
|
|
|
|
|
security.rtkit.enable = true;
|
|
|
|
|
services.pipewire = {
|
|
|
|
|
enable = true;
|
|
|
|
|
alsa.enable = true;
|
|
|
|
|
alsa.support32Bit = true;
|
|
|
|
|
pulse.enable = true;
|
|
|
|
|
# If you want to use JACK applications, uncomment this
|
|
|
|
|
#jack.enable = true;
|
|
|
|
|
|
|
|
|
|
# use the example session manager (no others are packaged yet >
|
|
|
|
|
# no need to redefine it in your config for now)
|
|
|
|
|
#media-session.enable = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Enable automatic login for the user.
|
|
|
|
|
services.displayManager.autoLogin.enable = true;
|
|
|
|
|
services.displayManager.autoLogin.user = "elias";
|
|
|
|
|
|
|
|
|
|
# Workaround for GNOME autologin: https://github.com/NixOS/nixpk>
|
|
|
|
|
systemd.services."getty@tty1".enable = false;
|
|
|
|
|
systemd.services."autovt@tty1".enable = false;
|
|
|
|
|
|
|
|
|
|
# PROGRAMS
|
|
|
|
|
# ================
|
|
|
|
|
# Install Firefox.
|
|
|
|
|
programs.firefox.enable = true;
|
|
|
|
|
|
|
|
|
|
# Allow unfree packages
|
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
|
|
|
|
|
# List packages installed in system profile. To search, run:
|
|
|
|
|
# $ nix search wget
|
|
|
|
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
|
# vim # Do not forget to add an editor to edit configuration.ni>
|
2025-01-13 22:34:22 +08:00
|
|
|
|
# terminal apps
|
2024-11-10 15:47:39 +08:00
|
|
|
|
wget
|
|
|
|
|
curl
|
|
|
|
|
fastfetch
|
2025-01-13 18:24:40 +08:00
|
|
|
|
git
|
|
|
|
|
btop
|
|
|
|
|
htop
|
2025-01-25 14:57:19 +08:00
|
|
|
|
ptyxis # terminal app
|
|
|
|
|
tree
|
|
|
|
|
restic # backup program
|
2025-01-13 18:24:40 +08:00
|
|
|
|
|
|
|
|
|
# core apps
|
2025-01-25 14:57:19 +08:00
|
|
|
|
iotas # nextcloud compatible notes app
|
2024-11-10 15:47:39 +08:00
|
|
|
|
curl
|
2025-01-25 14:57:19 +08:00
|
|
|
|
keepassxc # password client
|
2024-11-10 15:47:39 +08:00
|
|
|
|
nextcloud-client
|
2025-01-25 14:57:19 +08:00
|
|
|
|
libreoffice-fresh # word docs
|
|
|
|
|
hunspell # dictionaries for libreoffice
|
2024-11-10 15:47:39 +08:00
|
|
|
|
hunspellDicts.en_CA
|
|
|
|
|
hunspellDicts.en_US
|
2025-01-25 14:57:19 +08:00
|
|
|
|
xreader # pdf viewer
|
2025-01-13 18:24:40 +08:00
|
|
|
|
|
2025-01-25 14:57:19 +08:00
|
|
|
|
# creative apps
|
2024-11-10 15:47:39 +08:00
|
|
|
|
kdePackages.kdenlive
|
|
|
|
|
audacity
|
2025-01-16 05:57:55 +08:00
|
|
|
|
gimp
|
2025-01-25 15:18:00 +08:00
|
|
|
|
pkgs.krita
|
2024-12-19 09:53:02 +08:00
|
|
|
|
element-desktop
|
2024-12-14 17:24:19 +08:00
|
|
|
|
|
2025-01-13 18:24:40 +08:00
|
|
|
|
#gaming
|
|
|
|
|
dosbox
|
|
|
|
|
|
2025-01-16 05:57:55 +08:00
|
|
|
|
#gpu tools
|
2025-01-16 06:08:34 +08:00
|
|
|
|
intel-gpu-tools
|
|
|
|
|
#nvtopPackages.full not working right now
|
2025-01-25 14:57:19 +08:00
|
|
|
|
|
|
|
|
|
# archive programs
|
|
|
|
|
zip
|
|
|
|
|
xz
|
|
|
|
|
unzip
|
|
|
|
|
p7zip
|
|
|
|
|
|
|
|
|
|
# utils
|
|
|
|
|
ripgrep # recursively searches directories for a regex >
|
|
|
|
|
#jq # A lightweight and flexible command-line JSON proc>
|
|
|
|
|
#yq-go # yaml processor https://github.com/mikefarah/yq
|
|
|
|
|
eza # A modern replacement for ‘ls’
|
|
|
|
|
#fzf # A command-line fuzzy finder
|
|
|
|
|
nnn # terminal file manager
|
|
|
|
|
|
|
|
|
|
# networking tools
|
|
|
|
|
mtr # A network diagnostic tool
|
|
|
|
|
iperf3
|
|
|
|
|
dnsutils # `dig` + `nslookup`
|
|
|
|
|
#ldns # replacement of `dig`, it provide the command `drill`
|
|
|
|
|
#aria2 # A lightweight multi-protocol & multi-source command-line download utility
|
|
|
|
|
#socat # replacement of openbsd-netcat
|
|
|
|
|
nmap # A utility for network discovery and security auditing
|
|
|
|
|
#ipcalc # it is a calculator for the IPv4/v6 addresses
|
|
|
|
|
|
|
|
|
|
# system tools
|
|
|
|
|
sysstat
|
|
|
|
|
lm_sensors # for `sensors` command
|
|
|
|
|
ethtool
|
|
|
|
|
pciutils # lspci
|
|
|
|
|
usbutils # lsusb
|
|
|
|
|
|
|
|
|
|
# system call monitoring
|
|
|
|
|
strace # system call monitoring
|
|
|
|
|
ltrace # library call monitoring
|
|
|
|
|
lsof # list open files
|
|
|
|
|
|
|
|
|
|
iotop # io monitoring
|
|
|
|
|
iftop # network monitoring
|
|
|
|
|
|
2024-11-10 15:47:39 +08:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# Services
|
|
|
|
|
# =========================
|
|
|
|
|
|
|
|
|
|
# Enable OpenSSH
|
|
|
|
|
services.openssh.enable = true;
|
|
|
|
|
|
|
|
|
|
# Enable Flatpak
|
|
|
|
|
services.flatpak.enable = true;
|
|
|
|
|
|
|
|
|
|
# Enable Tailscale
|
|
|
|
|
services.tailscale.enable = true;
|
|
|
|
|
|
2024-12-05 15:20:00 +08:00
|
|
|
|
# Enable Docker
|
2025-01-05 08:44:34 +08:00
|
|
|
|
#virtualisation.docker.enable = true;
|
2024-12-05 15:20:00 +08:00
|
|
|
|
|
2025-01-25 15:54:51 +08:00
|
|
|
|
# Enable Firmware Updater
|
2025-01-25 15:50:09 +08:00
|
|
|
|
services.fwupd.enable = true;
|
2025-01-25 15:54:51 +08:00
|
|
|
|
# fwupdmgr refresh
|
|
|
|
|
# fwupdmgr get-updates
|
|
|
|
|
|
2025-01-25 15:50:09 +08:00
|
|
|
|
|
2024-11-10 15:47:39 +08:00
|
|
|
|
}
|