dotfiles/flake.nix
2025-11-25 13:29:02 -05:00

157 lines
3.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";
home-manager = {
url = "github:nix-community/home-manager";
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";
inputs.home-manager.follows = "home-manager";
};
niri = {
url = "github:sodiboo/niri-flake";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs";
};
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs";
};
nix-flatpak.url = "github:gmodena/nix-flatpak/";
nix-doom-emacs-unstraightened = {
url = "github:marienz/nix-doom-emacs-unstraightened";
inputs.nixpkgs.follows = "nixpkgs";
inputs.emacs-overlay.follows = "emacs-overlay";
};
impermanence = {
url = "github:nix-community/impermanence";
};
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs.nixpkgs.follows = "nixpkgs";
};
jovian = {
url = "github:Jovian-Experiments/Jovian-NixOS";
inputs.nixpkgs.follows = "nixpkgs";
};
chaotic = {
url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
inputs = {
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
rust-overlay.follows = "rust-overlay";
jovian.follows = "jovian";
};
};
};
outputs =
{
self,
nixpkgs,
lanzaboote,
nixos-hardware,
home-manager,
deploy-rs,
jovian,
chaotic,
...
}@inputs:
let
username = "primary";
system = "x86_64-linux";
hostnames = [
"mreow"
"yarn"
];
niri-package = inputs.niri.packages.${system}.niri-unstable;
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
niri-package
;
};
modules = [
chaotic.nixosModules.default
home-manager.nixosModules.home-manager
jovian.nixosModules.default
(
{ config, ... }:
{
# home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit
inputs
hostname
username
niri-package
;
homeDirectory = "/home/${username}";
stateVersion = config.system.stateVersion;
};
home-manager.users.${username} = import ./home-manager/home-${hostname}.nix;
}
)
./system/system-${hostname}.nix
];
};
}
) { } hostnames;
# Deploy-rs configuration for yarn host only
deploy.nodes.yarn = {
hostname = "desktop";
profiles.system = {
sshUser = "root";
path = deploy-rs.lib.${system}.activate.nixos self.nixosConfigurations.yarn;
};
};
};
}