nixos-config/flake.nix

78 lines
2.4 KiB
Nix
Raw Normal View History

2024-07-30 22:56:44 +02:00
{
description = "Moe.OS";
2024-08-16 15:19:40 +02:00
# Define Inputs
2024-07-30 22:56:44 +02:00
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
2024-08-10 15:47:04 +02:00
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-08-16 14:11:10 +02:00
jovian.url = "github:Jovian-Experiments/Jovian-NixOS/development";
2024-08-10 15:47:04 +02:00
plasma-manager = {
2024-08-11 13:47:17 +02:00
url = "github:nix-community/plasma-manager/trunk";
2024-08-10 15:47:04 +02:00
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
2024-07-30 22:56:44 +02:00
};
2024-08-16 15:19:40 +02:00
# Define Outputs, import Modules
2024-08-16 14:11:10 +02:00
outputs = { nixpkgs, home-manager, jovian, plasma-manager, ...}:
let
2024-08-16 15:19:40 +02:00
# Define system globally since I have no aarch devices
2024-08-16 14:11:10 +02:00
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system;};
lib = nixpkgs.lib;
2024-08-16 15:19:40 +02:00
# NixOS Modules for all hosts
2024-08-16 14:11:10 +02:00
systemModules = [
home-manager.nixosModules.home-manager
./modules/system/apps-shell
./modules/system/boot
./modules/system/devices
./modules/system/locale
./modules/system/networking
./modules/system/nixsettings
./modules/system/shell
./modules/system/systemversion
./modules/system/upgrades
./modules/system/users
];
2024-08-16 15:19:40 +02:00
# Home Manager Modules for all hosts
2024-08-16 14:11:10 +02:00
userModules = [
./modules/user/git
./modules/user/homeversion
];
2024-08-16 14:43:41 +02:00
in
{
2024-08-11 13:47:17 +02:00
2024-08-16 14:11:10 +02:00
nixosConfigurations = {
2024-08-16 15:19:40 +02:00
# user and hostName variable inside hostConfig so we can call it in other modules
2024-08-16 14:43:41 +02:00
computer-mo = let
user = "mo";
hostName = "computer-mo";
in lib.nixosSystem {
2024-08-16 15:03:27 +02:00
specialArgs = {inherit systemModules; inherit userModules; inherit system; inherit user; inherit hostName;};
2024-08-16 14:11:10 +02:00
system = system;
2024-08-16 15:19:40 +02:00
# Device specific NixOS Modules
2024-08-16 14:11:10 +02:00
modules = systemModules ++ [
jovian.nixosModules.jovian
./hosts/${hostName}
./modules/system/apps-misc
./modules/system/browser
./modules/system/controller
./modules/system/jovian-desktop
./modules/system/lact
./modules/system/plasma
./modules/system/steam
{
2024-08-16 15:19:40 +02:00
# Device specific Home Manager Modules
2024-08-16 14:43:41 +02:00
home-manager.users.${user}.imports = userModules ++ [
./modules/user/plasma
];
2024-08-16 15:19:40 +02:00
# Issue with Plasma Manager, has to be imported in a special way
2024-08-16 14:11:10 +02:00
home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ];
}
];
2024-08-11 13:47:17 +02:00
};
2024-07-30 22:56:44 +02:00
};
2024-08-16 14:11:10 +02:00
};
2024-07-30 22:56:44 +02:00
}