2021-10-28 22:15:24 +00:00
|
|
|
|
# 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’).
|
|
|
|
|
|
|
|
|
|
{ lib, config, pkgs, ... }:
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
imports =
|
2021-11-28 02:02:00 +00:00
|
|
|
|
[
|
|
|
|
|
# Include the results of the hardware scan.
|
2021-10-28 22:15:24 +00:00
|
|
|
|
./hardware-configuration.nix
|
|
|
|
|
# secret management
|
|
|
|
|
./secrets
|
2021-11-08 21:21:27 +00:00
|
|
|
|
# Fonts
|
|
|
|
|
../modules/personal/fonts
|
2022-05-02 18:09:17 +00:00
|
|
|
|
# Encrypted DNS
|
|
|
|
|
../modules/services/edns
|
2022-05-15 18:21:20 +00:00
|
|
|
|
# Other services
|
|
|
|
|
../modules/services/swaylock.nix
|
2022-05-15 18:46:17 +00:00
|
|
|
|
../modules/personal/u2f.nix
|
2021-10-28 22:15:24 +00:00
|
|
|
|
];
|
|
|
|
|
|
2022-03-14 17:34:32 +00:00
|
|
|
|
# Set kernel version to latest
|
|
|
|
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
2021-10-28 22:15:24 +00:00
|
|
|
|
# Use the systemd-boot EFI boot loader.
|
|
|
|
|
boot = {
|
2021-11-28 02:02:00 +00:00
|
|
|
|
plymouth.enable = true;
|
|
|
|
|
loader.timeout = 60;
|
|
|
|
|
loader.systemd-boot.enable = true;
|
|
|
|
|
loader.efi.canTouchEfiVariables = true;
|
|
|
|
|
supportedFilesystems = [ "ntfs" ];
|
2021-10-28 22:15:24 +00:00
|
|
|
|
};
|
|
|
|
|
## Encryption
|
|
|
|
|
# Kernel modules needed for mounting USB VFAT devices in initrd stage
|
|
|
|
|
boot.initrd.kernelModules = [ "usb_storage" ];
|
|
|
|
|
boot.initrd.luks.devices = {
|
2021-11-28 02:02:00 +00:00
|
|
|
|
root = {
|
|
|
|
|
keyFile = "/dev/disk/by-id/usb-090c___B1608112001295-0:0";
|
|
|
|
|
keyFileSize = 4096;
|
|
|
|
|
fallbackToPassword = true;
|
|
|
|
|
device = "/dev/disk/by-uuid/7c6e40a8-900b-4f85-9712-2b872caf1892";
|
|
|
|
|
preLVM = true;
|
|
|
|
|
allowDiscards = true;
|
|
|
|
|
};
|
2021-10-28 22:15:24 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
networking.hostName = "kagamiPC"; # Define your hostname.
|
|
|
|
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
|
|
|
|
|
|
|
|
|
# Set your time zone.
|
|
|
|
|
time.timeZone = "America/Toronto";
|
|
|
|
|
|
|
|
|
|
# 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.enp8s0.useDHCP = true;
|
2022-03-15 20:32:47 +00:00
|
|
|
|
# networking.interfaces.wlp7s0.useDHCP = true;
|
2021-10-28 22:15:24 +00:00
|
|
|
|
|
|
|
|
|
# Configure network proxy if necessary
|
|
|
|
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
|
|
|
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
|
|
|
|
|
|
|
|
|
nix = {
|
2022-05-02 18:09:17 +00:00
|
|
|
|
package = pkgs.nixFlakes;
|
2021-10-28 22:15:24 +00:00
|
|
|
|
extraOptions = ''
|
|
|
|
|
experimental-features = nix-command flakes
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
# Select internationalisation properties.
|
|
|
|
|
i18n.defaultLocale = "ja_JP.UTF-8";
|
|
|
|
|
i18n.inputMethod.enabled = "ibus";
|
2021-11-28 02:02:00 +00:00
|
|
|
|
i18n.inputMethod.ibus.engines = (with pkgs.ibus-engines; [ bamboo mozc libpinyin ]);
|
2021-10-28 22:15:24 +00:00
|
|
|
|
# console = {
|
|
|
|
|
# font = "Lat2-Terminus16";
|
|
|
|
|
# keyMap = "us";
|
|
|
|
|
# };
|
|
|
|
|
|
2022-05-03 14:30:53 +00:00
|
|
|
|
# Enable sway on login.
|
|
|
|
|
environment.loginShellInit = ''
|
|
|
|
|
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
|
|
|
|
|
exec sway
|
|
|
|
|
fi
|
|
|
|
|
'';
|
2021-10-28 22:15:24 +00:00
|
|
|
|
# Configure keymap in X11
|
2022-05-03 14:30:53 +00:00
|
|
|
|
# services.xserver.layout = "jp";
|
2021-10-28 22:15:24 +00:00
|
|
|
|
# services.xserver.xkbOptions = "";
|
|
|
|
|
|
|
|
|
|
# Enable CUPS to print documents.
|
|
|
|
|
# services.printing.enable = true;
|
|
|
|
|
|
|
|
|
|
# Enable sound.
|
|
|
|
|
sound.enable = true;
|
|
|
|
|
hardware.pulseaudio = {
|
|
|
|
|
enable = true;
|
|
|
|
|
extraModules = [ pkgs.pulseaudio-modules-bt ];
|
|
|
|
|
package = pkgs.pulseaudioFull;
|
|
|
|
|
};
|
|
|
|
|
# Enable touchpad support (enabled default in most desktopManager).
|
|
|
|
|
# services.xserver.libinput.enable = true;
|
|
|
|
|
|
2021-11-28 02:02:00 +00:00
|
|
|
|
# Enable razer daemon
|
|
|
|
|
hardware.openrazer.enable = true;
|
|
|
|
|
hardware.openrazer.keyStatistics = true;
|
2021-11-30 05:17:03 +00:00
|
|
|
|
hardware.openrazer.verboseLogging = true;
|
2021-11-28 02:02:00 +00:00
|
|
|
|
|
2021-10-28 22:15:24 +00:00
|
|
|
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
|
|
|
|
users.users.nki = {
|
|
|
|
|
isNormalUser = true;
|
2021-11-21 22:41:08 +00:00
|
|
|
|
uid = 1000;
|
2021-11-28 02:02:00 +00:00
|
|
|
|
extraGroups = [
|
|
|
|
|
"wheel" # Enable ‘sudo’ for the user.
|
|
|
|
|
"plugdev" # Enable openrazer-daemon privileges
|
|
|
|
|
];
|
2021-10-28 22:15:24 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Allow all packages
|
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
|
|
|
|
|
# List packages installed in system profile. To search, run:
|
|
|
|
|
# $ nix search wget
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
|
kakoune # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
|
|
|
|
wget
|
|
|
|
|
fish
|
|
|
|
|
firefox
|
|
|
|
|
|
|
|
|
|
## System monitoring tools
|
2021-11-30 05:17:03 +00:00
|
|
|
|
usbutils
|
|
|
|
|
pciutils
|
2021-10-28 22:15:24 +00:00
|
|
|
|
|
|
|
|
|
## Security stuff
|
2021-12-01 18:52:13 +00:00
|
|
|
|
libsForQt5.qtkeychain
|
2021-10-28 22:15:24 +00:00
|
|
|
|
|
2022-05-15 18:21:20 +00:00
|
|
|
|
## Wayland
|
|
|
|
|
qt5.qtwayland
|
|
|
|
|
|
2021-10-28 22:15:24 +00:00
|
|
|
|
## Enable nix-flakes
|
|
|
|
|
# (pkgs.writeShellScriptBin "nixFlakes" ''
|
|
|
|
|
# exec ${pkgs.nixUnstable}/bin/nix --experimental-features "nix-command flakes" "$@"
|
|
|
|
|
# '')
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# Nix config
|
|
|
|
|
nix.binaryCachePublicKeys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
|
|
|
|
|
nix.binaryCaches = [ "https://hydra.iohk.io" ];
|
|
|
|
|
|
2021-11-28 02:02:00 +00:00
|
|
|
|
|
2021-10-28 22:15:24 +00:00
|
|
|
|
# Terminal
|
|
|
|
|
programs.gnome-terminal.enable = true;
|
|
|
|
|
|
|
|
|
|
# Environment variables
|
|
|
|
|
environment.variables = {
|
2021-11-28 02:02:00 +00:00
|
|
|
|
# Input method overrides
|
|
|
|
|
GTK_IM_MODULE = "ibus";
|
|
|
|
|
QT_IM_MODULE = "ibus";
|
|
|
|
|
"XMODIFIERS=@im" = "ibus";
|
|
|
|
|
|
|
|
|
|
# Basic editor setup
|
|
|
|
|
EDITOR = "kak";
|
|
|
|
|
VISUAL = "kak";
|
2021-10-28 22:15:24 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Enable Desktop Environment.
|
|
|
|
|
services.xserver.displayManager = {
|
2022-05-03 14:30:53 +00:00
|
|
|
|
# lightdm.enable = true;
|
2021-10-28 22:15:24 +00:00
|
|
|
|
};
|
2022-05-03 14:30:53 +00:00
|
|
|
|
# services.xserver.desktopManager.cinnamon.enable = true;
|
2021-10-28 22:15:24 +00:00
|
|
|
|
|
|
|
|
|
# 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:
|
2022-05-02 18:09:17 +00:00
|
|
|
|
nki.services.edns.enable = true;
|
|
|
|
|
nki.services.edns.ipv6 = true;
|
2022-05-28 16:33:51 +00:00
|
|
|
|
services.flatpak.enable = true;
|
|
|
|
|
xdg.portal = {
|
|
|
|
|
enable = true;
|
|
|
|
|
wlr.enable = true;
|
|
|
|
|
};
|
2021-10-28 22:15:24 +00:00
|
|
|
|
|
|
|
|
|
# Enable the OpenSSH daemon.
|
|
|
|
|
services.openssh.enable = true;
|
|
|
|
|
|
|
|
|
|
# Open ports in the firewall.
|
2022-06-11 19:53:34 +00:00
|
|
|
|
networking.firewall.allowedTCPPorts = [ 22 4533 ];
|
2021-10-28 22:15:24 +00:00
|
|
|
|
networking.firewall.allowedUDPPorts = [ 22 ];
|
|
|
|
|
# Or disable the firewall altogether.
|
|
|
|
|
# networking.firewall.enable = false;
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
## Bluetooth
|
|
|
|
|
#
|
|
|
|
|
hardware.bluetooth.enable = true;
|
|
|
|
|
|
|
|
|
|
# Peripherals
|
|
|
|
|
hardware.opentabletdriver.enable = true;
|
|
|
|
|
|
2021-11-21 22:41:08 +00:00
|
|
|
|
# Mounting disks!
|
|
|
|
|
fileSystems =
|
2021-11-28 02:02:00 +00:00
|
|
|
|
let
|
|
|
|
|
ntfsMount = path: {
|
|
|
|
|
device = path;
|
|
|
|
|
fsType = "ntfs";
|
|
|
|
|
options = [ "rw" "uid=${toString config.users.users.nki.uid}" ];
|
|
|
|
|
};
|
|
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
"/mnt/Data" = ntfsMount "/dev/disk/by-uuid/A90680F8BBE62FE3";
|
2022-04-27 17:36:31 +00:00
|
|
|
|
"/mnt/Windows" = ntfsMount "/dev/disk/by-uuid/F4EA78DCEA789D14";
|
2021-11-28 02:02:00 +00:00
|
|
|
|
"/mnt/Stuff" = ntfsMount "/dev/disk/by-uuid/717BF2EE20BB8A62";
|
|
|
|
|
"/mnt/Shared" = ntfsMount "/dev/disk/by-uuid/76AC086BAC0827E7";
|
2021-11-21 22:41:08 +00:00
|
|
|
|
};
|
2021-10-28 22:15:24 +00:00
|
|
|
|
|
|
|
|
|
# PAM
|
|
|
|
|
security.pam.services.lightdm.enableKwallet = true;
|
|
|
|
|
security.pam.services.lightdm.enableGnomeKeyring = true;
|
2022-05-15 18:21:20 +00:00
|
|
|
|
services.swaylock.enable = true;
|
2022-05-15 18:46:17 +00:00
|
|
|
|
personal.u2f.enable = true;
|
2021-11-28 02:02:00 +00:00
|
|
|
|
|
2021-10-28 22:15:24 +00:00
|
|
|
|
|
|
|
|
|
# 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. It‘s 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 = "21.05"; # Did you read the comment?
|
|
|
|
|
|
|
|
|
|
# tinc network
|
2021-11-28 02:02:00 +00:00
|
|
|
|
sops.secrets."tinc/ed25519-private-key" = { };
|
|
|
|
|
sops.secrets."tinc/rsa-private-key" = { };
|
2021-10-28 22:15:24 +00:00
|
|
|
|
services.my-tinc = {
|
|
|
|
|
enable = true;
|
|
|
|
|
hostName = "home";
|
|
|
|
|
rsaPrivateKey = config.sops.secrets."tinc/rsa-private-key".path;
|
|
|
|
|
ed25519PrivateKey = config.sops.secrets."tinc/ed25519-private-key".path;
|
|
|
|
|
bindPort = 6565;
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-03 23:17:09 +00:00
|
|
|
|
# Gaming!
|
|
|
|
|
programs.steam.enable = true;
|
2021-12-09 20:54:26 +00:00
|
|
|
|
hardware.opengl.driSupport = true;
|
|
|
|
|
# For 32 bit applications
|
|
|
|
|
hardware.opengl.driSupport32Bit = true;
|
2022-06-11 19:53:34 +00:00
|
|
|
|
|
|
|
|
|
# Music server
|
|
|
|
|
services.navidrome.enable = true;
|
|
|
|
|
services.navidrome.settings = {
|
|
|
|
|
Address = "11.0.0.2";
|
|
|
|
|
MusicFolder = "/mnt/Stuff/Music";
|
|
|
|
|
};
|
|
|
|
|
systemd.services.navidrome.serviceConfig.BindReadOnlyPaths = lib.mkAfter [ "/etc" ];
|
2021-10-28 22:15:24 +00:00
|
|
|
|
}
|
|
|
|
|
|