nixos/flake.nix

64 lines
1.6 KiB
Nix
Raw Normal View History

2024-08-04 23:45:01 +05:30
{
description = "My homebrew NixOS configurations";
inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable;
home-manager = {
url = github:nix-community/home-manager;
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = github:nix-community/nixvim;
inputs.nixpkgs.follows = "nixpkgs";
};
nethack = {
url = git+https://git.psf.lt/xezo360hye/nethack?shallow=1;
#url = git+ssh://git@git.psf.lt/xezo360hye/nethack?shallow=1;
#url = path:/home/andrey/nethack;
};
# nixpkgs-2405.url = github:nixos/nixpkgs/nixos-24.05;
# hm-2405.url = github:nix-community/home-manager/release-24.05;
};
outputs = { self, nixpkgs, home-manager, nixvim, nethack, ... } @ inputs:
let
inherit (self) outputs;
username = "andrey";
hostnames = [ "tokishiko" "maidena" ];
mkSystem = hostname: {
"${hostname}" = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
system = "x86_64-linux";
modules = [
./system/${hostname}.nix
./hardware/${hostname}.nix
];
};
};
mkHome = hostname: {
"${username}@${hostname}" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = inputs;
modules = [
nixvim.homeManagerModules.nixvim
nethack.homeManagerModules.nethack
./home/${hostname}.nix
];
};
};
merge = fn: nixpkgs.lib.fold nixpkgs.lib.mergeAttrs {} (map fn hostnames);
in {
nixosConfigurations = merge mkSystem;
homeConfigurations = merge mkHome;
};
}
# vim: ts=2 sw=2 et