Files
dotfiles/flake.nix
2026-03-03 14:28:31 -05:00

116 lines
2.9 KiB
Nix

{
description = "System nixOS flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
lanzaboote = {
url = "github:nix-community/lanzaboote";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
chaotic = {
url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko/latest";
inputs.nixpkgs.follows = "nixpkgs";
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser = {
url = "github:0xc000022070/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
niri = {
url = "github:sodiboo/niri-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
lanzaboote,
nixos-hardware,
agenix,
home-manager,
...
}@inputs:
let
username = "primary";
system = "x86_64-linux";
hostnames = [
"mreow"
"yarn"
];
# pkgs =
# (import nixpkgs {
# }).applyPatches
# {
# name = "nixpkgs";
# src = inputs.nixpkgs;
# patches = [
# # https://github.com/NixOS/nixpkgs/pull/67576
# # gimp 3.0
# (builtins.fetchurl {
# url = "https://github.com/NixOS/nixpkgs/pull/67576.diff";
# sha256 = "1idkhfirjba6iywkddyhm980x44kfl9lmp51cyfqrpbq7wlzpnia";
# })
# ];
# };
in
{
formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style;
nixosConfigurations = nixpkgs.lib.foldl' (
config: hostname:
config
// {
"${hostname}" = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs username hostname;
};
modules = [
home-manager.nixosModules.home-manager
(
{ ... }:
{
# home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit inputs hostname username;
homeDirectory = "/home/${username}";
};
home-manager.users.${username} = import ./home-manager/home-${hostname}.nix;
}
)
./etcnixos/system-${hostname}.nix
];
};
}
) { } hostnames;
};
}