mirror of
https://github.com/eRgo35/nix-config.git
synced 2026-02-04 08:26:12 +01:00
BREAKING-CHANGE: modified structure, hm is now standalone
This commit is contained in:
133
hosts/modules/common.nix
Normal file
133
hosts/modules/common.nix
Normal file
@@ -0,0 +1,133 @@
|
||||
{
|
||||
lib,
|
||||
inputs,
|
||||
outputs,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
time.timeZone = "Europe/Warsaw";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "pl_PL.UTF-8";
|
||||
LC_IDENTIFICATION = "pl_PL.UTF-8";
|
||||
LC_MEASUREMENT = "en_US.UTF-8";
|
||||
LC_MONETARY = "en_US.UTF-8";
|
||||
LC_NAME = "pl_PL.UTF-8";
|
||||
LC_NUMERIC = "en_US.UTF-8";
|
||||
LC_PAPER = "pl_PL.UTF-8";
|
||||
LC_TELEPHONE = "pl_PL.UTF-8";
|
||||
LC_TIME = "en_US.UTF-8";
|
||||
};
|
||||
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
logind = {
|
||||
lidSwitch = "ignore";
|
||||
# lidSwitchExternalPower = if hostname == "server" then "ignore" else "suspend-then-hibernate";
|
||||
lidSwitchExternalPower = "ignore";
|
||||
};
|
||||
|
||||
libinput = {
|
||||
enable = true;
|
||||
# mouse = {
|
||||
# accelProfile = "flat";
|
||||
# accelSpeed = "0.0";
|
||||
# };
|
||||
};
|
||||
};
|
||||
|
||||
environment = {
|
||||
# sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
shells = with pkgs; [bash zsh];
|
||||
};
|
||||
|
||||
system = {
|
||||
stateVersion = "24.05";
|
||||
switch = {
|
||||
enable = false;
|
||||
enableNg = true;
|
||||
};
|
||||
autoUpgrade = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
# You can add overlays here
|
||||
overlays = [
|
||||
# Add overlays your own flake exports (from overlays and pkgs dir):
|
||||
outputs.overlays.additions
|
||||
outputs.overlays.modifications
|
||||
outputs.overlays.unstable-packages
|
||||
|
||||
# You can also add overlays exported from other flakes:
|
||||
# neovim-nightly-overlay.overlays.default
|
||||
|
||||
# Or define it inline, for example:
|
||||
# (final: prev: {
|
||||
# hi = final.hello.overrideAttrs (oldAttrs: {
|
||||
# patches = [ ./change-hello-to-hi.patch ];
|
||||
# });
|
||||
# })
|
||||
];
|
||||
|
||||
config = {
|
||||
# I'm sorry Richard Stallman
|
||||
allowUnfree = true;
|
||||
};
|
||||
};
|
||||
|
||||
documentation = {
|
||||
enable = true;
|
||||
doc.enable = false;
|
||||
man.enable = true;
|
||||
dev.enable = false;
|
||||
info.enable = false;
|
||||
nixos.enable = true;
|
||||
};
|
||||
|
||||
nix = let
|
||||
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
|
||||
in {
|
||||
daemonCPUSchedPolicy = "batch";
|
||||
channel.enable = false;
|
||||
# nixPath = ["nixpkgs=${inputs.nixpkgs}"];
|
||||
|
||||
optimise = {
|
||||
automatic = true;
|
||||
dates = ["daily"];
|
||||
};
|
||||
|
||||
# Opinionated: make flake registry and nix path match flake inputs
|
||||
registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs;
|
||||
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
|
||||
|
||||
settings = {
|
||||
auto-optimise-store = true;
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
flake-registry = "";
|
||||
nix-path = config.nix.nixPath;
|
||||
|
||||
substituters = [
|
||||
"https://cache.nixos.org"
|
||||
"https://hyprland.cachix.org"
|
||||
"https://nix-community.cachix.org"
|
||||
"https://cuda-maintainers.cachix.org"
|
||||
];
|
||||
|
||||
trusted-public-keys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user