grimm-nixos-laptop/flake.nix

93 lines
2.9 KiB
Nix
Raw Normal View History

2023-11-28 23:36:44 +01:00
{
description = "grimmauld-nixos";
inputs = {
nixpkgs = {
2024-03-02 23:15:51 +01:00
url = "github:NixOS/nixpkgs/nixos-unstable";
2024-04-20 19:50:23 +02:00
# url = "git+file:///home/grimmauld/coding/nixpkgs";
2023-11-28 23:36:44 +01:00
};
nixpkgs-stable = {
url = "github:NixOS/nixpkgs/nixos-23.11";
};
2024-03-09 18:24:55 +01:00
chaotic = {
url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-03-24 16:59:47 +01:00
nix-gaming = {
url = "github:fufexan/nix-gaming";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-04-18 21:16:40 +02:00
nix-locate = {
url = "github:nix-community/nix-index";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-04-20 19:50:23 +02:00
hammering = {
url = "github:jtojnar/nixpkgs-hammering";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-11-28 23:36:44 +01:00
};
2024-04-20 19:50:23 +02:00
outputs = inputs @ { self, nix-gaming, agenix, hammering, nixpkgs, nixpkgs-stable, nix-locate, chaotic, ... }:
2024-04-10 16:51:28 +02:00
let
2024-04-26 11:44:59 +02:00
patches = [
{
2024-05-02 21:08:38 +02:00
# tlpui
2024-04-26 11:44:59 +02:00
url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/305278.patch";
hash = "sha256-8RvPI8Id+Ttgv07IMBTAxkSc+K00WhiWgdgrCcULd7o=";
}
2024-05-02 21:08:38 +02:00
{
# xdg term
url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/303225.patch";
2024-05-04 23:32:31 +02:00
hash = "sha256-+CBCMeBc5NqtjaUUTX1DBKhlFlKf1G6ovWrAo6xHH+I=";
2024-05-02 21:08:38 +02:00
}
2024-04-26 11:44:59 +02:00
];
customNixosSystem = system: definitions:
let
stable = import nixpkgs-stable {
inherit system;
config.allowUnfree = true;
};
overlays = if (builtins.hasAttr "overlays" definitions) then definitions.overlays else [ ];
unpatched = nixpkgs.legacyPackages.${system};
patched = unpatched.applyPatches {
name = "nixpkgs-patched";
src = inputs.nixpkgs;
patches = map unpatched.fetchpatch patches;
};
2024-04-26 11:44:59 +02:00
nixosSystem = import (patched + "/nixos/lib/eval-config.nix");
in
nixosSystem ({
inherit system;
modules = definitions.modules ++ [
({ config, lib, ... }: {
nixpkgs.overlays = map (f: (final: prev: (import f { inherit final prev lib config; }))) overlays;
})
];
2024-04-26 11:44:59 +02:00
specialArgs = { inherit inputs system stable; };
} // builtins.removeAttrs definitions [ "overlays" "modules" ]);
2024-04-10 16:51:28 +02:00
in
{
nixosConfigurations = {
2024-04-26 12:55:44 +02:00
grimmauld-nixos = customNixosSystem "x86_64-linux" {
overlays = import ./overlays;
2024-04-10 16:51:28 +02:00
modules = [
agenix.nixosModules.default
chaotic.nixosModules.default
nix-gaming.nixosModules.pipewireLowLatency
2024-04-30 12:32:03 +02:00
./common
2024-04-10 16:51:28 +02:00
./specific/grimm-nixos-laptop/configuration.nix
./configuration.nix
./modules/users.nix
./modules/system-packages.nix
./modules/kvm.nix
];
2024-04-26 12:55:44 +02:00
};
2023-11-28 23:36:44 +01:00
};
};
}