nixos-config/flake.nix

146 lines
4 KiB
Nix

{
description = "NixOS config";
nixConfig = {
extra-substituters = [
"https://nix-community.cachix.org"
"https://nix-gaming.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
];
};
inputs = {
nixpkgs = {
url = "github:nixos/nixpkgs?ref=nixos-25.11";
};
unstable = {
url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
master = {
url = "github:nixos/nixpkgs?ref=master";
};
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
sops-nix.url = "github:Mic92/sops-nix";
home-manager = {
url = "github:nix-community/home-manager?ref=release-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-facter-modules.url = "github:numtide/nixos-facter-modules";
impermanence.url = "github:nix-community/impermanence";
emacs-kylekrein = {
url = "git+https://git.kylekrein.com/kylekrein/emacs-config";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
lanzaboote.url = "github:nix-community/lanzaboote";
# The name "snowfall-lib" is required due to how Snowfall Lib processes your
# flake's inputs.
snowfall-lib = {
url = "git+https://git.kylekrein.com/kylekrein/snowfall-lib"; #"git+file:///home/kylekrein/Git/snowfall-lib";
inputs.nixpkgs.follows = "nixpkgs";
};
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs.nixpkgs.follows = "nixpkgs";
};
pre-commit-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
declarative-jellyfin = {
url = "github:Sveske-Juice/declarative-jellyfin";
inputs.nixpkgs.follows = "nixpkgs";
};
website = {
url = "git+https://git.kylekrein.com/kylekrein/website.git";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs: let
lib = inputs.snowfall-lib.mkLib {
inherit inputs;
src = ./.;
snowfall = {
namespace = "custom";
meta = {
name = "KyleKrein's awesome Nix Flake";
title = "KyleKrein's awesome Nix Flake";
};
};
};
in
lib.mkFlake {
inherit inputs;
src = ./.;
channels-config = {
allowUnfree = true;
permittedInsecurePackages = [
"olm-3.2.16"
];
};
# Per-channel config
channels = {
nixpkgs-libre = {
config = {
allowUnfree = false;
};
input = inputs.nixpkgs;
};
};
# Use custom channel for specific host
#systems.hosts.kylekrein-framework12.channelName = "nixpkgs-x86_64-v4";
overlays = with inputs; [
emacs-kylekrein.overlays.default
];
systems.modules.nixos = with inputs; [
home-manager.nixosModules.home-manager
sops-nix.nixosModules.sops
nixos-facter-modules.nixosModules.facter
home-manager.nixosModules.default
disko.nixosModules.default
chaotic.nixosModules.nyx-cache
chaotic.nixosModules.nyx-overlay
chaotic.nixosModules.nyx-registry
lanzaboote.nixosModules.lanzaboote
impermanence.nixosModules.impermanence
declarative-jellyfin.nixosModules.default
];
templates = import ./templates {};
deploy = lib.mkDeploy {
inherit (inputs) self;
overrides = {
user = "root";
stargate = {
hostname = "kylekrein.com";
remoteBuild = true;
};
kylekrein-homepc.remoteBuild = true;
};
exclude = ["kylekrein-wsl-wm" ];
};
outputs-builder = channels: {
formatter = channels.nixpkgs.alejandra;
};
#schemas = inputs.flake-schemas.schemas;
};
}