mirror of
https://git.gay/sneexy/nixos.git
synced 2026-01-11 05:03:15 -08:00
133 lines
3.6 KiB
Nix
133 lines
3.6 KiB
Nix
# This is your system's configuration file.
|
|
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
|
|
{
|
|
inputs,
|
|
outputs,
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}: {
|
|
# You can import other NixOS modules here
|
|
imports = [
|
|
# networking configuration
|
|
./networking.nix
|
|
|
|
# packages
|
|
./packages.nix
|
|
|
|
# desktop setup
|
|
./desktop.nix
|
|
];
|
|
|
|
# This will add each flake input as a registry
|
|
# To make nix3 commands consistent with your flake
|
|
nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs);
|
|
|
|
# This will additionally add your inputs to the system's legacy channels
|
|
# Making legacy nix commands consistent as well, awesome!
|
|
nix.nixPath = ["/etc/nix/path"];
|
|
environment.etc =
|
|
lib.mapAttrs'
|
|
(name: value: {
|
|
name = "nix/path/${name}";
|
|
value.source = value.flake;
|
|
})
|
|
config.nix.registry;
|
|
|
|
nix.settings = {
|
|
# Enable flakes and new 'nix' command
|
|
experimental-features = "nix-command flakes";
|
|
# Deduplicate and optimize nix store
|
|
auto-optimise-store = true;
|
|
# i'd say i trust myself tbh
|
|
trusted-users = ["ruben"];
|
|
substituters = [
|
|
"https://cache.nixos.org"
|
|
"https://nix-community.cachix.org"
|
|
"https://nyx.chaotic.cx"
|
|
];
|
|
trusted-public-keys = [
|
|
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
"chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
|
|
];
|
|
};
|
|
|
|
# according to research: zen helps by trying to keep a reponsive desktop when i'm doing like millions of things
|
|
# at once
|
|
# TODO: theres also cachyos which i've tried for a short while, maybe poke at it again?
|
|
boot.kernelPackages = pkgs.linuxPackages_zen;
|
|
|
|
# Bootloader.
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
# see https://nixos-and-flakes.thiscute.world/nixos-with-flakes/other-useful-tips#reducing-disk-usage
|
|
# for below:
|
|
# limit to 10 generations
|
|
boot.loader.systemd-boot.configurationLimit = 10;
|
|
|
|
# Perform garbage collection weekly to maintain low disk usage
|
|
nix.gc = {
|
|
automatic = true;
|
|
dates = "weekly";
|
|
options = "--delete-older-than 1w";
|
|
};
|
|
|
|
# enable plymouth because it looks cool :)))
|
|
boot.plymouth = {
|
|
enable = true;
|
|
theme = "bgrt";
|
|
};
|
|
|
|
# enables support for Bluetooth
|
|
# https://nixos.wiki/wiki/Bluetooth
|
|
hardware.bluetooth = {
|
|
enable = true;
|
|
package = pkgs.bluez;
|
|
powerOnBoot = false;
|
|
};
|
|
|
|
# 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;
|
|
|
|
# wireplumber exists!
|
|
wireplumber.enable = true;
|
|
};
|
|
|
|
services.pipewire.wireplumber.configPackages = [
|
|
(pkgs.writeTextDir "share/wireplumber/bluetooth.lua.d/51-bluez-config.lua" ''
|
|
bluez_monitor.properties = {
|
|
["bluez5.enable-sbc-xq"] = true,
|
|
["bluez5.enable-msbc"] = true,
|
|
["bluez5.enable-hw-volume"] = true,
|
|
["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
|
|
}
|
|
'')
|
|
];
|
|
|
|
# Enable CUPS to print documents.
|
|
services.printing = {
|
|
enable = true;
|
|
drivers = with pkgs; [canon-cups-ufr2];
|
|
};
|
|
services.avahi.enable = true;
|
|
services.avahi.nssmdns4 = true;
|
|
|
|
# xbox LIVE !!!!
|
|
hardware.xpadneo.enable = true;
|
|
hardware.xone.enable = true;
|
|
|
|
# enable zram for swap stuff
|
|
zramSwap.enable = true;
|
|
|
|
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
|
system.stateVersion = "23.11";
|
|
}
|