nixos-config/lib/mkSystem.nix

62 lines
1.1 KiB
Nix

{ inputs, config, lib, nur, emacs, ... }:
/*
TODO: Make these arguments unneccessary
Idea: Make miku.nix, mashu.nix, ... have the following structure
{
architecture: "x86_64-linux";
config = { ... }: {
# ...
};
}
*/
{
hostConfigFile
, architecture ? "x86_64-linux"
}: let
pkgs = inputs.nixpkgs;
config = pkgs.lib;
network = import ./network.nix;
util = import ./default.nix {
inherit inputs config lib;
};
in inputs.nixpkgs.lib.nixosSystem {
system = architecture;
modules = [
# User configuration management
inputs.home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
}
# Overlays
(util.mkOverlayFromInput "stable" inputs.stable)
(util.mkOverlayFromInput "unstable" inputs.nixpkgs)
{
nixpkgs.overlays = [
nur.overlay
emacs.overlay
(import ../packages)
(import ../overlays/simple.nix)
];
}
# My module system
(import ../modules)
inputs.ostylk.nixosModules.nftables
# Actual config
(import ./baseSystem.nix)
(import hostConfigFile)
];
specialArgs = {
inherit inputs;
};
}