80 lines
2.1 KiB
Nix
80 lines
2.1 KiB
Nix
{
|
|
description = "NixOS + Home Manager flake (root)";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
|
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager/release-25.11";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
todo.url = "github:sioodmy/todo";
|
|
|
|
zen-browser = {
|
|
url = "github:0xc000022070/zen-browser-flake";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
inputs.home-manager.follows = "home-manager";
|
|
};
|
|
|
|
# Per-user settings (override locally; keep stub tracked)
|
|
personal = {
|
|
url = "path:./personal.stub.nix";
|
|
flake = false;
|
|
};
|
|
|
|
# Per-machine hardware config (override locally; keep stub tracked)
|
|
hw = {
|
|
url = "path:./nixos/hardware-stub.nix";
|
|
flake = false;
|
|
};
|
|
};
|
|
|
|
outputs = inputs@{ self, nixpkgs, home-manager, ... }:
|
|
let
|
|
system = "x86_64-linux";
|
|
|
|
personal = import inputs.personal;
|
|
|
|
username = personal.username or "krosh";
|
|
host = personal.host or "loki-nixos";
|
|
|
|
gitName = personal.gitName or "Dmitrii Gudov";
|
|
gitEmail = personal.gitEmail or "gudovdo@my.msu.ru";
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in {
|
|
homeConfigurations.${username} =
|
|
home-manager.lib.homeManagerConfiguration {
|
|
inherit pkgs;
|
|
modules = [ ./home-manager/home.nix ];
|
|
extraSpecialArgs = { inherit inputs username gitName gitEmail; };
|
|
};
|
|
|
|
nixosConfigurations.${host} = nixpkgs.lib.nixosSystem {
|
|
inherit system;
|
|
|
|
# if your NixOS modules want these too
|
|
specialArgs = { inherit inputs username gitName gitEmail; };
|
|
|
|
modules = [
|
|
# hardware-configuration comes from `inputs.hw`
|
|
(import inputs.hw)
|
|
|
|
./nixos/configuration.nix
|
|
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
|
|
home-manager.users.${username} = import ./home-manager/home.nix;
|
|
home-manager.extraSpecialArgs = {
|
|
inherit inputs username gitName gitEmail;
|
|
};
|
|
}
|
|
];
|
|
};
|
|
};
|
|
}
|