Files
NixOsConfig/flake.nix
T
2026-10-12 18:15:38 +03:00

128 lines
3.3 KiB
Nix
Executable File

{
description = "faumaray's NixOS configuration: Hyprland + Noctalia, agenix, disko, lanzaboote";
nixConfig = {
extra-substituters = [
"https://nix-community.cachix.org"
"https://noctalia.cachix.org"
];
allowUnfree = true;
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"noctalia.cachix.org-1:pCOR47nnMEo5thcxNDtzWpOxNFQsBRglJzxWPp3dkU4="
];
};
inputs = {
# Hyprland git and Noctalia v5 both track nixos-unstable.
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
lanzaboote = {
url = "github:nix-community/lanzaboote/v1.2.0";
inputs.nixpkgs.follows = "nixpkgs";
};
proxy-suite = {
url = "github:FUFSoB/proxy-suite-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware";
# Hyprland is consumed through its own overlay (see overlays/default.nix),
# built against our nixpkgs so mesa/libdrm always match the system.
hyprland = {
url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
# No `follows` on purpose: keeps the noctalia.cachix.org binary cache usable.
noctalia.url = "github:noctalia-dev/noctalia";
};
outputs =
{ self, nixpkgs, ... }@inputs:
let
inherit (nixpkgs) lib;
systems = [ "x86_64-linux" ];
forAllSystems = lib.genAttrs systems;
myLib = import ./lib { inherit inputs self lib; };
pkgsFor =
system:
import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
config.allowUnfree = true;
};
in
{
lib = myLib;
overlays = import ./overlays { inherit inputs; };
nixosModules.default = ./modules/nixos;
homeModules.default = ./modules/home;
nixosConfigurations = {
desktop = myLib.mkHost {
hostname = "desktop";
system = "x86_64-linux";
};
# Bootable installer ISO with this flake baked in: `nix build .#iso`.
installer = myLib.mkInstaller { system = "x86_64-linux"; };
};
packages = forAllSystems (system: {
iso = self.nixosConfigurations.installer.config.system.build.isoImage;
});
apps = forAllSystems (
system:
import ./apps {
pkgs = pkgsFor system;
inherit inputs self;
}
);
devShells = forAllSystems (
system:
let
pkgs = pkgsFor system;
in
{
default = pkgs.mkShell {
name = "nixos-config";
packages = [
inputs.agenix.packages.${system}.default
inputs.disko.packages.${system}.disko
pkgs.age
pkgs.ssh-to-age
pkgs.sbctl
pkgs.git
pkgs.nixfmt
pkgs.nixd
pkgs.shellcheck
];
};
}
);
formatter = forAllSystems (system: (pkgsFor system).nixfmt-tree);
};
}