Files
nixos-config/hosts/common/default.nix

74 lines
1.9 KiB
Nix
Raw Normal View History

2024-10-20 00:30:58 +02:00
# Common configuration for all hosts
2026-01-03 09:31:59 +01:00
{ config, pkgs, lib, inputs, outputs, ... }: {
2024-10-20 00:30:58 +02:00
imports = [
./extraServices
./ports.nix
2024-10-20 00:30:58 +02:00
./users
inputs.home-manager.nixosModules.home-manager
];
2026-01-03 09:31:59 +01:00
environment.pathsToLink =
[ "/share/xdg-desktop-portal" "/share/applications" ];
2025-02-12 11:12:32 +01:00
2024-10-20 00:30:58 +02:00
home-manager = {
useUserPackages = true;
2026-01-03 09:31:59 +01:00
extraSpecialArgs = {
inherit inputs outputs;
videoDrivers = config.services.xserver.videoDrivers or [ ];
};
2024-10-20 00:30:58 +02:00
};
2026-01-03 09:31:59 +01:00
2024-10-20 00:30:58 +02:00
nixpkgs = {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
#outputs.overlays.additions
#outputs.overlays.modifications
2024-10-20 00:30:58 +02:00
outputs.overlays.stable-packages
2025-03-28 10:00:43 +01:00
outputs.overlays.locked-packages
2024-11-07 10:50:13 +01:00
outputs.overlays.pinned-packages
outputs.overlays.master-packages
2024-10-20 00:30:58 +02:00
inputs.m3ta-nixpkgs.overlays.default
inputs.m3ta-nixpkgs.overlays.modifications
2024-10-20 00:30:58 +02:00
# 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 ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
};
};
nix = {
settings = {
experimental-features = "nix-command flakes";
2024-11-07 10:50:13 +01:00
cores = 2;
max-jobs = 8;
2024-10-20 00:30:58 +02:00
trusted-users = [
"root"
"m3tam3re"
]; # Set users that are allowed to use the flake command
};
gc = {
automatic = true;
2024-11-07 10:50:13 +01:00
dates = "weekly";
2024-10-20 00:30:58 +02:00
options = "--delete-older-than 30d";
};
optimise.automatic = true;
2026-01-03 09:31:59 +01:00
registry = (lib.mapAttrs (_: flake: { inherit flake; }))
2024-10-20 00:30:58 +02:00
((lib.filterAttrs (_: lib.isType "flake")) inputs);
2026-01-03 09:31:59 +01:00
nixPath = [ "/etc/nix/path" ];
2024-10-20 00:30:58 +02:00
};
2025-05-04 10:53:18 +02:00
users.defaultUserShell = pkgs.nushell;
2024-10-20 00:30:58 +02:00
}