nixos-config/flake.nix

158 lines
5.2 KiB
Nix
Raw Normal View History

2024-07-30 22:56:44 +02:00
{
description = "Moe.OS";
2024-08-28 19:10:11 +02:00
2024-08-16 22:28:06 +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";
};
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-08-30 21:34:02 +02:00
jovian.url = "github:Jovian-Experiments/Jovian-NixOS/development";
2024-08-25 18:52:45 +02:00
nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1";
2024-07-30 22:56:44 +02:00
};
2024-08-31 11:54:39 +02:00
outputs = { nixpkgs, home-manager, plasma-manager, jovian, nix-flatpak, ... }:
2024-08-28 19:10:11 +02:00
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
lib = nixpkgs.lib;
2024-08-30 21:34:02 +02:00
# External Modules
2024-08-31 11:54:39 +02:00
externalSystemModules = [
home-manager.nixosModules.home-manager
jovian.nixosModules.jovian
nix-flatpak.nixosModules.nix-flatpak
];
externalUserModules = [ plasma-manager.homeManagerModules.plasma-manager ];
2024-08-30 21:34:02 +02:00
# System Module groups
baseSystemModules = [
./modules/system/apps-shell
./modules/system/boot
./modules/system/devices
./modules/system/home-manager
./modules/system/locale
./modules/system/networking
./modules/system/nixsettings
./modules/system/shell
2024-08-30 22:18:24 +02:00
./modules/system/ssh
2024-08-30 21:34:02 +02:00
./modules/system/systemversion
./modules/system/upgrades
./modules/system/users
];
desktopSystemModules = [
./modules/system/ai
./modules/system/apps-misc
./modules/system/browser
./modules/system/flatpak
2024-09-04 13:18:53 +02:00
./modules/system/gnome
2024-08-30 21:34:02 +02:00
];
displaySystemModules = [
2024-09-04 12:47:44 +02:00
./modules/system/gdm
2024-08-30 21:34:02 +02:00
];
gamingSystemModules = [
./modules/system/controller
./modules/system/lact
./modules/system/retrodeck
./modules/system/steam
2024-08-28 19:10:11 +02:00
];
2024-08-30 21:34:02 +02:00
serverSystemModules = [
./modules/system/docker
];
# USER Module groups
baseUserModules = [
./modules/user/git
./modules/user/homeversion
./modules/user/shell
];
desktopUserModules = [
2024-09-04 12:47:44 +02:00
./modules/user/gnome
2024-08-28 19:10:11 +02:00
];
2024-08-30 21:34:02 +02:00
gamingUserModules = [];
serverUserModules = [];
2024-08-28 19:10:11 +02:00
in
{
nixosConfigurations = {
workstation =
let
user = "mo";
hostName = "workstation";
in
lib.nixosSystem {
2024-08-30 21:52:50 +02:00
specialArgs = {inherit user; inherit hostName; inherit system;};
2024-08-30 21:34:02 +02:00
modules = externalSystemModules ++ baseSystemModules ++ desktopSystemModules ++ displaySystemModules ++ gamingSystemModules ++ [
2024-08-28 19:10:11 +02:00
./hosts/${hostName}
./modules/system/jovian-${hostName}
2024-08-31 13:39:45 +02:00
./modules/system/syncthing-${hostName}
2024-08-28 19:10:11 +02:00
{
2024-08-30 21:52:50 +02:00
home-manager.users.${user}.imports = baseUserModules ++ desktopUserModules ++ gamingUserModules ++ [
];
home-manager.extraSpecialArgs = { inherit user; inherit hostName;};
home-manager.sharedModules = externalUserModules;
}
];
};
konsole =
let
user = "deck";
hostName = "konsole";
in
lib.nixosSystem {
specialArgs = {inherit user; inherit hostName; inherit system;};
modules = externalSystemModules ++ baseSystemModules ++ desktopSystemModules ++ gamingSystemModules ++ [
./hosts/${hostName}
./modules/system/jovian-${hostName}
2024-08-31 13:39:45 +02:00
./modules/system/syncthing-${hostName}
2024-08-30 21:52:50 +02:00
{
home-manager.users.${user}.imports = baseUserModules ++ desktopUserModules ++ gamingUserModules ++ [
];
home-manager.extraSpecialArgs = { inherit user; inherit hostName;};
home-manager.sharedModules = externalUserModules;
}
];
};
steamdeck =
let
user = "deck";
hostName = "steamdeck";
in
lib.nixosSystem {
specialArgs = {inherit user; inherit hostName; inherit system;};
modules = externalSystemModules ++ baseSystemModules ++ desktopSystemModules ++ gamingSystemModules ++ [
./hosts/${hostName}
./modules/system/jovian-${hostName}
2024-08-31 13:39:45 +02:00
./modules/system/syncthing-${hostName}
2024-08-30 21:52:50 +02:00
{
home-manager.users.${user}.imports = baseUserModules ++ desktopUserModules ++ gamingUserModules ++ [
];
home-manager.extraSpecialArgs = { inherit user; inherit hostName;};
home-manager.sharedModules = externalUserModules;
}
];
};
server =
let
user = "administrator";
hostName = "server";
in
lib.nixosSystem {
specialArgs = {inherit user; inherit hostName; inherit system;};
modules = externalSystemModules ++ baseSystemModules ++ serverSystemModules ++ [
./hosts/${hostName}
2024-08-31 13:39:45 +02:00
./modules/system/syncthing-${hostName}
2024-08-30 21:52:50 +02:00
{
home-manager.users.${user}.imports = baseUserModules ++ serverUserModules ++ [
2024-08-28 19:10:11 +02:00
];
2024-08-30 18:13:23 +02:00
home-manager.extraSpecialArgs = { inherit user; inherit hostName;};
2024-08-30 21:34:02 +02:00
home-manager.sharedModules = externalUserModules;
2024-08-24 12:18:11 +02:00
}
];
};
2024-07-30 22:56:44 +02:00
};
2024-08-28 19:10:11 +02:00
};
2024-07-30 22:56:44 +02:00
}