mirror of
https://github.com/Moe1369/nixos-config.git
synced 2024-10-18 04:14:08 +02:00
This commit is contained in:
parent
6075aec39a
commit
fcae4c2d1f
115
flake.nix
115
flake.nix
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
description = "Moe.OS";
|
description = "Moe.OS";
|
||||||
|
# Define Inputs
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "nixpkgs/nixos-unstable";
|
nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||||
home-manager = {
|
home-manager = {
|
||||||
@ -14,13 +14,21 @@
|
|||||||
inputs.home-manager.follows = "home-manager";
|
inputs.home-manager.follows = "home-manager";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
# Define Outputs, import Modules
|
||||||
outputs = { nixpkgs, home-manager, jovian, plasma-manager, ... }:
|
outputs =
|
||||||
|
{
|
||||||
|
nixpkgs,
|
||||||
|
home-manager,
|
||||||
|
jovian,
|
||||||
|
plasma-manager,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
|
# Define system globally since I have no aarch devices
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
lib = nixpkgs.lib;
|
lib = nixpkgs.lib;
|
||||||
|
# NixOS Modules for all hosts
|
||||||
systemModules = [
|
systemModules = [
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
./modules/system/apps-shell
|
./modules/system/apps-shell
|
||||||
@ -35,22 +43,31 @@
|
|||||||
./modules/system/upgrades
|
./modules/system/upgrades
|
||||||
./modules/system/users
|
./modules/system/users
|
||||||
];
|
];
|
||||||
|
# Home Manager Modules for all hosts
|
||||||
userModules = [
|
userModules = [
|
||||||
./modules/user/git
|
./modules/user/git
|
||||||
./modules/user/homeversion
|
./modules/user/homeversion
|
||||||
];
|
];
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
workstation = let
|
# Workstation config
|
||||||
user = "mo";
|
# user and hostName variable inside hostConfig so we can call it in other modules
|
||||||
hostName = "workstation";
|
workstation =
|
||||||
in
|
let
|
||||||
|
user = "mo";
|
||||||
|
hostName = "workstation";
|
||||||
|
in
|
||||||
lib.nixosSystem {
|
lib.nixosSystem {
|
||||||
inherit system;
|
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit systemModules userModules user hostName;
|
inherit systemModules;
|
||||||
|
inherit userModules;
|
||||||
|
inherit system;
|
||||||
|
inherit user;
|
||||||
|
inherit hostName;
|
||||||
};
|
};
|
||||||
|
system = system;
|
||||||
|
# Device specific NixOS Modules
|
||||||
modules = systemModules ++ [
|
modules = systemModules ++ [
|
||||||
jovian.nixosModules.jovian
|
jovian.nixosModules.jovian
|
||||||
./hosts/${hostName}
|
./hosts/${hostName}
|
||||||
@ -63,48 +80,52 @@
|
|||||||
./modules/system/plasma
|
./modules/system/plasma
|
||||||
./modules/system/steam
|
./modules/system/steam
|
||||||
{
|
{
|
||||||
|
# Device specific Home Manager Modules
|
||||||
home-manager.users.${user}.imports = userModules ++ [
|
home-manager.users.${user}.imports = userModules ++ [
|
||||||
./modules/user/plasma
|
./modules/user/plasma
|
||||||
];
|
];
|
||||||
|
# Issue with Plasma Manager, has to be imported in a special way
|
||||||
home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ];
|
home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
steamdeck = let
|
|
||||||
user = "deck";
|
|
||||||
hostName = "steamdeck";
|
|
||||||
in
|
|
||||||
lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
specialArgs = {
|
|
||||||
inherit systemModules userModules user hostName;
|
|
||||||
};
|
|
||||||
modules = systemModules ++ [
|
|
||||||
jovian.nixosModules.jovian
|
|
||||||
./hosts/${hostName}
|
|
||||||
./modules/system/apps-misc
|
|
||||||
./modules/system/browser
|
|
||||||
./modules/system/controller
|
|
||||||
./modules/system/jovian-${hostName}
|
|
||||||
./modules/system/lact
|
|
||||||
./modules/system/plasma
|
|
||||||
./modules/system/steam
|
|
||||||
{
|
|
||||||
home-manager.users.${user}.imports = userModules ++ [
|
|
||||||
./modules/user/plasma
|
|
||||||
];
|
|
||||||
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} ];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
# 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 {
|
||||||
|
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
|
||||||
|
./modules/system/jovian-${hostName}
|
||||||
|
./modules/system/lact
|
||||||
|
./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 ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user