nixcfg/hosts/common/default.nix

63 lines
1.6 KiB
Nix
Raw Normal View History

2024-08-28 15:35:11 +02:00
# Common configuration for all hosts
{
2024-09-03 18:01:56 +02:00
pkgs,
2024-08-28 15:35:11 +02:00
lib,
inputs,
outputs,
...
}: {
2024-08-28 16:16:23 +02:00
imports = [
2024-09-21 16:59:39 +02:00
./extraServices
2024-08-28 16:16:23 +02:00
./users
inputs.home-manager.nixosModules.home-manager
];
home-manager = {
useUserPackages = true;
extraSpecialArgs = {inherit inputs outputs;};
};
2024-08-28 15:35:11 +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
outputs.overlays.stable-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 ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
};
};
2024-09-26 14:45:59 +02:00
nix = let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in {
2024-08-28 15:35:11 +02:00
settings = {
experimental-features = "nix-command flakes";
trusted-users = [
"root"
"m3tam3re"
]; # Set users that are allowed to use the flake command
};
gc = {
automatic = true;
options = "--delete-older-than 30d";
};
optimise.automatic = true;
2024-09-26 14:45:59 +02:00
registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs;
nixPath = ["/etc/nix/path"] ++ lib.mapAttrsToList (flakeName: _: "${flakeName}=flake:${flakeName}") flakeInputs;
2024-08-28 15:35:11 +02:00
};
2024-09-03 18:01:56 +02:00
users.defaultUserShell = pkgs.fish;
2024-08-28 15:35:11 +02:00
}