• Updated input 'catppuccin': 'github:catppuccin/nix/1e4c3803b8da874ff75224ec8512cb173036bbd8?narHash=sha256-CFX4diEQHKvZYjnhf7TLg20m3ge1O4vqgplsk/Kuaek%3D' (2024-12-20) → 'github:catppuccin/nix/a2e641bc6b17129d81d54019e14c9956784c69c6?narHash=sha256-vU7SkHINr%2BNqmZeFLA11plsaUfazKKpdEhI/oTJbK3Q%3D' (2024-12-27) • Added input 'catppuccin/catppuccin-v1_1': 'https://api.flakehub.com/f/pinned/catppuccin/nix/1.1.1/0193bdc0-b045-7eed-bbec-95611a8ecdf5/source.tar.gz?narHash=sha256-pCWJgwo77KD7EJpwynwKrWPZ//dwypHq2TfdzZWqK68%3D' (2024-12-13) • Added input 'catppuccin/catppuccin-v1_2': 'https://api.flakehub.com/f/pinned/catppuccin/nix/1.2.0/0193e5e0-33b7-7149-a362-bfe56b20f64e/source.tar.gz?narHash=sha256-Let3uJo4YDyfqbqaw66dpZxhJB2TrDyZWSFd5rpPLJA%3D' (2024-12-20) • Added input 'catppuccin/home-manager': follows 'home-manager' • Added input 'catppuccin/home-manager-stable': 'github:nix-community/home-manager/80b0fdf483c5d1cb75aaad909bd390d48673857f?narHash=sha256-vykpJ1xsdkv0j8WOVXrRFHUAdp9NXHpxdnn1F4pYgSw%3D' (2024-12-16) • Added input 'catppuccin/home-manager-stable/nixpkgs': follows 'catppuccin/nixpkgs-stable' • Added input 'catppuccin/nixpkgs': follows 'nixpkgs' • Added input 'catppuccin/nixpkgs-stable': 'github:NixOS/nixpkgs/b47fd6fa00c6afca88b8ee46cfdb00e104f50bca?narHash=sha256-nbG9TijTMcfr%2Bau7ZVbKpAhMJzzE2nQBYmRvSdXUD8g%3D' (2024-12-19) • Added input 'catppuccin/nuscht-search': 'github:NuschtOS/search/3051be7f403bff1d1d380e4612f0c70675b44fc9?narHash=sha256-Y47y%2BLesOCkJaLvj%2BdI/Oa6FAKj/T9sKVKDXLNsViPw%3D' (2024-12-09) • Added input 'catppuccin/nuscht-search/flake-utils': 'github:numtide/flake-utils/11707dc2f618dd54ca8739b309ec4fc024de578b?narHash=sha256-l0KFg5HjrsfsO/JpG%2Br7fRrqm12kzFHyUHqHCVpMMbI%3D' (2024-11-13) • Added input 'catppuccin/nuscht-search/flake-utils/systems': 'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e?narHash=sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768%3D' (2023-04-09) • Added input 'catppuccin/nuscht-search/ixx': 'github:NuschtOS/ixx/9fd01aad037f345350eab2cd45e1946cc66da4eb?narHash=sha256-EiOq8jF4Z/zQe0QYVc3%2BqSKxRK//CFHMB84aYrYGwEs%3D' (2024-10-26) • Added input 'catppuccin/nuscht-search/ixx/flake-utils': follows 'catppuccin/nuscht-search/flake-utils' • Added input 'catppuccin/nuscht-search/ixx/nixpkgs': follows 'catppuccin/nuscht-search/nixpkgs' • Added input 'catppuccin/nuscht-search/nixpkgs': follows 'catppuccin/nixpkgs' • Updated input 'colmena': 'github:zhaofengli/colmena/e3ad42138015fcdf2524518dd564a13145c72ea1?narHash=sha256-dI9I6suECoIAmbS4xcrqF8r2pbmed8WWm5LIF1yWPw8%3D' (2024-11-13) → 'github:zhaofengli/colmena/a6b51f5feae9bfb145daa37fd0220595acb7871e?narHash=sha256-LLpiqfOGBippRax9F33kSJ/Imt8gJXb6o0JwSBiNHCk%3D' (2024-12-22) • Updated input 'disko': 'github:nix-community/disko/2ee76c861af3b895b3b104bae04777b61397485b?narHash=sha256-hk0roBX10j/hospoWIJIJj3i2skd7Oml6yKQBx7mTFk%3D' (2024-12-20) → 'github:nix-community/disko/3a4de9fa3a78ba7b7170dda6bd8b4cdab87c0b21?narHash=sha256-Tc35Y8H%2BkrA6rZeOIczsaGAtobSSBPqR32AfNTeHDRc%3D' (2024-12-24) • Updated input 'home-manager': 'github:nix-community/home-manager/1395379a7a36e40f2a76e7b9936cc52950baa1be?narHash=sha256-OOfI0XhSJGHblfdNDhfnn8QnZxng63rWk9eeJ2tCbiI%3D' (2024-12-19) → 'github:nix-community/home-manager/b7a7cd5dd1a74a9fe86ed4e016f91c78483b527a?narHash=sha256-p7IJP/97zJda/wwCn1T2LJBz4olF5LjNf4uwhuyvARo%3D' (2024-12-27) • Updated input 'nix-index-database': 'github:Mic92/nix-index-database/311d6cf3ad3f56cb051ffab1f480b2909b3f754d?narHash=sha256-icEMqBt4HtGH52PU5FHidgBrNJvOfXH6VQKNtnD1aw8%3D' (2024-12-15) → 'github:Mic92/nix-index-database/7e3246f6ad43b44bc1c16d580d7bf6467f971530?narHash=sha256-kWNi45/mRjQMG%2BUpaZQ7KyPavYrKfle3WgLn9YeBBVg%3D' (2024-12-26) • Updated input 'nix-vscode-extensions': 'github:nix-community/nix-vscode-extensions/113779a6601d5b5c8ef7c5b5c4ab3f377fd3e2c3?narHash=sha256-rTGDkcbzfcTL7jE4TtxhNQtDssD1QY8yLo8ApAv3XRs%3D' (2024-12-21) → 'github:nix-community/nix-vscode-extensions/57719f14beefb91c5b58da26bb9cffbdb4f70bfa?narHash=sha256-rNhcGVh6Xnc0DKWR5RTTD9OxucfAotd41LEuMCGz228%3D' (2024-12-28) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/b12e314726a4226298fe82776b4baeaa7bcf3dcd?narHash=sha256-mfv%2BJ/vO4nqmIOlq8Y1rRW8hVsGH3M%2BI2ESMjhuebDs%3D' (2024-12-16) → 'github:NixOS/nixos-hardware/def1d472c832d77885f174089b0d34854b007198?narHash=sha256-QIhd8/0x30gEv8XEE1iAnrdMlKuQ0EzthfDR7Hwl%2Bfk%3D' (2024-12-23) • Updated input 'nixpkgs-stable': 'github:nixos/nixpkgs/72d11d40b9878a67c38f003c240c2d2e1811e72a?narHash=sha256-ze3IJksru9dN0keqUxY0WNf8xrwfs8Ty/z9v/keyBbg%3D' (2024-12-18) → 'github:nixos/nixpkgs/31ac92f9628682b294026f0860e14587a09ffb4b?narHash=sha256-JMRV2RI58nV1UqLXqm%2Blcea1/dr92fYjWU5S%2BRz3fmE%3D' (2024-12-27) • Updated input 'nur': 'github:nix-community/NUR/db4e0d95cd1f9f77113cd9c3c9de5974fa721a98?narHash=sha256-ZRG0vNJHRyKnzyWOFciCzodQlv4Sb2%2BH5I7xKIH2EL0%3D' (2024-12-21) → 'github:nix-community/NUR/538f624930cdfb852e4e3dd055f79e932d5b3c16?narHash=sha256-B%2BPNIYtTmgnTV/wdA/qrYohmeBHaYrDwVAueODdvtlo%3D' (2024-12-27) • Updated input 'nur/nixpkgs': 'github:nixos/nixpkgs/d3c42f187194c26d9f0309a8ecc469d6c878ce33?narHash=sha256-cHar1vqHOOyC7f1%2BtVycPoWTfKIaqkoe1Q6TnKzuti4%3D' (2024-12-17) → 'github:nixos/nixpkgs/634fd46801442d760e09493a794c4f15db2d0cbb?narHash=sha256-NYVcA06%2BblsLG6wpAbSPTCyLvxD/92Hy4vlY9WxFI1M%3D' (2024-12-27)
424 lines
9 KiB
Nix
424 lines
9 KiB
Nix
{
|
||
config,
|
||
pkgs,
|
||
lib,
|
||
...
|
||
}:
|
||
let
|
||
inherit (lib) mkForce getExe;
|
||
in
|
||
{
|
||
imports = [
|
||
# Include the results of the hardware scan.
|
||
./hardware-configuration.nix
|
||
./network.nix
|
||
../sops.nix
|
||
];
|
||
|
||
commonSettings = {
|
||
# auth.enable = true;
|
||
nix = {
|
||
signing.enable = true;
|
||
};
|
||
comin.enable = true;
|
||
};
|
||
|
||
# Bootloader.
|
||
boot.loader.systemd-boot.enable = true;
|
||
boot.loader.efi.canTouchEfiVariables = true;
|
||
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
||
# boot.kernelPackages = pkgs.linuxPackages_latest;
|
||
boot.kernelModules = [
|
||
"nvidia"
|
||
"nvidia_modeset"
|
||
"nvidia_uvm"
|
||
];
|
||
boot.supportedFilesystems = [ "ntfs" ];
|
||
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||
|
||
documentation = {
|
||
nixos.enable = false;
|
||
man.enable = false;
|
||
};
|
||
|
||
security.tpm2 = {
|
||
enable = true;
|
||
# expose /run/current-system/sw/lib/libtpm2_pkcs11.so
|
||
pkcs11.enable = true;
|
||
# TODO: Need this until fapi-config is fixed in NixOS
|
||
pkcs11.package = pkgs.tpm2-pkcs11.override { fapiSupport = false; };
|
||
# TPM2TOOLS_TCTI and TPM2_PKCS11_TCTI env variables
|
||
tctiEnvironment.enable = true;
|
||
};
|
||
# services.gnome.gnome-keyring.enable = lib.mkForce false;
|
||
security.pam.services.login.enableGnomeKeyring = lib.mkForce false;
|
||
|
||
programs.ssh.agentPKCS11Whitelist = "${config.security.tpm2.pkcs11.package}/lib/libtpm_pkcs11.so";
|
||
|
||
networking.hostName = "calcite";
|
||
|
||
services.blueman.enable = true;
|
||
|
||
programs.steam = {
|
||
enable = true;
|
||
gamescopeSession = {
|
||
enable = true;
|
||
};
|
||
};
|
||
|
||
programs.vim.enable = true;
|
||
programs.vim.defaultEditor = true;
|
||
|
||
# Keep this even if enabled in home manager
|
||
programs.fish.enable = true;
|
||
environment.shells = [ pkgs.fish ];
|
||
users.defaultUserShell = pkgs.fish;
|
||
|
||
# Setup wireguard
|
||
# Set your time zone.
|
||
time.timeZone = "Asia/Shanghai";
|
||
|
||
# Select internationalisation properties.
|
||
i18n.defaultLocale = "en_US.utf8";
|
||
|
||
i18n.extraLocaleSettings = {
|
||
LC_ADDRESS = "zh_CN.utf8";
|
||
LC_IDENTIFICATION = "zh_CN.utf8";
|
||
LC_MEASUREMENT = "zh_CN.utf8";
|
||
LC_MONETARY = "zh_CN.utf8";
|
||
LC_NAME = "zh_CN.utf8";
|
||
LC_NUMERIC = "zh_CN.utf8";
|
||
LC_PAPER = "zh_CN.utf8";
|
||
LC_TELEPHONE = "zh_CN.utf8";
|
||
LC_TIME = "en_US.utf8";
|
||
};
|
||
|
||
i18n.inputMethod = {
|
||
enable = true;
|
||
type = "fcitx5";
|
||
fcitx5 = {
|
||
addons = [ pkgs.fcitx5-rime ];
|
||
waylandFrontend = true;
|
||
};
|
||
};
|
||
|
||
# ====== GUI ======
|
||
|
||
programs.niri.enable = true;
|
||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||
security.pam.services.gtklock = { }; # Required by gtklock
|
||
|
||
catppuccin = {
|
||
enable = true;
|
||
accent = "peach";
|
||
flavor = "mocha";
|
||
};
|
||
|
||
xdg.portal = {
|
||
enable = true;
|
||
extraPortals = [
|
||
pkgs.xdg-desktop-portal-gnome
|
||
pkgs.xdg-desktop-portal-gtk
|
||
];
|
||
configPackages = [ pkgs.niri ];
|
||
};
|
||
|
||
systemd.user.services.xdg-desktop-portal-gtk.after = [ "graphical-session.target" ];
|
||
systemd.user.services.xdg-desktop-portal-gnome.after = [ "graphical-session.target" ];
|
||
systemd.user.services.xdg-desktop-portal-gnome.wantedBy = [ "graphical-session.target" ];
|
||
|
||
services.greetd =
|
||
let
|
||
niri-login-config = pkgs.writeText "niri-login-config.kdl" ''
|
||
animations {
|
||
off
|
||
}
|
||
hotkey-overlay {
|
||
skip-at-startup
|
||
}
|
||
'';
|
||
in
|
||
{
|
||
enable = true;
|
||
vt = 1;
|
||
settings = {
|
||
default_session = {
|
||
command = "${pkgs.dbus}/bin/dbus-run-session -- ${getExe pkgs.niri} -c ${niri-login-config} -- ${getExe pkgs.greetd.gtkgreet} -l -c niri-session -s ${pkgs.magnetic-catppuccin-gtk}/share/themes/Catppuccin-GTK-Dark/gtk-3.0/gtk.css";
|
||
};
|
||
};
|
||
};
|
||
|
||
# Keyboard mapping on internal keyboard
|
||
services.keyd = {
|
||
enable = true;
|
||
keyboards = {
|
||
defualt = {
|
||
id = [ "*" ];
|
||
capslock = "overload(control, esc)";
|
||
};
|
||
"internal" = {
|
||
ids = [ "0b05:1866" ];
|
||
settings = {
|
||
main = {
|
||
leftcontrol = "capslock";
|
||
};
|
||
};
|
||
};
|
||
"logiM720" = {
|
||
ids = [ "046d:b015" ];
|
||
settings = {
|
||
main = {
|
||
mouse2 = "leftmeta";
|
||
# leftalt = "mouse1";
|
||
};
|
||
};
|
||
};
|
||
};
|
||
};
|
||
|
||
# Enable CUPS to print documents.
|
||
services.printing.enable = true;
|
||
services.printing.drivers = [
|
||
pkgs.hplip
|
||
pkgs.gutenprintBin
|
||
pkgs.canon-cups-ufr2
|
||
];
|
||
|
||
hardware.pulseaudio.enable = false;
|
||
security.rtkit.enable = true;
|
||
services.pipewire = {
|
||
enable = true;
|
||
wireplumber.enable = true;
|
||
alsa.enable = true;
|
||
alsa.support32Bit = true;
|
||
pulse.enable = true;
|
||
# If you want to use JACK applications, uncomment this
|
||
jack.enable = true;
|
||
};
|
||
|
||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||
users.users.xin = {
|
||
isNormalUser = true;
|
||
description = "xin";
|
||
extraGroups = [
|
||
"networkmanager"
|
||
"wheel"
|
||
"wireshark"
|
||
"tss"
|
||
];
|
||
};
|
||
|
||
services.kanidm = {
|
||
enableClient = true;
|
||
clientSettings = {
|
||
uri = "https://auth.xinyang.life";
|
||
};
|
||
};
|
||
|
||
# Smart services
|
||
services.smartd.enable = true;
|
||
|
||
# Allow unfree packages
|
||
nixpkgs.system = "x86_64-linux";
|
||
nixpkgs.config.allowUnfree = true;
|
||
nixpkgs.config.permittedInsecurePackages = [
|
||
"openssl-1.1.1w"
|
||
# FIXME: Waiting for https://github.com/NixOS/nixpkgs/pull/335753
|
||
"jitsi-meet-1.0.8043"
|
||
];
|
||
# List packages installed in system profile. To search, run:
|
||
# $ nix search wget
|
||
environment.systemPackages = with pkgs; [
|
||
imhex
|
||
oidc-agent
|
||
# Filesystem
|
||
(owncloud-client.overrideAttrs (
|
||
finalAttrs: previousAttrs: {
|
||
src = pkgs.fetchFromGitHub {
|
||
owner = "xinyangli";
|
||
repo = "client";
|
||
rev = "780d1c4c8bf02be42e118c792ff833ab10c2fdcc";
|
||
hash = "sha256-pEwcGJI9sN9nooW/RQHmi52Du6yzofgZeB8PcjwPtZ8=";
|
||
};
|
||
}
|
||
))
|
||
nfs-utils
|
||
|
||
# tesseract5 # ocr
|
||
ocrmypdf # pdfocr
|
||
|
||
gtkwave
|
||
bubblewrap
|
||
|
||
# ==== Development ==== #
|
||
# Python
|
||
# reference: https://nixos.wiki/wiki/Python
|
||
(
|
||
let
|
||
my-python-packages =
|
||
python-packages: with python-packages; [
|
||
pandas
|
||
requests
|
||
numpy
|
||
pyyaml
|
||
setuptools
|
||
];
|
||
python-with-my-packages = python3.withPackages my-python-packages;
|
||
in
|
||
python-with-my-packages
|
||
)
|
||
|
||
# ==== GUI Softwares ==== #
|
||
|
||
eudic
|
||
|
||
bibata-cursors
|
||
gthumb
|
||
oculante
|
||
|
||
# Multimedia
|
||
vlc
|
||
obs-studio
|
||
spotify
|
||
# IM
|
||
element-desktop
|
||
tdesktop
|
||
|
||
# Password manager
|
||
bitwarden
|
||
|
||
# Browser
|
||
chromium
|
||
|
||
# Writting
|
||
zotero
|
||
# onlyoffice-bin
|
||
|
||
# wemeet
|
||
wemeet
|
||
|
||
virt-manager
|
||
wineWowPackages.waylandFull
|
||
winetricks
|
||
];
|
||
|
||
services.esphome.enable = true;
|
||
users.groups.dialout.members = [ "xin" ];
|
||
|
||
system.stateVersion = "22.05";
|
||
|
||
system.switch.enable = false;
|
||
system.switch.enableNg = true;
|
||
|
||
sops.secrets = {
|
||
"restic/repo_url" = {
|
||
owner = "xin";
|
||
sopsFile = ./secrets.yaml;
|
||
};
|
||
"restic/repo_password" = {
|
||
owner = "xin";
|
||
sopsFile = ./secrets.yaml;
|
||
};
|
||
"gitea/envfile" = {
|
||
owner = "root";
|
||
sopsFile = ./secrets.yaml;
|
||
};
|
||
};
|
||
|
||
custom.restic = {
|
||
enable = true;
|
||
paths = [
|
||
"/backup/rootfs/var/lib"
|
||
"/backup/home"
|
||
];
|
||
};
|
||
|
||
# custom.forgejo-actions-runner = {
|
||
# enable = false;
|
||
# tokenFile = config.sops.secrets."gitea/envfile".path;
|
||
# settings = {
|
||
# runner.capacity = 2;
|
||
# runner.fetch_timeout = "120s";
|
||
# runner.fetch_interval = "30s";
|
||
# };
|
||
# };
|
||
#
|
||
custom.prometheus = {
|
||
exporters.node.enable = true;
|
||
};
|
||
|
||
services.ollama = {
|
||
enable = true;
|
||
acceleration = "cuda";
|
||
};
|
||
|
||
# MTP support
|
||
services.gvfs.enable = true;
|
||
|
||
services.flatpak.enable = true;
|
||
|
||
# Fonts
|
||
fonts = {
|
||
packages = with pkgs; [
|
||
nerd-fonts.ubuntu-sans
|
||
nerd-fonts.ubuntu
|
||
nerd-fonts.fira-code
|
||
nerd-fonts.fira-mono
|
||
nerd-fonts.jetbrains-mono
|
||
nerd-fonts.roboto-mono
|
||
noto-fonts
|
||
noto-fonts-emoji
|
||
liberation_ttf
|
||
mplus-outline-fonts.githubRelease
|
||
dina-font
|
||
proggyfonts
|
||
ubuntu_font_family
|
||
# Chinese
|
||
wqy_microhei
|
||
wqy_zenhei
|
||
noto-fonts-cjk-sans
|
||
noto-fonts-cjk-serif
|
||
source-han-sans
|
||
source-han-serif
|
||
];
|
||
fontconfig = {
|
||
defaultFonts = {
|
||
serif = [
|
||
"Source Han Serif SC"
|
||
"Ubuntu"
|
||
];
|
||
sansSerif = [
|
||
"Source Han Sans SC"
|
||
"Ubuntu"
|
||
];
|
||
monospace = [
|
||
"JetbrainsMono Nerd Font"
|
||
"Noto Sans Mono CJK SC"
|
||
"Ubuntu"
|
||
];
|
||
};
|
||
};
|
||
enableDefaultPackages = true;
|
||
};
|
||
# Virtualization
|
||
virtualisation = {
|
||
libvirtd.enable = true;
|
||
podman = {
|
||
enable = true;
|
||
};
|
||
docker = {
|
||
enable = true;
|
||
autoPrune.enable = true;
|
||
};
|
||
};
|
||
|
||
services.nixseparatedebuginfod.enable = true;
|
||
services.bloop = {
|
||
install = true;
|
||
extraOptions = [
|
||
"-J-Xmx2G"
|
||
"-J-XX:MaxInlineLevel=20"
|
||
"-J-XX:+UseParallelGC"
|
||
];
|
||
};
|
||
}
|