nixos-config/flake.nix

219 lines
6.6 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";
};
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-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-28 19:10:11 +02:00
2024-08-16 22:28:06 +02:00
# Define Outputs, import Modules
2024-08-28 19:10:11 +02:00
outputs = {
nixpkgs,
home-manager,
jovian,
plasma-manager,
nix-flatpak,
lanzaboote,
...
}:
let
# Define system globally since I have no aarch devices
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
lib = nixpkgs.lib;
# NixOS Modules for all hosts
systemModules = [
home-manager.nixosModules.home-manager
nix-flatpak.nixosModules.nix-flatpak
./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
./modules/system/systemversion
./modules/system/upgrades
./modules/system/users
];
# Home Manager Modules for all hosts
userModules = [
./modules/user/git
./modules/user/homeversion
./modules/user/shell
];
in
{
nixosConfigurations = {
# Workstation config
workstation =
let
user = "mo";
hostName = "workstation";
in
lib.nixosSystem {
specialArgs = {
inherit systemModules;
inherit userModules;
inherit system;
inherit user;
inherit hostName;
2024-08-16 16:37:35 +02:00
};
2024-08-28 19:10:11 +02:00
system = system;
# Device specific NixOS Modules
modules = systemModules ++ [
jovian.nixosModules.jovian
./hosts/${hostName}
./modules/system/ai
./modules/system/apps-misc
./modules/system/browser
./modules/system/controller
./modules/system/flatpak
./modules/system/jovian-${hostName}
./modules/system/lact
./modules/system/plasma
./modules/system/retrodeck
./modules/system/steam
./modules/system/syncthing
./modules/system/sddm
{
# Device specific Home Manager Modules
home-manager.users.${user}.imports = userModules ++ [
./modules/user/plasma
];
# Issue with Plasma Manager, has to be imported in a special way
2024-08-30 18:13:23 +02:00
home-manager.extraSpecialArgs = { inherit user; inherit hostName;};
2024-08-28 19:10:11 +02:00
home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ];
}
];
};
2024-08-16 22:28:06 +02:00
# Steamdeck config
steamdeck =
let
2024-08-16 16:37:35 +02:00
user = "deck";
hostName = "steamdeck";
in
2024-08-16 22:28:06 +02:00
lib.nixosSystem {
specialArgs = {
inherit systemModules;
inherit userModules;
2024-08-16 16:37:35 +02:00
inherit system;
2024-08-16 22:28:06 +02:00
inherit user;
inherit hostName;
2024-08-16 16:37:35 +02:00
};
2024-08-16 22:28:06 +02:00
system = system;
# Device specific NixOS Modules
modules = systemModules ++ [
jovian.nixosModules.jovian
./hosts/${hostName}
./modules/system/apps-misc
./modules/system/browser
./modules/system/controller
2024-08-27 16:30:44 +02:00
./modules/system/flatpak
2024-08-16 22:28:06 +02:00
./modules/system/jovian-${hostName}
./modules/system/lact
./modules/system/plasma
2024-08-25 18:57:05 +02:00
./modules/system/retrodeck
2024-08-16 22:28:06 +02:00
./modules/system/steam
2024-08-24 11:09:39 +02:00
./modules/system/syncthing
2024-08-16 22:28:06 +02:00
{
# Device specific Home Manager Modules
home-manager.users.${user}.imports = userModules ++ [
./modules/user/plasma
];
# Issue with Plasma Manager, has to be imported in a special way
2024-08-30 18:13:23 +02:00
home-manager.extraSpecialArgs = { inherit user; inherit hostName;};
2024-08-16 22:28:06 +02:00
home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ];
}
];
};
2024-08-24 11:05:33 +02:00
2024-08-28 19:10:11 +02:00
# Konsole config
2024-08-24 11:05:33 +02:00
konsole =
let
user = "deck";
hostName = "konsole";
in
lib.nixosSystem {
specialArgs = {
inherit systemModules;
inherit userModules;
inherit system;
inherit user;
inherit hostName;
};
system = system;
# Device specific NixOS Modules
modules = systemModules ++ [
jovian.nixosModules.jovian
./hosts/${hostName}
./modules/system/apps-misc
./modules/system/browser
./modules/system/controller
2024-08-27 16:30:44 +02:00
./modules/system/flatpak
2024-08-24 11:05:33 +02:00
./modules/system/jovian-${hostName}
./modules/system/lact
./modules/system/plasma
2024-08-25 18:57:05 +02:00
./modules/system/retrodeck
2024-08-24 11:05:33 +02:00
./modules/system/steam
2024-08-24 11:09:39 +02:00
./modules/system/syncthing
2024-08-24 11:05:33 +02:00
{
# Device specific Home Manager Modules
home-manager.users.${user}.imports = userModules ++ [
./modules/user/plasma
];
# Issue with Plasma Manager, has to be imported in a special way
2024-08-30 18:13:23 +02:00
home-manager.extraSpecialArgs = { inherit user; inherit hostName;};
2024-08-24 11:05:33 +02:00
home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ];
}
];
};
2024-08-28 19:10:11 +02:00
# Server config
server =
2024-08-24 12:18:11 +02:00
let
user = "administrator";
hostName = "server";
in
lib.nixosSystem {
specialArgs = {
inherit systemModules;
inherit userModules;
inherit system;
inherit user;
inherit hostName;
};
system = system;
# Device specific NixOS Modules
modules = systemModules ++ [
./hosts/${hostName}
./modules/docker
./modules/system/syncthing
{
# Device specific Home Manager Modules
2024-08-28 19:10:11 +02:00
home-manager.users.${user}.imports = userModules;
2024-08-24 12:18:11 +02:00
# Issue with Plasma Manager, has to be imported in a special way
2024-08-30 18:13:23 +02:00
home-manager.extraSpecialArgs = { inherit user; inherit hostName;};
2024-08-24 12:18:11 +02:00
home-manager.sharedModules = [];
}
];
};
2024-07-30 22:56:44 +02:00
};
2024-08-28 19:10:11 +02:00
};
2024-07-30 22:56:44 +02:00
}