This repository has been archived on 2024-04-14. You can view files and clone it, but cannot push or open issues or pull requests.
nixos-dotfiles/system/configuration.nix

218 lines
4.4 KiB
Nix
Raw Permalink Normal View History

{
2023-10-08 10:51:15 +01:00
pkgs,
lib,
config,
inputs,
2024-01-30 17:51:06 +00:00
hostName,
userName,
2023-10-08 10:51:15 +01:00
...
}: {
2022-10-03 23:21:40 +01:00
imports = [
./hardware-configuration.nix
2023-09-24 01:42:00 +01:00
./hardware
2023-08-26 10:32:53 +01:00
./programs
2023-09-24 01:42:00 +01:00
./services
2022-10-03 23:21:40 +01:00
];
2022-08-07 16:11:24 +01:00
2022-08-21 01:18:19 +01:00
boot = {
2023-12-31 23:48:18 +00:00
tmp.cleanOnBoot = true;
2023-09-24 01:42:00 +01:00
kernel.sysctl."vm.max_map_count" = 16777216; #Star Citizen crash fix
2023-10-08 10:51:15 +01:00
kernelPackages = pkgs.linuxPackages_latest;
kernelModules = ["i2c-dev" "i2c-piix4"];
kernelParams = [
"amd_pstate.shared_mem=1"
"amd_pstate=active"
2024-02-13 14:04:39 +00:00
#quiet boot
"quiet"
"splash"
"vga=current"
"quiet"
"rd.udev.log_level=3"
"udev.log_priority=3"
"splash"
2023-10-08 10:51:15 +01:00
];
2022-08-07 16:11:24 +01:00
2024-02-13 14:04:39 +00:00
initrd.verbose = false;
consoleLogLevel = 0;
2022-08-21 01:18:19 +01:00
loader = {
efi = {
2024-03-01 22:46:54 +00:00
efiSysMountPoint = "/boot/efi";
2022-08-21 01:18:19 +01:00
canTouchEfiVariables = true;
};
2024-03-01 22:46:54 +00:00
grub = {
2024-03-11 17:22:04 +00:00
enable = true;
efiSupport = true;
device = "nodev";
};
2024-02-13 14:04:39 +00:00
2024-03-11 17:22:04 +00:00
timeout = 10;
2022-08-21 01:18:19 +01:00
};
};
2022-08-07 16:11:24 +01:00
2022-12-16 08:10:28 +00:00
powerManagement.cpuFreqGovernor = "schedutil";
2022-10-03 23:21:40 +01:00
2022-09-04 00:54:47 +01:00
networking = {
2024-01-30 17:51:06 +00:00
hostName = "${hostName}"; #hostname declared in flake.nix
firewall.enable = false;
2024-02-13 14:04:39 +00:00
networkmanager.enable = true;
2022-12-16 08:10:28 +00:00
extraHosts = ''
2023-05-21 21:21:25 +01:00
192.168.0.18 steam.deck
2023-09-24 01:42:00 +01:00
127.0.0.1 modules-cdn.eac-prod.on.epicgames.com
2023-06-01 21:20:44 +01:00
'';
2024-03-11 17:22:04 +00:00
# nameservers = ["94.16.114.254" "94.247.43.254"]; #OpenNIC
2024-01-15 09:34:49 +00:00
};
2022-08-07 16:11:24 +01:00
2023-07-01 19:47:43 +01:00
# Set your time zone.
2022-08-07 16:11:24 +01:00
time.timeZone = "Europe/Vienna";
2023-07-01 19:47:43 +01:00
# Select internationalisation properties.
2022-08-14 21:20:39 +01:00
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_NUMERIC = "de_AT.UTF-8";
LC_TIME = "de_AT.UTF-8";
LC_MONETARY = "de_AT.UTF-8";
LC_MEASUREMENT = "de_AT.UTF-8";
LC_IDENTIFICATION = "de_AT.UTF-8";
};
};
2022-08-07 16:11:24 +01:00
console = {
font = "Lat2-Terminus16";
2022-08-08 10:01:42 +01:00
keyMap = "us-acentos";
2022-08-07 16:11:24 +01:00
};
2023-07-01 19:47:43 +01:00
# Enable sound.
2022-08-07 16:11:24 +01:00
sound.enable = true;
2022-11-14 11:58:04 +00:00
2022-09-04 00:54:47 +01:00
security = {
2023-04-05 10:36:45 +01:00
audit.enable = false;
auditd.enable = false;
polkit.enable = true;
rtkit.enable = true;
2022-09-04 00:54:47 +01:00
sudo.enable = false;
2023-04-05 10:36:45 +01:00
2022-09-04 00:54:47 +01:00
doas = {
enable = true;
2023-10-08 10:51:15 +01:00
extraRules = [
{
2024-01-30 17:51:06 +00:00
users = ["${userName}"];
2024-03-11 17:22:04 +00:00
# keepEnv = true;
2023-10-08 10:51:15 +01:00
persist = true;
2024-03-11 17:22:04 +00:00
#silence a warning about missing locales
setEnv = ["LOCALE_ARCHIVE"];
2023-10-08 10:51:15 +01:00
}
];
2022-09-04 00:54:47 +01:00
};
2024-02-13 14:04:39 +00:00
wrappers = {
"wavemon" = {
source = "${pkgs.wavemon}/bin/wavemon";
owner = "root";
group = "root";
capabilities = "cap_net_admin+eip";
};
};
2022-09-04 00:54:47 +01:00
};
2022-08-14 21:20:39 +01:00
2024-01-30 17:51:06 +00:00
users.users.${userName} = {
2022-08-07 16:11:24 +01:00
isNormalUser = true;
2023-10-08 10:51:15 +01:00
extraGroups = ["audio" "games" "input" "lp" "networkmanager" "scanner" "users" "vboxusers" "video" "wheel"];
2022-08-07 16:11:24 +01:00
shell = pkgs.fish;
};
2022-09-04 00:54:47 +01:00
environment = {
systemPackages = with pkgs; [
2023-07-01 19:47:43 +01:00
bc
2023-08-13 20:24:57 +01:00
cached-nix-shell
2023-07-01 19:47:43 +01:00
compsize
distrobox
fd
file
git
htop
2023-09-24 01:42:00 +01:00
inotify-tools
2023-07-01 19:47:43 +01:00
kdiskmark
links2
libsForQt5.dolphin
libsForQt5.kio-extras
lm_sensors
2024-01-19 11:17:30 +00:00
nix-search-cli
2023-07-01 19:47:43 +01:00
nvtop-amd
openrgb
p7zip
pciutils
2024-03-11 17:22:04 +00:00
pv
2023-09-24 01:42:00 +01:00
sassc
2023-12-29 23:19:10 +00:00
socat
2023-07-01 19:47:43 +01:00
ripgrep
unrar
unzip
usbutils
2024-01-11 03:47:13 +00:00
wget
2023-07-12 03:15:27 +01:00
ydotool
2022-09-04 00:54:47 +01:00
];
};
2022-08-07 16:11:24 +01:00
2023-12-12 12:20:55 +00:00
systemd = {
extraConfig = ''
DefaultTimeoutStopSec=10s
'';
user.extraConfig = ''
#Systemd is a meme. This is the proof
DefaultTimeoutStopSec=10s
'';
2023-12-12 12:20:55 +00:00
network = {
enable = true;
};
2023-05-29 16:43:26 +01:00
2023-12-12 12:20:55 +00:00
services = {
systemd-networkd-wait-online.enable = lib.mkForce false;
};
};
2022-12-16 08:10:28 +00:00
2022-11-14 11:58:04 +00:00
nix = {
2022-12-16 08:10:28 +00:00
extraOptions = ''
experimental-features = nix-command flakes
warn-dirty = false
2023-06-01 21:20:44 +01:00
'';
2023-08-13 20:24:57 +01:00
2023-10-08 10:51:15 +01:00
registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
2023-08-13 20:24:57 +01:00
2022-11-14 11:58:04 +00:00
gc = {
persistent = true;
automatic = true;
dates = "weekly";
2023-04-05 10:36:45 +01:00
options = "--delete-older-than 7d";
2022-11-14 11:58:04 +00:00
};
2023-08-13 20:24:57 +01:00
settings = {
auto-optimise-store = true;
2024-01-30 17:51:06 +00:00
extra-sandbox-paths = [config.programs.ccache.cacheDir];
2023-07-01 19:47:43 +01:00
2023-06-01 21:20:44 +01:00
substituters = [
"https://nyx.chaotic.cx"
2023-06-01 21:20:44 +01:00
"https://hyprland.cachix.org"
2023-08-24 06:03:47 +01:00
"https://nix-community.cachix.org"
];
2023-07-01 19:47:43 +01:00
2023-06-01 21:20:44 +01:00
trusted-public-keys = [
"nyx.chaotic.cx-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
2023-06-01 21:20:44 +01:00
"chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
2023-08-24 06:03:47 +01:00
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
2022-08-07 16:11:24 +01:00
};
2022-08-07 17:52:09 +01:00
2024-03-11 17:22:04 +00:00
system.stateVersion = "23.11";
2022-08-07 16:11:24 +01:00
}