nixos/flake.nix

69 lines
1.7 KiB
Nix

{
description = "snowhawk: a nixos configuration flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
neovim-overlay.url = "github:nix-community/neovim-nightly-overlay";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
fish_theme = {
url = "git+https://git.zynh.me/Zynh0722/omf-theme";
flake = false;
};
backgrounds = {
url = "git+https://git.zynh.me/Zynh0722/backgrounds";
};
};
outputs =
{ self, nixpkgs, ... }@inputs:
{
nixosConfigurations =
let
lib = import ./lib { inherit (nixpkgs) lib; };
toPartialNixosConfig =
{ hostname, system }:
{
name = hostname;
value = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; };
modules = [
./hosts/${hostname}/hardware-configuration.nix
./hosts/${hostname}/configuration.nix
inputs.home-manager.nixosModules.default
];
};
};
compileSystems =
systems:
lib.right
builtins.listToAttrs
(map toPartialNixosConfig)
systems;
in
compileSystems
[
{
hostname = "snowhawk";
system = "x86_64-linux";
}
{
hostname = "sprite";
system = "aarch64-linux";
}
{
hostname = "nixos";
system = "x86_64-linux";
}
];
};
}