nixos/flake.nix

83 lines
2.1 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";
inputs.nixpkgs.follows = "nixpkgs";
};
dunst-theme = {
url = "github:d2718nis/rose-pine-dunst";
flake = false;
};
};
outputs =
{ self, nixpkgs, ... }@inputs:
{
nixosConfigurations =
let
lib = import ./lib 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";
}
];
homeConfigurations."zynh@msiserver" = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."x86_64-linux";
extraSpecialArgs = { inherit inputs; };
modules = [
./hosts/msiserver/home.nix
];
};
};
}