2023-10-23 00:16:38 +02:00
|
|
|
{
|
|
|
|
inputs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
pkgs,
|
2024-05-12 22:36:39 +02:00
|
|
|
outputs,
|
2023-10-23 00:16:38 +02:00
|
|
|
...
|
|
|
|
}: {
|
|
|
|
# You can import other NixOS modules here
|
|
|
|
imports = [
|
|
|
|
# If you want to use modules from other flakes (such as nixos-hardware):
|
|
|
|
# inputs.hardware.nixosModules.common-cpu-amd
|
|
|
|
# inputs.hardware.nixosModules.common-ssd
|
2024-05-12 22:36:39 +02:00
|
|
|
outputs.nixosModules.desktop.kde
|
2023-10-23 00:16:38 +02:00
|
|
|
./hardware-configuration.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
nixpkgs = {
|
|
|
|
config = {
|
|
|
|
allowUnfree = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nix = {
|
|
|
|
# This will add each flake input as a registry
|
|
|
|
# To make nix3 commands consistent with your flake
|
|
|
|
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 = {
|
|
|
|
auto-optimise-store = true;
|
2023-10-25 12:12:59 +02:00
|
|
|
builders-use-substitutes = true;
|
|
|
|
experimental-features = [ "nix-command" "flakes" "repl-flake" ];
|
|
|
|
keep-derivations = true;
|
|
|
|
keep-outputs = true;
|
|
|
|
max-jobs = "auto";
|
|
|
|
warn-dirty = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
gc = {
|
|
|
|
automatic = true;
|
|
|
|
dates = "daily";
|
|
|
|
options = "--delete-older-than 3d";
|
2023-10-23 00:16:38 +02:00
|
|
|
};
|
|
|
|
};
|
2024-04-25 02:33:53 +02:00
|
|
|
|
|
|
|
# Install the latest kernel
|
2023-11-19 23:12:39 +01:00
|
|
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
|
|
|
|
2024-04-25 02:33:53 +02:00
|
|
|
# Improve SSD performance
|
|
|
|
fileSystems."/".options = [ "noatime" "nodiratime" "discard" ];
|
|
|
|
|
2023-10-23 00:16:38 +02:00
|
|
|
# Bootloader.
|
2024-05-12 22:36:39 +02:00
|
|
|
boot.loader.grub = {
|
|
|
|
enable = true;
|
|
|
|
devices = [ "nodev" ];
|
|
|
|
efiInstallAsRemovable = true;
|
|
|
|
efiSupport = true;
|
|
|
|
|
|
|
|
extraEntries = ''
|
|
|
|
menuentry "Reboot" {
|
|
|
|
reboot
|
|
|
|
}
|
|
|
|
menuentry "Poweroff" {
|
|
|
|
halt
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
2023-10-23 00:16:38 +02:00
|
|
|
|
2024-04-25 02:33:53 +02:00
|
|
|
networking.hostName = "puzzlevision";
|
2023-10-23 00:16:38 +02:00
|
|
|
|
|
|
|
# Enable networking
|
|
|
|
networking.networkmanager.enable = true;
|
|
|
|
|
|
|
|
# Set your time zone.
|
|
|
|
time.timeZone = "Europe/Berlin";
|
|
|
|
|
|
|
|
# Select internationalisation properties.
|
|
|
|
i18n.defaultLocale = "en_US.UTF-8";
|
|
|
|
|
|
|
|
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";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Configure console keymap
|
|
|
|
console.keyMap = "de";
|
|
|
|
|
2024-05-12 22:36:39 +02:00
|
|
|
# Enable the TLP service for improved battery management
|
|
|
|
services.tlp.enable = true;
|
|
|
|
services.power-profiles-daemon.enable = false;
|
|
|
|
|
2023-10-23 00:16:38 +02:00
|
|
|
# Enable CUPS to print documents.
|
|
|
|
services.printing.enable = true;
|
|
|
|
|
|
|
|
# Enable sound with pipewire.
|
|
|
|
sound.enable = true;
|
|
|
|
hardware.pulseaudio.enable = false;
|
|
|
|
security.rtkit.enable = true;
|
|
|
|
services.pipewire = {
|
|
|
|
enable = true;
|
|
|
|
alsa.enable = true;
|
|
|
|
alsa.support32Bit = true;
|
|
|
|
pulse.enable = true;
|
2023-10-23 11:14:04 +02:00
|
|
|
};
|
2023-10-23 00:16:38 +02:00
|
|
|
|
2023-11-19 23:12:39 +01:00
|
|
|
# Enable bluetooth on boot
|
|
|
|
hardware.bluetooth.enable = true;
|
|
|
|
hardware.bluetooth.powerOnBoot = true;
|
|
|
|
|
|
|
|
# Enable docker
|
|
|
|
virtualisation.docker.enable = true;
|
|
|
|
|
2024-04-25 02:33:53 +02:00
|
|
|
# Configure keymap in X11
|
|
|
|
services.xserver = {
|
|
|
|
xkb.layout = "de";
|
|
|
|
xkb.variant = "";
|
|
|
|
};
|
|
|
|
|
2024-05-12 22:36:39 +02:00
|
|
|
# Configure fish as the default shell
|
|
|
|
environment.shells = with pkgs; [ fish ];
|
|
|
|
users.defaultUserShell = pkgs.fish;
|
|
|
|
programs.fish.enable = true;
|
|
|
|
|
2024-04-25 02:33:53 +02:00
|
|
|
# Define a user account.
|
2023-10-23 11:14:04 +02:00
|
|
|
users.users = {
|
2023-10-23 00:16:38 +02:00
|
|
|
jo = {
|
|
|
|
isNormalUser = true;
|
|
|
|
description = "Jo";
|
2024-04-25 02:33:53 +02:00
|
|
|
extraGroups = [ "networkmanager" "wheel" "docker" "tty" "dialout" ];
|
2023-10-23 00:16:38 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
work = {
|
|
|
|
isNormalUser = true;
|
|
|
|
description = "Work";
|
2023-10-23 11:14:04 +02:00
|
|
|
initialPassword = "fortnite";
|
2023-10-23 00:16:38 +02:00
|
|
|
extraGroups = [ "networkmanager" ];
|
|
|
|
packages = with pkgs; [
|
|
|
|
jetbrains.phpstorm
|
|
|
|
teams-for-linux
|
2023-10-23 11:14:04 +02:00
|
|
|
enpass
|
2024-04-25 02:33:53 +02:00
|
|
|
thunderbird
|
2023-10-23 00:16:38 +02:00
|
|
|
];
|
|
|
|
};
|
2023-10-23 11:14:04 +02:00
|
|
|
};
|
2023-10-23 00:16:38 +02:00
|
|
|
|
2023-11-19 23:12:39 +01:00
|
|
|
programs.steam = {
|
|
|
|
enable = true;
|
|
|
|
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
|
|
|
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
|
|
|
};
|
|
|
|
|
2023-10-23 00:16:38 +02:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
nano
|
|
|
|
firefox
|
2023-11-19 23:12:39 +01:00
|
|
|
vlc
|
|
|
|
libreoffice
|
|
|
|
|
|
|
|
# For development
|
|
|
|
git
|
2024-04-25 02:33:53 +02:00
|
|
|
bun
|
2024-05-12 22:36:39 +02:00
|
|
|
|
|
|
|
# Home manager
|
|
|
|
home-manager
|
2023-10-23 00:16:38 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
|
|
|
system.stateVersion = "23.05";
|
|
|
|
}
|