grimm-nixos-laptop/flake.nix

143 lines
4.1 KiB
Nix
Raw Normal View History

2024-10-22 22:05:22 +02:00
{
description = "grimmauld-nixos";
inputs = {
nixpkgs = {
2024-12-23 12:18:12 +01:00
url = "github:NixOS/nixpkgs/nixos-unstable";
2024-11-25 14:27:52 +01:00
# url = "git+file:///home/grimmauld/coding/nixpkgs";
2024-10-22 22:05:22 +02:00
};
chaotic = {
url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
2024-11-30 10:47:40 +01:00
url = "github:yaxitech/ragenix";
2024-10-22 22:05:22 +02:00
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-mailserver = {
url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-11-26 19:20:10 +01:00
nixos-matrix-modules = {
2024-10-22 22:05:22 +02:00
url = "github:dali99/nixos-matrix-modules";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-11-26 19:20:10 +01:00
# ranger_udisk_menu.url = "git+https://git.grimmauld.de/Grimmauld/ranger_udisk_menu";
# glibc-eac.url = "github:Frogging-Family/glibc-eac";
2024-10-22 22:05:22 +02:00
aagl-gtk-on-nix = {
url = "github:ezKEa/aagl-gtk-on-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-11-01 16:33:26 +01:00
aa-alias-manager = {
url = "github:LordGrimmauld/aa-alias-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-11-29 22:48:01 +01:00
nixpkgs-update = {
url = "github:nix-community/nixpkgs-update";
# inputs.nixpkgs.follows = "nixpkgs";
};
2024-12-21 21:53:10 +01:00
apparmor-dev = {
url = "github:LordGrimmauld/apparmor-dev";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-12-23 12:18:12 +01:00
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
2024-10-22 22:05:22 +02:00
};
2024-11-26 19:20:10 +01:00
outputs =
inputs@{
self,
agenix,
nixpkgs,
chaotic,
aagl-gtk-on-nix,
nixos-mailserver,
nixos-matrix-modules,
aa-alias-manager,
2024-11-29 22:48:01 +01:00
nixpkgs-update,
2024-12-21 21:53:10 +01:00
apparmor-dev,
2024-12-23 12:18:12 +01:00
home-manager,
2024-11-26 19:20:10 +01:00
...
}:
2024-10-22 22:05:22 +02:00
let
patches = [
2024-12-23 12:18:12 +01:00
# {
# url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/356796.patch";
# hash = "sha256-hiXVdMeoKYbzJ4QxtTF85huRTe4EwgD3E1qXKhJGw1U=";
# }
2024-10-22 22:05:22 +02:00
];
2024-11-26 19:20:10 +01:00
customNixosSystem =
system: definitions:
2024-10-22 22:05:22 +02:00
let
unpatched = nixpkgs.legacyPackages.${system};
patched = unpatched.applyPatches {
name = "nixpkgs-patched";
src = inputs.nixpkgs;
2024-11-26 19:20:10 +01:00
patches = map (p: if (builtins.isPath p) then p else (unpatched.fetchpatch p)) patches;
2024-10-22 22:05:22 +02:00
};
2024-12-23 12:18:12 +01:00
nixosSystem =
if patches == [ ] then nixpkgs.lib.nixosSystem else import (patched + "/nixos/lib/eval-config.nix");
2024-10-22 22:05:22 +02:00
in
2024-11-26 19:20:10 +01:00
nixosSystem (
{
inherit system;
specialArgs = {
inherit inputs system;
};
}
// definitions
);
systems = [
"x86_64-linux"
"aarch64-linux"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
2024-10-22 22:05:22 +02:00
in
{
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
2024-10-22 22:05:22 +02:00
nixosConfigurations = {
grimmauld-nixos = customNixosSystem "x86_64-linux" {
modules = [
agenix.nixosModules.default
chaotic.nixosModules.default
aagl-gtk-on-nix.nixosModules.default
./configuration.nix
2024-11-26 19:20:10 +01:00
2024-10-22 22:05:22 +02:00
./specific/grimm-nixos-laptop/configuration.nix
];
};
grimm-nixos-ssd = customNixosSystem "x86_64-linux" {
modules = [
agenix.nixosModules.default
chaotic.nixosModules.default
aagl-gtk-on-nix.nixosModules.default
./configuration.nix
2024-11-01 16:33:26 +01:00
aa-alias-manager.nixosModules.default
2024-12-21 21:53:10 +01:00
# apparmor-dev.nixosModules.default
2024-11-26 19:20:10 +01:00
2024-10-22 22:05:22 +02:00
./specific/grimm-nixos-ssd/configuration.nix
2024-12-23 12:18:12 +01:00
home-manager.nixosModules.home-manager
./hm
2024-10-22 22:05:22 +02:00
];
};
grimmauld-nixos-server = customNixosSystem "x86_64-linux" {
modules = [
agenix.nixosModules.default
nixos-matrix-modules.nixosModules.default
nixos-mailserver.nixosModules.default
2024-11-26 19:20:10 +01:00
2024-10-22 22:05:22 +02:00
./configuration.nix
./specific/grimmauld-nixos-server/configuration.nix
2024-11-26 19:20:10 +01:00
./modules
2024-10-22 22:05:22 +02:00
];
};
};
};
}