2023-01-15 18:56:16 +01:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
let
|
|
|
|
impermanence = builtins.fetchTarball "https://github.com/nix-community/impermanence/archive/master.tar.gz";
|
|
|
|
home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
#
|
|
|
|
# stuff shared between home machines
|
|
|
|
#
|
|
|
|
|
|
|
|
# get impermanence & home manager working
|
|
|
|
imports = [
|
|
|
|
# manage persistent files
|
|
|
|
"${impermanence}/nixos.nix"
|
|
|
|
|
|
|
|
# home manager for per user config
|
|
|
|
"${home-manager}/nixos"
|
|
|
|
];
|
|
|
|
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
# settings for stateful data, like file locations and database versions
|
2023-06-09 18:26:35 +02:00
|
|
|
# on your system were taken. It's perfectly fine and recommended to leave
|
2023-01-15 18:56:16 +01:00
|
|
|
# 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).
|
2023-06-09 18:26:35 +02:00
|
|
|
system.stateVersion = "23.05"; # Did you read the comment?
|
|
|
|
|
2024-05-29 21:07:09 +02:00
|
|
|
# use the latest kernel with ZFS support and enable that file system
|
|
|
|
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
|
|
|
|
boot.supportedFilesystems = [ "zfs" ];
|
2023-01-15 18:56:16 +01:00
|
|
|
|
2024-06-03 23:29:17 +02:00
|
|
|
# no hibernate for ZFS systems
|
2024-06-03 22:29:25 +02:00
|
|
|
# don't check for split locks, for KVM and Co.
|
2024-06-03 23:29:17 +02:00
|
|
|
boot.kernelParams = [ "nohibernate" "split_lock_detect=off" ];
|
2024-06-03 22:29:25 +02:00
|
|
|
|
|
|
|
# tweak ZFS
|
|
|
|
boot.extraModprobeConfig = ''
|
|
|
|
options zfs zfs_prefetch_disable=1
|
|
|
|
options zfs zfs_arc_max=4294967296
|
|
|
|
options zfs zfs_arc_min=134217728
|
|
|
|
options zfs zfs_arc_meta_limit_percent=75
|
|
|
|
'';
|
|
|
|
|
2023-01-15 18:56:16 +01:00
|
|
|
# Use the systemd-boot EFI boot loader.
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
|
2023-06-02 23:53:02 +02:00
|
|
|
# use a high resolution
|
|
|
|
boot.loader.systemd-boot.consoleMode = "max";
|
|
|
|
|
2023-07-28 16:37:12 +02:00
|
|
|
# we want to be able to do a memtest
|
|
|
|
boot.loader.systemd-boot.memtest86.enable = true;
|
|
|
|
|
2024-05-29 21:07:09 +02:00
|
|
|
# use systemd early
|
|
|
|
boot.initrd.systemd.enable = true;
|
|
|
|
|
2023-06-02 23:53:02 +02:00
|
|
|
# setup the console stuff early
|
|
|
|
console.earlySetup = true;
|
|
|
|
|
2023-10-24 20:17:19 +02:00
|
|
|
# swap to RAM
|
|
|
|
zramSwap.enable = true;
|
|
|
|
|
2024-05-29 21:07:09 +02:00
|
|
|
# root file system in RAM
|
2024-03-27 19:49:42 +01:00
|
|
|
fileSystems."/" =
|
2024-05-29 21:07:09 +02:00
|
|
|
{ device = "none";
|
|
|
|
fsType = "tmpfs";
|
2024-03-27 19:49:42 +01:00
|
|
|
neededForBoot = true;
|
2024-05-29 21:07:09 +02:00
|
|
|
options = [ "defaults" "size=8G" "mode=755" ];
|
2024-03-27 19:49:42 +01:00
|
|
|
};
|
|
|
|
|
2024-05-29 22:34:18 +02:00
|
|
|
# nix store file system from encrypted ZFS
|
2024-03-27 19:49:42 +01:00
|
|
|
fileSystems."/nix" =
|
2024-05-29 22:34:18 +02:00
|
|
|
{ device = "zpool/nix";
|
|
|
|
fsType = "zfs";
|
2024-03-27 19:49:42 +01:00
|
|
|
neededForBoot = true;
|
|
|
|
};
|
|
|
|
|
2024-05-29 22:34:18 +02:00
|
|
|
# data store file system from encrypted ZFS
|
2024-03-27 19:49:42 +01:00
|
|
|
fileSystems."/data" =
|
2024-05-29 22:34:18 +02:00
|
|
|
{ device = "zpool/data";
|
|
|
|
fsType = "zfs";
|
2024-03-27 19:49:42 +01:00
|
|
|
neededForBoot = true;
|
|
|
|
};
|
|
|
|
|
2024-05-29 22:34:18 +02:00
|
|
|
# bind mount to have user homes
|
2024-03-27 19:49:42 +01:00
|
|
|
fileSystems."/home" =
|
|
|
|
{ device = "/data/home";
|
|
|
|
fsType = "none";
|
|
|
|
neededForBoot = true;
|
2024-05-31 21:05:43 +02:00
|
|
|
options = [ "bind" "x-gvfs-hide" ];
|
2024-03-27 19:49:42 +01:00
|
|
|
depends = [ "/data" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
# bind mount to have root home
|
|
|
|
fileSystems."/root" =
|
|
|
|
{ device = "/data/root";
|
|
|
|
fsType = "none";
|
|
|
|
neededForBoot = true;
|
2024-05-31 21:05:43 +02:00
|
|
|
options = [ "bind" "x-gvfs-hide" ];
|
2024-03-27 19:49:42 +01:00
|
|
|
depends = [ "/data" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
# bind mount to have NixOS configuration, different per host
|
|
|
|
fileSystems."/etc/nixos" =
|
|
|
|
{ device = "/data/nixos/${config.networking.hostName}";
|
|
|
|
fsType = "none";
|
|
|
|
neededForBoot = true;
|
2024-05-31 21:05:43 +02:00
|
|
|
options = [ "bind" "x-gvfs-hide" ];
|
2024-03-27 19:49:42 +01:00
|
|
|
depends = [ "/data" ];
|
|
|
|
};
|
|
|
|
|
2024-05-30 17:42:54 +02:00
|
|
|
# keep some stuff persistent
|
|
|
|
environment.persistence."/nix/persistent" = {
|
|
|
|
hideMounts = true;
|
|
|
|
directories = [
|
|
|
|
# systemd timers
|
|
|
|
{ directory = "/var/lib/systemd/timers"; user = "root"; group = "root"; mode = "u=rwx,g=rx,o=rx"; }
|
|
|
|
|
|
|
|
# alsa state for persistent sound settings
|
|
|
|
{ directory = "/var/lib/alsa"; user = "root"; group = "root"; mode = "u=rwx,g=rx,o=rx"; }
|
2024-05-31 21:05:43 +02:00
|
|
|
|
|
|
|
# nix tmp dir for rebuilds, don't fill our tmpfs root with that
|
|
|
|
{ directory = "/var/cache/nix"; user = "root"; group = "root"; mode = "u=rwx,g=rx,o=rx"; }
|
2024-05-30 17:42:54 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-05-31 17:43:39 +02:00
|
|
|
# ZFS services
|
|
|
|
services.zfs.autoScrub.enable = true;
|
|
|
|
services.zfs.trim.enable = true;
|
|
|
|
|
2024-01-10 17:58:07 +01:00
|
|
|
# enable fast dbus
|
|
|
|
services.dbus.implementation = "broker";
|
|
|
|
|
2023-01-15 22:48:29 +01:00
|
|
|
# allow all firmware
|
|
|
|
hardware.enableAllFirmware = true;
|
|
|
|
|
2023-02-04 16:31:22 +01:00
|
|
|
# ensure firewall is up, allow ssh and http in
|
2023-01-15 22:48:29 +01:00
|
|
|
networking.firewall.enable = true;
|
2023-06-10 17:42:28 +02:00
|
|
|
networking.firewall.allowedTCPPorts = [ 22 ];
|
2023-06-09 18:26:35 +02:00
|
|
|
networking.firewall.logRefusedConnections = false;
|
2023-01-15 18:56:16 +01:00
|
|
|
|
2023-06-09 18:26:35 +02:00
|
|
|
# OpenSSH daemon config
|
|
|
|
services.openssh = {
|
2024-04-03 23:42:36 +02:00
|
|
|
# enable with public key only auth, start on demand only
|
2023-05-02 19:32:11 +02:00
|
|
|
enable = true;
|
2024-04-03 23:42:36 +02:00
|
|
|
startWhenNeeded = true;
|
2024-01-11 23:45:38 +01:00
|
|
|
settings.PasswordAuthentication = false;
|
|
|
|
settings.KbdInteractiveAuthentication = false;
|
2023-06-09 18:26:35 +02:00
|
|
|
|
|
|
|
# only ed25519 keys, make them persistent
|
|
|
|
hostKeys = [{
|
|
|
|
path = "/nix/persistent/ssh_host_ed25519_key";
|
|
|
|
type = "ed25519";
|
2023-12-29 12:08:59 +01:00
|
|
|
}];
|
2023-12-29 12:08:50 +01:00
|
|
|
|
|
|
|
# only safe ciphers & Co.
|
|
|
|
settings.Ciphers = [ "aes256-gcm@openssh.com" ];
|
|
|
|
settings.KexAlgorithms = [ "sntrup761x25519-sha512@openssh.com" ];
|
|
|
|
settings.Macs = [ "hmac-sha2-512-etm@openssh.com" ];
|
2023-05-02 19:32:11 +02:00
|
|
|
};
|
|
|
|
|
2023-01-15 18:56:16 +01:00
|
|
|
# Set your time zone.
|
|
|
|
time.timeZone = "Europe/Berlin";
|
|
|
|
|
|
|
|
# default locale is English US
|
|
|
|
i18n.defaultLocale = "en_US.UTF-8";
|
|
|
|
|
|
|
|
# use German stuff for sorting/date/....
|
|
|
|
i18n.extraLocaleSettings = {
|
|
|
|
LC_ADDRESS = "de_DE.UTF-8";
|
|
|
|
LC_IDENTIFICATION = "de_DE.UTF-8";
|
|
|
|
LC_MEASUREMENT = "de_DE.UTF-8";
|
|
|
|
LC_MONETARY = "de_DE.UTF-8";
|
|
|
|
LC_NAME = "de_DE.UTF-8";
|
|
|
|
LC_NUMERIC = "de_DE.UTF-8";
|
|
|
|
LC_PAPER = "de_DE.UTF-8";
|
|
|
|
LC_TELEPHONE = "de_DE.UTF-8";
|
|
|
|
LC_TIME = "de_DE.UTF-8";
|
|
|
|
};
|
|
|
|
|
2023-09-02 17:06:15 +02:00
|
|
|
# allow to have all locales
|
|
|
|
i18n.supportedLocales = [ "all" ];
|
|
|
|
|
2023-10-21 21:31:26 +02:00
|
|
|
# EurKey layout everywhere
|
2024-02-05 20:34:37 +01:00
|
|
|
services.xserver.xkb.layout = "eu";
|
2023-10-21 21:31:26 +02:00
|
|
|
console.useXkbConfig = true;
|
2023-01-15 18:56:16 +01:00
|
|
|
|
2024-04-12 20:37:53 +02:00
|
|
|
# enable SDDM & the KDE Plasma Desktop Environment
|
2024-05-09 10:24:36 +02:00
|
|
|
services.xserver.enable = true;
|
2024-04-12 20:37:53 +02:00
|
|
|
services.displayManager.sddm.enable = true;
|
2024-03-27 07:40:25 +01:00
|
|
|
services.desktopManager.plasma6.enable = true;
|
2024-05-09 10:24:36 +02:00
|
|
|
programs.ssh.askPassword = pkgs.lib.mkForce "${pkgs.ksshaskpass.out}/bin/ksshaskpass";
|
|
|
|
|
|
|
|
# other desktop environments for testing
|
|
|
|
services.xserver.desktopManager.enlightenment.enable = true;
|
|
|
|
services.xserver.desktopManager.gnome.enable = true;
|
|
|
|
services.xserver.desktopManager.mate.enable = true;
|
|
|
|
services.xserver.desktopManager.xfce.enable = true;
|
2023-01-15 18:56:16 +01:00
|
|
|
|
2023-05-20 22:37:33 +02:00
|
|
|
# enable sound with PipeWire
|
2024-04-21 23:13:10 +02:00
|
|
|
sound.enable = true;
|
|
|
|
hardware.pulseaudio.enable = false;
|
2023-01-15 18:56:16 +01:00
|
|
|
services.pipewire = {
|
|
|
|
enable = true;
|
2024-04-21 23:13:10 +02:00
|
|
|
alsa = {
|
|
|
|
enable = true;
|
|
|
|
support32Bit = true;
|
|
|
|
};
|
2023-05-20 22:37:33 +02:00
|
|
|
pulse.enable = true;
|
2023-01-15 18:56:16 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# allow realtime
|
|
|
|
security.rtkit.enable = true;
|
|
|
|
|
|
|
|
# package manager config
|
|
|
|
nix = {
|
|
|
|
# auto optimize the store
|
|
|
|
settings.auto-optimise-store = true;
|
|
|
|
|
|
|
|
# cleanup the store from time to time
|
|
|
|
gc = {
|
|
|
|
automatic = true;
|
|
|
|
dates = "daily";
|
|
|
|
options = "--delete-older-than 7d";
|
|
|
|
};
|
|
|
|
|
2024-03-29 17:08:51 +01:00
|
|
|
# enable new stuff
|
|
|
|
settings.experimental-features = "nix-command flakes";
|
2023-05-20 16:18:12 +02:00
|
|
|
|
2023-06-17 15:27:25 +02:00
|
|
|
# https://github.com/nix-community/nix-direnv
|
|
|
|
extraOptions = ''
|
|
|
|
keep-outputs = true
|
|
|
|
keep-derivations = true
|
|
|
|
'';
|
2023-01-15 18:56:16 +01:00
|
|
|
};
|
|
|
|
|
2024-05-31 21:05:43 +02:00
|
|
|
# move nix tmp directory off the tmpfs for large updates
|
|
|
|
# for nixos-build we set that directory as tmp dir in the command
|
|
|
|
systemd.services.nix-daemon = {
|
|
|
|
environment = {
|
|
|
|
# Location for temporary files
|
|
|
|
TMPDIR = "/var/cache/nix";
|
|
|
|
};
|
|
|
|
serviceConfig = {
|
|
|
|
# Create /var/cache/nix automatically on Nix Daemon start
|
|
|
|
CacheDirectory = "nix";
|
|
|
|
};
|
|
|
|
};
|
2024-06-03 17:16:11 +02:00
|
|
|
environment.variables.NIX_REMOTE = "daemon";
|
2024-05-31 21:05:43 +02:00
|
|
|
|
2024-04-04 00:08:33 +02:00
|
|
|
# auto update
|
|
|
|
system.autoUpgrade = {
|
|
|
|
enable = true;
|
|
|
|
allowReboot = false;
|
|
|
|
};
|
|
|
|
|
2023-01-15 18:56:16 +01:00
|
|
|
# avoid suspend ever to be triggered
|
|
|
|
systemd.targets.sleep.enable = false;
|
|
|
|
systemd.targets.suspend.enable = false;
|
|
|
|
systemd.targets.hibernate.enable = false;
|
|
|
|
systemd.targets.hybrid-sleep.enable = false;
|
|
|
|
|
2024-06-19 22:13:15 +02:00
|
|
|
# disable some services that I don't need
|
|
|
|
services.accounts-daemon.enable = pkgs.lib.mkForce false;
|
2024-06-19 22:44:58 +02:00
|
|
|
services.avahi.enable = pkgs.lib.mkForce false;
|
2024-06-19 22:13:15 +02:00
|
|
|
services.power-profiles-daemon.enable = pkgs.lib.mkForce false;
|
|
|
|
services.upower.enable = pkgs.lib.mkForce false;
|
|
|
|
|
2023-01-15 18:56:16 +01:00
|
|
|
# let home manager install stuff to /etc/profiles
|
|
|
|
home-manager.useUserPackages = true;
|
|
|
|
|
|
|
|
# use global pkgs
|
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
|
2024-05-26 22:55:46 +02:00
|
|
|
# allow unfree packages
|
2023-01-15 18:56:16 +01:00
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
2024-05-26 22:55:46 +02:00
|
|
|
# we want DRM support
|
|
|
|
nixpkgs.config.chromium.enableWideVine = true;
|
|
|
|
|
2023-01-15 18:56:16 +01:00
|
|
|
# List packages installed in system profile. To search, run:
|
|
|
|
# $ nix search wget
|
|
|
|
environment.systemPackages = with pkgs; [
|
2024-02-05 20:34:37 +01:00
|
|
|
pkgs.kdePackages.ark
|
2023-01-15 18:56:16 +01:00
|
|
|
aspellDicts.de
|
|
|
|
aspellDicts.en
|
2024-06-16 20:53:26 +02:00
|
|
|
bat
|
2024-06-16 22:12:32 +02:00
|
|
|
bitwise
|
2023-01-15 18:56:16 +01:00
|
|
|
borgbackup
|
2023-03-23 20:50:35 +01:00
|
|
|
btop
|
2023-10-22 17:35:45 +02:00
|
|
|
calibre
|
2023-10-21 18:15:29 +02:00
|
|
|
chromium
|
2023-01-15 18:56:16 +01:00
|
|
|
clamav
|
2023-06-10 19:09:58 +02:00
|
|
|
clinfo
|
2023-09-16 16:54:02 +02:00
|
|
|
config.boot.kernelPackages.perf
|
2024-06-16 20:53:26 +02:00
|
|
|
delta
|
2024-06-16 20:53:26 +02:00
|
|
|
duf
|
2023-07-28 17:11:20 +02:00
|
|
|
efibootmgr
|
2023-10-22 17:35:45 +02:00
|
|
|
emacs
|
2024-06-16 20:53:26 +02:00
|
|
|
eza
|
2024-06-16 22:03:26 +02:00
|
|
|
fd
|
2023-10-15 17:18:18 +02:00
|
|
|
fdupes
|
2023-10-22 17:35:45 +02:00
|
|
|
ffmpeg
|
2023-10-15 17:18:18 +02:00
|
|
|
file
|
2024-04-27 21:54:41 +02:00
|
|
|
fzf
|
2024-02-05 20:34:37 +01:00
|
|
|
pkgs.kdePackages.filelight
|
2023-10-22 17:35:45 +02:00
|
|
|
gimp
|
2023-01-15 18:56:16 +01:00
|
|
|
gitFull
|
2023-06-10 19:09:58 +02:00
|
|
|
glxinfo
|
2023-10-22 17:35:45 +02:00
|
|
|
go
|
2023-07-28 17:29:07 +02:00
|
|
|
gptfdisk
|
2023-10-22 17:35:45 +02:00
|
|
|
heaptrack
|
|
|
|
hotspot
|
|
|
|
hugo
|
2023-01-15 18:56:16 +01:00
|
|
|
hunspellDicts.de_DE
|
|
|
|
hunspellDicts.en_US
|
2023-10-15 17:18:18 +02:00
|
|
|
inetutils
|
2024-05-12 16:21:45 +02:00
|
|
|
inkscape
|
2024-02-05 20:34:37 +01:00
|
|
|
pkgs.kdePackages.kate
|
2024-04-04 00:00:17 +02:00
|
|
|
pkgs.kdePackages.kcachegrind
|
2024-02-05 20:34:37 +01:00
|
|
|
pkgs.kdePackages.kcalc
|
2023-10-22 17:35:45 +02:00
|
|
|
keychain
|
2024-02-05 20:34:37 +01:00
|
|
|
pkgs.kdePackages.kmail
|
|
|
|
pkgs.kdePackages.konsole
|
2023-10-22 17:35:45 +02:00
|
|
|
krita
|
2024-06-16 20:53:26 +02:00
|
|
|
lazygit
|
2023-10-22 17:35:45 +02:00
|
|
|
libjxl
|
|
|
|
libreoffice
|
2023-06-10 19:09:58 +02:00
|
|
|
libva-utils
|
2024-06-16 20:53:26 +02:00
|
|
|
lsd
|
2023-01-15 18:56:16 +01:00
|
|
|
lsof
|
|
|
|
mc
|
2024-02-05 20:34:37 +01:00
|
|
|
pkgs.kdePackages.neochat
|
2023-07-28 16:37:12 +02:00
|
|
|
nixos-install-tools
|
2023-10-22 17:35:45 +02:00
|
|
|
nmap
|
2023-09-16 17:08:34 +02:00
|
|
|
nvme-cli
|
2023-10-22 17:35:45 +02:00
|
|
|
okteta
|
2024-02-05 20:34:37 +01:00
|
|
|
pkgs.kdePackages.okular
|
2023-08-06 19:41:42 +02:00
|
|
|
p7zip
|
2023-07-28 17:29:07 +02:00
|
|
|
parted
|
2023-10-15 17:18:18 +02:00
|
|
|
pciutils
|
2024-01-28 01:54:01 +01:00
|
|
|
pdftk
|
2024-06-16 20:53:26 +02:00
|
|
|
procs
|
2023-10-22 17:35:45 +02:00
|
|
|
pulseaudio
|
2024-06-25 21:21:57 +02:00
|
|
|
pure-prompt
|
2024-05-30 11:18:56 +02:00
|
|
|
pwgen
|
2023-10-22 17:35:45 +02:00
|
|
|
qmk
|
2024-06-16 22:03:26 +02:00
|
|
|
ripgrep
|
2024-06-16 20:53:26 +02:00
|
|
|
scc
|
2023-12-29 12:43:35 +01:00
|
|
|
ssh-audit
|
2024-01-13 16:34:30 +01:00
|
|
|
sysstat
|
2023-10-22 17:35:45 +02:00
|
|
|
tcl
|
|
|
|
texlive.combined.scheme-small
|
|
|
|
tigervnc
|
|
|
|
tk
|
2024-06-16 20:53:26 +02:00
|
|
|
tldr
|
2024-02-05 20:34:37 +01:00
|
|
|
pkgs.kdePackages.tokodon
|
2023-06-10 17:02:24 +02:00
|
|
|
unrar
|
|
|
|
unzip
|
2023-10-22 17:35:45 +02:00
|
|
|
usbutils
|
|
|
|
valgrind
|
|
|
|
vlc
|
|
|
|
vscodium
|
2023-06-10 19:09:58 +02:00
|
|
|
vulkan-tools
|
|
|
|
wayland-utils
|
2024-04-27 21:54:41 +02:00
|
|
|
zoxide
|
2023-01-15 18:56:16 +01:00
|
|
|
zsh
|
|
|
|
];
|
|
|
|
|
2023-10-22 17:56:24 +02:00
|
|
|
# run browsers in a sandbox
|
2023-10-21 18:15:29 +02:00
|
|
|
programs.firejail = {
|
|
|
|
enable = true;
|
2023-10-21 19:22:49 +02:00
|
|
|
|
2023-10-21 18:15:29 +02:00
|
|
|
wrappedBinaries = {
|
|
|
|
chromium = {
|
|
|
|
executable = "${pkgs.lib.getBin pkgs.chromium}/bin/chromium";
|
|
|
|
profile = "${pkgs.firejail}/etc/firejail/chromium.profile";
|
|
|
|
};
|
2023-10-21 19:22:49 +02:00
|
|
|
|
2023-10-21 18:15:29 +02:00
|
|
|
firefox = {
|
|
|
|
executable = "${pkgs.lib.getBin pkgs.firefox}/bin/firefox";
|
|
|
|
profile = "${pkgs.firejail}/etc/firejail/firefox.profile";
|
|
|
|
};
|
2024-03-10 18:15:33 +01:00
|
|
|
|
|
|
|
signal-desktop = {
|
|
|
|
executable = "${pkgs.signal-desktop}/bin/signal-desktop";
|
|
|
|
profile = "${pkgs.firejail}/etc/firejail/signal-desktop.profile";
|
|
|
|
};
|
2023-10-21 18:08:29 +02:00
|
|
|
};
|
|
|
|
};
|
2023-10-21 19:22:49 +02:00
|
|
|
|
2023-10-21 18:15:29 +02:00
|
|
|
# chromium needs programs.firefox.enable here and systemPackages entry to have icon and work
|
2023-10-15 16:27:54 +02:00
|
|
|
programs.chromium.enable = true;
|
2023-10-21 19:22:49 +02:00
|
|
|
|
2023-10-21 18:15:29 +02:00
|
|
|
# firefox needs programs.firefox.enable here but no systemPackages entry to have icon and work
|
2023-10-15 16:27:54 +02:00
|
|
|
programs.firefox.enable = true;
|
|
|
|
|
2023-10-22 17:35:45 +02:00
|
|
|
# Flatpak to sandbox Steam, Bottles and Co.
|
|
|
|
#
|
|
|
|
# flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
|
|
|
# flatpak install --user flathub com.usebottles.bottles
|
|
|
|
# flatpak install --user flathub com.valvesoftware.Steam
|
2023-12-07 18:58:23 +01:00
|
|
|
# flatpak update --user
|
2023-10-22 17:35:45 +02:00
|
|
|
#
|
|
|
|
services.flatpak.enable = true;
|
|
|
|
|
2023-01-15 18:56:16 +01:00
|
|
|
# allow keyboard configure tools to work
|
2023-05-20 23:22:25 +02:00
|
|
|
hardware.keyboard.qmk.enable = true;
|
2023-01-15 18:56:16 +01:00
|
|
|
|
|
|
|
# add ~/bin to PATH
|
|
|
|
environment.homeBinInPath = true;
|
|
|
|
|
|
|
|
# more fonts for all users
|
|
|
|
fonts = {
|
2024-04-04 00:03:20 +02:00
|
|
|
# default fonts
|
|
|
|
enableDefaultPackages = true;
|
|
|
|
|
2023-01-15 18:56:16 +01:00
|
|
|
# more fonts
|
2023-07-29 16:11:55 +02:00
|
|
|
packages = with pkgs; [
|
2024-06-19 22:13:15 +02:00
|
|
|
# includes nice developer fonts and used by starship
|
2023-11-16 22:23:02 +01:00
|
|
|
nerdfonts
|
2023-02-04 20:11:00 +01:00
|
|
|
|
2023-11-16 22:09:18 +01:00
|
|
|
# unicode capable fonts
|
|
|
|
babelstone-han
|
|
|
|
dejavu_fonts
|
|
|
|
ipafont
|
|
|
|
kochi-substitute
|
2023-02-04 20:11:00 +01:00
|
|
|
noto-fonts
|
2023-11-16 22:09:18 +01:00
|
|
|
noto-fonts-cjk
|
|
|
|
noto-fonts-cjk-sans
|
|
|
|
noto-fonts-cjk-serif
|
2023-02-04 20:11:00 +01:00
|
|
|
noto-fonts-extra
|
|
|
|
noto-fonts-emoji
|
2023-01-15 18:56:16 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
# tune fontconfig
|
|
|
|
fontconfig = {
|
|
|
|
# better default fonts
|
|
|
|
defaultFonts = {
|
2023-11-16 22:23:02 +01:00
|
|
|
monospace = ["IosevkaTerm Nerd Font Mono"];
|
2023-11-16 22:09:18 +01:00
|
|
|
sansSerif = ["Noto Sans"];
|
|
|
|
serif = ["Noto Serif"];
|
2023-01-15 18:56:16 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-10-22 17:35:45 +02:00
|
|
|
# OpenGL
|
2024-06-21 23:46:35 +02:00
|
|
|
hardware.graphics.enable = true;
|
2023-01-15 18:56:16 +01:00
|
|
|
|
2023-02-06 20:20:40 +01:00
|
|
|
# try to ensure we can use our network LaserJet
|
2023-01-15 18:56:16 +01:00
|
|
|
services.printing.enable = true;
|
|
|
|
services.printing.drivers = [ pkgs.hplip ];
|
|
|
|
|
2023-10-22 17:35:45 +02:00
|
|
|
# dconf is needed for gtk, see https://nixos.wiki/wiki/KDE
|
|
|
|
programs.dconf.enable = true;
|
|
|
|
|
2023-01-15 18:56:16 +01:00
|
|
|
# ensure cron and Co. can send mails
|
2024-04-04 00:00:17 +02:00
|
|
|
programs.msmtp = {
|
|
|
|
enable = true;
|
|
|
|
setSendmail = true;
|
|
|
|
accounts = {
|
|
|
|
default = {
|
|
|
|
auth = true;
|
|
|
|
tls = true;
|
|
|
|
from = "christoph@cullmann.io";
|
|
|
|
host = "moon.babylon2k.com";
|
|
|
|
port = "587";
|
|
|
|
user = builtins.readFile "/data/nixos/mailuser.secret";
|
|
|
|
passwordeval = "cat /data/nixos/mailpassword.secret";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
defaults = {
|
|
|
|
aliases = "/etc/aliases";
|
|
|
|
};
|
|
|
|
};
|
2023-01-15 18:56:16 +01:00
|
|
|
|
2024-05-31 17:43:39 +02:00
|
|
|
# send mails on ZFS events
|
|
|
|
services.zfs.zed = {
|
|
|
|
settings = {
|
|
|
|
ZED_DEBUG_LOG = "/tmp/zed.debug.log";
|
|
|
|
ZED_EMAIL_ADDR = [ "root" ];
|
|
|
|
ZED_EMAIL_PROG = "${pkgs.msmtp}/bin/msmtp";
|
|
|
|
ZED_EMAIL_OPTS = "@ADDRESS@";
|
|
|
|
|
|
|
|
ZED_NOTIFY_INTERVAL_SECS = 3600;
|
|
|
|
ZED_NOTIFY_VERBOSE = true;
|
|
|
|
|
|
|
|
ZED_USE_ENCLOSURE_LEDS = true;
|
|
|
|
ZED_SCRUB_AFTER_RESILVER = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# this option does not work; will return error
|
|
|
|
enableMail = false;
|
|
|
|
};
|
|
|
|
|
2023-01-15 18:56:16 +01:00
|
|
|
environment.etc = {
|
|
|
|
"aliases" = {
|
|
|
|
text = ''
|
|
|
|
root: christoph@cullmann.io
|
|
|
|
'';
|
|
|
|
mode = "0644";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-04-29 21:07:23 +02:00
|
|
|
# use ZSH per default
|
|
|
|
programs.zsh.enable = true;
|
2023-01-15 18:56:16 +01:00
|
|
|
users.defaultUserShell = pkgs.zsh;
|
2024-04-29 21:07:23 +02:00
|
|
|
environment.shells = with pkgs; [ zsh ];
|
2023-05-20 22:37:33 +02:00
|
|
|
|
2023-10-23 19:55:37 +02:00
|
|
|
# enable VirtualBox
|
2023-01-15 18:56:16 +01:00
|
|
|
virtualisation.virtualbox.host.enable = true;
|
2024-05-26 16:58:37 +02:00
|
|
|
virtualisation.virtualbox.host.enableKvm = true;
|
|
|
|
virtualisation.virtualbox.host.enableHardening = false;
|
|
|
|
virtualisation.virtualbox.host.addNetworkInterface = false;
|
2023-01-15 18:56:16 +01:00
|
|
|
|
2023-01-16 00:03:51 +01:00
|
|
|
# configure sudo
|
|
|
|
security.sudo.execWheelOnly = true;
|
|
|
|
security.sudo.extraConfig = ''
|
|
|
|
Defaults lecture = never
|
|
|
|
'';
|
|
|
|
|
2023-01-15 18:56:16 +01:00
|
|
|
###
|
|
|
|
### per user configuration below
|
|
|
|
###
|
|
|
|
|
|
|
|
# all users and passwords are defined here
|
|
|
|
users.mutableUsers = false;
|
|
|
|
|
2024-06-25 21:06:42 +02:00
|
|
|
#
|
|
|
|
# administrator
|
|
|
|
#
|
|
|
|
|
|
|
|
users.users.root = {
|
|
|
|
# init password
|
|
|
|
hashedPassword = builtins.readFile "/data/nixos/password.secret";
|
|
|
|
|
|
|
|
# use fixed auth keys
|
|
|
|
openssh.authorizedKeys.keys = pkgs.lib.splitString "\n" (builtins.readFile "/data/nixos/authorized_keys.secret");
|
|
|
|
};
|
|
|
|
|
|
|
|
home-manager.users.root = {
|
|
|
|
# initial version
|
|
|
|
home.stateVersion = "22.11";
|
|
|
|
|
2024-06-25 21:28:50 +02:00
|
|
|
# basic ZSH
|
2024-06-25 21:06:42 +02:00
|
|
|
programs.zsh.enable = true;
|
|
|
|
};
|
2023-01-15 18:56:16 +01:00
|
|
|
|
2024-06-25 21:06:42 +02:00
|
|
|
#
|
|
|
|
# my main user
|
|
|
|
#
|
|
|
|
|
|
|
|
users.users.cullmann = {
|
2023-01-15 18:56:16 +01:00
|
|
|
# hard code UID for stability over machines
|
|
|
|
uid = 1000;
|
|
|
|
|
|
|
|
# normal user
|
|
|
|
isNormalUser = true;
|
|
|
|
|
|
|
|
# it's me :P
|
|
|
|
description = "Christoph Cullmann";
|
|
|
|
|
2023-10-23 19:55:37 +02:00
|
|
|
# allow VirtualBox and sudo for my main user
|
|
|
|
extraGroups = [ "vboxusers" "wheel" ];
|
2024-06-25 21:06:42 +02:00
|
|
|
|
|
|
|
# init password
|
2024-06-25 21:21:57 +02:00
|
|
|
hashedPassword = config.users.users.root.hashedPassword;
|
2024-06-25 21:06:42 +02:00
|
|
|
|
|
|
|
# use fixed auth keys
|
2024-06-25 21:21:57 +02:00
|
|
|
openssh.authorizedKeys.keys = config.users.users.root.openssh.authorizedKeys.keys;
|
2023-01-15 18:56:16 +01:00
|
|
|
};
|
|
|
|
|
2024-06-25 21:06:42 +02:00
|
|
|
home-manager.users.cullmann = {
|
|
|
|
# initial version
|
|
|
|
home.stateVersion = "22.11";
|
|
|
|
|
2024-06-25 21:28:50 +02:00
|
|
|
# ZSH with some nice prompt and extra main user configuration
|
2024-06-25 21:06:42 +02:00
|
|
|
programs.zsh = {
|
|
|
|
# zsh with extras wanted
|
|
|
|
enable = true;
|
|
|
|
enableCompletion = true;
|
|
|
|
autosuggestion.enable = true;
|
|
|
|
history.share = false;
|
|
|
|
syntaxHighlighting.enable = true;
|
|
|
|
|
2024-06-25 21:21:57 +02:00
|
|
|
# use pure prompt
|
|
|
|
initExtra = "prompt pure";
|
|
|
|
|
2024-06-25 21:06:42 +02:00
|
|
|
# aliases
|
|
|
|
shellAliases = {
|
|
|
|
# system build/update/cleanup
|
|
|
|
update = "sudo TMPDIR=/var/cache/nix nixos-rebuild boot";
|
|
|
|
upgrade = "sudo TMPDIR=/var/cache/nix nixos-rebuild boot --upgrade";
|
|
|
|
updatenow = "sudo TMPDIR=/var/cache/nix nixos-rebuild switch";
|
|
|
|
upgradenow = "sudo TMPDIR=/var/cache/nix nixos-rebuild switch --upgrade";
|
|
|
|
gc = "sudo nix-collect-garbage --delete-older-than 7d";
|
|
|
|
verify = "sudo nix --extra-experimental-features nix-command store verify --all";
|
|
|
|
optimize = "sudo nix --extra-experimental-features nix-command store optimise";
|
|
|
|
|
|
|
|
# overwrite some tools
|
|
|
|
cat = "bat";
|
|
|
|
ls = "lsd";
|
|
|
|
|
|
|
|
# ssh around in the local network
|
|
|
|
mac = "ssh mac.fritz.box";
|
|
|
|
macroot = "ssh root@mac.fritz.box";
|
|
|
|
mini = "ssh mini.fritz.box";
|
|
|
|
miniroot = "ssh root@mini.fritz.box";
|
|
|
|
neko = "ssh neko.fritz.box";
|
|
|
|
nekoroot = "ssh root@neko.fritz.box";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-06-25 21:28:50 +02:00
|
|
|
# nice cd
|
|
|
|
programs.zoxide = {
|
|
|
|
enable = true;
|
|
|
|
options = [ "--cmd" "cd" ];
|
|
|
|
};
|
|
|
|
|
2023-01-15 18:56:16 +01:00
|
|
|
# enable keychain
|
|
|
|
programs.keychain = {
|
|
|
|
enable = true;
|
|
|
|
keys = [ "id_ed25519" ];
|
|
|
|
};
|
|
|
|
|
2023-10-22 17:35:45 +02:00
|
|
|
# https://github.com/nix-community/nix-direnv
|
|
|
|
programs.direnv.enable = true;
|
|
|
|
programs.direnv.nix-direnv.enable = true;
|
2023-01-15 18:56:16 +01:00
|
|
|
};
|
|
|
|
}
|