grimm-nixos-laptop/fake_flake.nix
2024-05-07 15:14:12 +02:00

62 lines
1.8 KiB
Nix

{ pkgs, lib, config, ... }:
let
nivSources = import ./nix/sources.nix;
asGithubRef = src: "github:${src.owner}/${src.repo}/${src.rev}";
nixpkgs_patches = [
{
# tlpui
url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/305278.patch";
hash = "sha256-8RvPI8Id+Ttgv07IMBTAxkSc+K00WhiWgdgrCcULd7o=";
}
];
in
{
imports = [
"${nivSources.agenix}/modules/age.nix"
(import "${nivSources.lix-module}/module.nix" { lix = nivSources.lix-pkg; })
(builtins.getFlake (asGithubRef nivSources.chaotic)).nixosModules.default # fixme: ideally we'd not rely on the flake syntax to load the module
];
nixpkgs.hostPlatform = "x86_64-linux";
system.nixos = {
distroId = "lixos";
distroName = "LixOS";
};
environment.sessionVariables = with config.system.nixos; {
distro = "${distroName} ${version} (${codeName}) ${builtins.currentSystem}";
# NIXPKGS_ALLOW_UNFREE = "1";
};
nixpkgs.pkgs =
let
src = nivSources.nixpkgs;
config = { allowUnfree = true; };
unpatched = import src { inherit config; };
inherit (unpatched) applyPatches fetchpatch;
in
import
(applyPatches {
name = "nixpkgs-patched";
inherit src;
patches = map fetchpatch nixpkgs_patches;
}) { inherit config; };
nixpkgs.overlays = lib.singleton (
final: prev: { agenix = final.callPackage "${nivSources.agenix}/pkgs/agenix.nix" { }; }
);
nix.settings.extra-substituters = [
"https://cache.lix.systems"
"https://nyx.chaotic.cx/"
];
nix.settings.trusted-public-keys = [
"cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
"nyx.chaotic.cx-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
"chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
];
}