2023-01-24 02:24:40 +07:00
|
|
|
{
|
|
|
|
description = "NixOS configuration";
|
|
|
|
|
|
|
|
inputs = {
|
2023-02-19 19:09:38 +07:00
|
|
|
# nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs";
|
2023-01-24 02:24:40 +07:00
|
|
|
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
|
|
|
|
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
2023-02-03 13:07:57 +07:00
|
|
|
impermanence.url = "github:nix-community/impermanence";
|
|
|
|
# simply make rust-overlay available for the whole system
|
|
|
|
rust-overlay = {
|
|
|
|
url = "github:oxalica/rust-overlay";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-02-11 23:30:19 +07:00
|
|
|
nix-gaming = {
|
|
|
|
url = "github:fufexan/nix-gaming";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-01-24 02:24:40 +07:00
|
|
|
};
|
|
|
|
|
2023-02-11 23:30:19 +07:00
|
|
|
outputs = inputs@{ self, nixpkgs, utils, nixos-hardware, rust-overlay, impermanence, nix-gaming }:
|
2023-01-24 02:24:40 +07:00
|
|
|
let
|
|
|
|
hw = nixos-hardware.nixosModules;
|
|
|
|
# IRL-related stuff I'd rather not put into git
|
2023-01-25 01:33:07 +07:00
|
|
|
priv = if builtins.pathExists ./private.nix then (import ./private.nix) else {};
|
2023-01-24 16:05:19 +07:00
|
|
|
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
|
2023-02-19 19:09:38 +07:00
|
|
|
./common/ccache.nix
|
2023-01-24 02:24:40 +07:00
|
|
|
{
|
|
|
|
# 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
|
2023-02-03 13:07:57 +07:00
|
|
|
impermanence.nixosModule
|
2023-02-11 23:30:19 +07:00
|
|
|
nix-gaming.nixosModules.pipewireLowLatency
|
2023-01-24 02:24:40 +07:00
|
|
|
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
|
2023-01-24 16:05:19 +07:00
|
|
|
(getPriv "nixmsi")
|
2023-01-24 02:24:40 +07:00
|
|
|
];
|
2023-02-13 21:56:34 +07:00
|
|
|
extraArgs = {
|
|
|
|
inherit nixpkgs;
|
|
|
|
};
|
2023-01-24 02:24:40 +07:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|