dotfiles/system/flake.nix

45 lines
1.3 KiB
Nix
Raw Normal View History

2023-01-24 02:24:40 +07:00
{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
nixos-hardware.url = "github:NixOS/nixos-hardware";
};
outputs = inputs@{ self, nixpkgs, utils, nixos-hardware }:
let
hw = nixos-hardware.nixosModules;
# IRL-related stuff I'd rather not put into git
priv = if builtins.fileExists ./private.nix then (import ./private.nix inputs) else {};
getPriv = (hostname: with builtins; if hasAttr hostname priv then getAttr hostname priv else {});
2023-01-24 02:24:40 +07:00
in utils.lib.mkFlake {
inherit self inputs;
hostDefaults.modules = [
./common/vfio.nix
{
# make this flake's nixpkgs available to the whole system
nix = {
generateNixPathFromInputs = true;
generateRegistryFromInputs = true;
linkInputs = true;
};
}
];
hosts = {
nixmsi = {
system = "x86_64-linux";
modules = [
./hosts/nixmsi.nix
hw.common-pc-ssd # enables fstrim
hw.common-cpu-amd # microcode
hw.common-cpu-amd-pstate # amd-pstate
hw.common-gpu-amd # configures drivers
hw.common-pc-laptop # enables tlp
(getPriv "nixmsi")
2023-01-24 02:24:40 +07:00
];
};
};
};
}