revert
Some checks are pending
Flake.lock / build (push) Waiting to run

This commit is contained in:
Mohamed Chrayed 2024-08-16 22:28:06 +02:00
parent 6075aec39a
commit fcae4c2d1f

View File

@ -1,6 +1,6 @@
{
description = "Moe.OS";
# Define Inputs
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
home-manager = {
@ -14,13 +14,21 @@
inputs.home-manager.follows = "home-manager";
};
};
outputs = { nixpkgs, home-manager, jovian, plasma-manager, ... }:
# Define Outputs, import Modules
outputs =
{
nixpkgs,
home-manager,
jovian,
plasma-manager,
...
}:
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
./modules/system/apps-shell
@ -35,22 +43,31 @@
./modules/system/upgrades
./modules/system/users
];
# Home Manager Modules for all hosts
userModules = [
./modules/user/git
./modules/user/homeversion
];
in {
in
{
nixosConfigurations = {
workstation = let
# Workstation config
# user and hostName variable inside hostConfig so we can call it in other modules
workstation =
let
user = "mo";
hostName = "workstation";
in
lib.nixosSystem {
inherit system;
specialArgs = {
inherit systemModules userModules user hostName;
inherit systemModules;
inherit userModules;
inherit system;
inherit user;
inherit hostName;
};
system = system;
# Device specific NixOS Modules
modules = systemModules ++ [
jovian.nixosModules.jovian
./hosts/${hostName}
@ -63,23 +80,33 @@
./modules/system/plasma
./modules/system/steam
{
# 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
home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ];
}
];
};
steamdeck = let
};
# Steamdeck config
# user and hostName variable inside hostConfig so we can call it in other modules
steamdeck =
let
user = "deck";
hostName = "steamdeck";
in
lib.nixosSystem {
inherit system;
specialArgs = {
inherit systemModules userModules user hostName;
inherit systemModules;
inherit userModules;
inherit system;
inherit user;
inherit hostName;
};
system = system;
# Device specific NixOS Modules
modules = systemModules ++ [
jovian.nixosModules.jovian
./hosts/${hostName}
@ -91,20 +118,14 @@
./modules/system/plasma
./modules/system/steam
{
# 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
home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ];
}
] ++ lib.optional (!lib.hasAttr "system.build.isoImage" pkgs.nixos) [
{
# Define ISO only if it hasn't been defined yet
system.build.isoImage = pkgs.nixos.install {
modules = [ ./hosts/${hostName} ];
};
}
];
};
};
};
}