Files
Olympus/flake.nix
2024-10-18 10:57:09 -05:00

125 lines
3.6 KiB
Nix

{
description = "Build Entire System";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
nathan.url = "./home";
system.url = "./system";
#system.inputs.diskoConfig.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, ... }@core_inputs: let
system = "x86_64-linux";
iso_system = "x86_64-linux";
host = "laptop";
username = "nathan";
devices = {
main = "/dev/nvme0n1";
bonus = null;
};
in {
inputs.home-manager.useGlobalPkgs = true;
nixosConfigurations.${host} = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit core_inputs;
};
modules = [
core_inputs.system.nixosModule
core_inputs.home-manager.nixosModules.home-manager
({ lib, ... }: {
sysconfig = {
${host}.enable = true;
opts = {
firstBoot = false;
inherit host username devices;
openssh.enable = true;
pipewire.enable = true;
hyprland.enable = true;
git.enable = true;
ags.enable = true;
nh.enable = true;
steam.enable = true;
};
};
#disko.enable = lib.mkForce false;
})
];
};
nixosConfigurations.iso = nixpkgs.lib.nixosSystem {
#inherit iso_system;
specialArgs = {
inherit core_inputs;
};
modules = [
({ pkgs, modulesPath, ... }: {
imports = [
(modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix")
];
nixpkgs.hostPlatform = iso_system;
sysconfig = {
${host}.enable = true;
opts = {
firstBoot = true;
inherit username;
host = "live";
devices = (devices // {
main = "/dev/sda";
bonus = null;
});
openssh.enable = true;
pipewire.enable = true;
hyprland.enable = true;
git.enable = true;
ags.enable = true;
nh.enable = true;
steam.enable = false;
};
};
})
core_inputs.system.nixosModule
core_inputs.home-manager.nixosModules.home-manager
];
};
packages.${iso_system}.default = self.nixosConfigurations.iso.config.system.build.isoImage;
homeConfigurations."nathan" = core_inputs.home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
extraSpecialArgs = { inherit core_inputs; };
modules = [ core_inputs.nathan.homeManagerModule ];
};
};
}