nix/system/configuration.nix
2024-12-05 13:09:38 +11:00

130 lines
2.9 KiB
Nix

{
inputs,
outputs,
lib,
pkgs,
mainUser,
...
}: {
# these settings propagate to home-manager's nixpkgs
nixpkgs = {
overlays = [
inputs.nix-rice.overlays.default
inputs.helix.overlays.default
inputs.nixd.overlays.default
inputs.niri.overlays.niri
outputs.overlays.additions
outputs.overlays.rice
outputs.overlays.murex
outputs.overlays.murex-starship
outputs.overlays.murex-jump
outputs.overlays.comfyui
outputs.overlays.comfyui-plugins
outputs.overlays.sirula
];
config = {
allowUnfree = true;
allowUnfreePredicate = _: true;
cudaSupport = true;
};
};
nix = {
# add flake inputs to our registry to allow global use
registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
settings = {
# trusted-users = ["bolt" "plank"];
experimental-features = ["nix-command" "flakes" "pipe-operator"];
substitute = true;
};
extraOptions = ''
keep-outputs = true
keep-derivations = true
'';
optimise.automatic = true;
# package = pkgs.lix;
};
imports = [
./modules/network.nix
./modules/term.nix
./modules/systemdboot.nix
./modules/sound.nix
./modules/sydney.nix
./modules/docs.nix
./modules/nix-meta.nix
./modules/anal-retentive.nix
./modules/niri.nix
];
hardware.enableRedistributableFirmware = true;
hardware.enableAllFirmware = true;
boot.tmp.useTmpfs = true;
services.udev.extraHwdb = ''
evdev:atkbd:*
KEYBOARD_KEY_3a=esc
'';
# services.xserver.xkb.options = "caps:swapescape";
services.xserver.xkb.extraLayouts."swap" = {
description = "caps swap";
languages = [ "eng" ];
symbolsFile = pkgs.writeText "keyboard" ''
xkb_symbols
{
include "us(basic)"
key <CAPS> {[ Escape ]};
}
'';
};
services.kmscon.useXkbConfig = true;
console.useXkbConfig = true;
services.libinput.enable = true;
hardware.graphics.enable = true;
hardware.graphics.enable32Bit = true;
services.udisks2.enable = true;
# services.flatpak.enable = true;
security.polkit.enable = true;
xdg.autostart.enable = true;
xdg.portal.enable = true;
# services.tailscale.enable = true;
environment.systemPackages = with pkgs; [
curl
eza
git
jujutsu
];
services.atuin.enable = true;
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 3d --keep 3";
package = inputs.nh.packages.x86_64-linux.default;
};
programs.nix-index-database.comma.enable = true;
programs.nix-index.enableZshIntegration = false;
programs.nix-index.enableBashIntegration = false;
# gnome/freedesktop compat stuff
programs.dconf.enable = true;
services.gvfs.enable = true;
# give cpuset to user
systemd.services."user@".serviceConfig.Delegate = "memory pids cpu cpuset";
systemd.user.extraConfig = "LogLevel=debug";
security.pam.services.swaylock = {};
}