nix/nixos/default.nix
2025-03-03 23:10:07 -06:00

70 lines
1.6 KiB
Nix

{
inputs,
lib,
config,
pkgs,
system,
...
}: {
imports = [
./1password.nix
./audio.nix
./bluetooth.nix
./displaymanager.nix
./keyd.nix
];
nix = let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in {
settings = {
# Enable flakes and new 'nix' command
experimental-features = "nix-command flakes";
# Opinionated: disable global registry
flake-registry = "";
# Workaround for https://github.com/NixOS/nix/issues/9574
nix-path = config.nix.nixPath;
};
# Opinionated: disable channels
channel.enable = false;
# 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;
};
# networking
networking.hostId = builtins.substring 0 8 (builtins.hashString "md5" config.networking.hostName);
networking.networkmanager.enable = true;
programs.dconf.enable = true;
services.libinput = {
enable = true;
touchpad = {
disableWhileTyping = true;
naturalScrolling = true;
};
};
security.rtkit.enable = true;
security.polkit.enable = true;
services.openssh = {
enable = true;
settings = {
# Opinionated: forbid root login through SSH.
PermitRootLogin = "no";
# Opinionated: use keys only.
# Remove if you want to SSH using passwords
PasswordAuthentication = false;
};
};
environment.systemPackages = with pkgs; [
vim
htop
];
system.stateVersion = "25.05";
}