feat: profiles
This commit is contained in:
parent
979929ea32
commit
8f10d3a6cf
13 changed files with 71 additions and 133 deletions
|
@ -1,5 +1,10 @@
|
|||
{config, ...}: let
|
||||
{
|
||||
config,
|
||||
marleylib,
|
||||
...
|
||||
}: let
|
||||
inherit (config.marleyos.my) name;
|
||||
inherit (marleylib.module) enabled;
|
||||
in {
|
||||
imports = [./hardware-configuration.nix];
|
||||
|
||||
|
@ -7,7 +12,7 @@ in {
|
|||
|
||||
marleyos = {
|
||||
profiles.server = true;
|
||||
# services.ddclient = enabled;
|
||||
services.ddclient = enabled;
|
||||
};
|
||||
|
||||
users.users = {
|
||||
|
|
|
@ -21,8 +21,6 @@ in {
|
|||
hardware = {
|
||||
nvidia = enabled;
|
||||
};
|
||||
|
||||
mounts.babeshare = enabled;
|
||||
};
|
||||
|
||||
home-manager.users."${name}" = {
|
||||
|
|
13
layout.txt
13
layout.txt
|
@ -3,12 +3,13 @@ modules/${class}/default.nix # imported by easy-hosts.perClass.modules
|
|||
imports = [
|
||||
../base # common across all systems
|
||||
|
||||
./base # common across all ${class} systems
|
||||
./base
|
||||
./hardware
|
||||
./shell # WM/DE
|
||||
./programs
|
||||
# default.nix - turns on/off depending on profile
|
||||
./services
|
||||
# default.nix - turns on/off depending on profile
|
||||
./services
|
||||
|
||||
./profiles.nix # enable/disable items
|
||||
];
|
||||
|
||||
|
||||
|
@ -34,9 +35,9 @@ modules/home/default.nix # HOME MANAGER OPTIONS ONLY
|
|||
|
||||
./shell # WM/DE
|
||||
./programs
|
||||
# default.nix - turns on/off depending on profile
|
||||
# ${program}.nix - OS check here if needed
|
||||
./services
|
||||
# default.nix - turns on/off depending on profile
|
||||
# ${service}.nix - OS check here if needed
|
||||
|
||||
./profiles.nix # enable/disable items
|
||||
];
|
||||
|
|
|
@ -10,5 +10,7 @@
|
|||
|
||||
./programs
|
||||
./services
|
||||
|
||||
./profiles.nix
|
||||
];
|
||||
}
|
||||
|
|
49
modules/nixos/profiles.nix
Normal file
49
modules/nixos/profiles.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
config,
|
||||
marleylib,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.marleyos.profiles;
|
||||
|
||||
inherit (marleylib.module) enabled;
|
||||
in {
|
||||
#
|
||||
### Universal ###
|
||||
marleyos =
|
||||
{
|
||||
programs = {
|
||||
fish = enabled;
|
||||
nh = enabled;
|
||||
};
|
||||
|
||||
services = {
|
||||
docker = enabled;
|
||||
openssh = enabled; # needed for agenix
|
||||
};
|
||||
}
|
||||
#
|
||||
#
|
||||
### Graphical Desktop Profile ###
|
||||
// (lib.optionalAttrs cfg.desktop {
|
||||
mounts.babeshare = enabled;
|
||||
|
||||
shell = {
|
||||
ly = enabled;
|
||||
niri = enabled;
|
||||
};
|
||||
|
||||
services = {
|
||||
mopidy = enabled;
|
||||
protonmail-bridge = enabled;
|
||||
};
|
||||
})
|
||||
#
|
||||
#
|
||||
### Server Profile ###
|
||||
// (lib.optionalAttrs cfg.server {
|
||||
services = {
|
||||
prometheus = enabled;
|
||||
};
|
||||
});
|
||||
}
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./fish.nix
|
||||
./lutris.nix
|
||||
./nh.nix
|
||||
./steam.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.marleyos.programs.lutris;
|
||||
in {
|
||||
options.marleyos.programs.lutris.enable = lib.mkEnableOption "lutris";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
lutris
|
||||
];
|
||||
|
||||
programs.gamemode.enable = true;
|
||||
};
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.marleyos.programs.steam;
|
||||
in {
|
||||
options.marleyos.programs.steam.enable = lib.mkEnableOption "steam";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
|
||||
extraCompatPackages = with pkgs; [
|
||||
proton-ge-bin
|
||||
];
|
||||
|
||||
protontricks.enable = true;
|
||||
};
|
||||
|
||||
programs.gamemode.enable = true;
|
||||
};
|
||||
}
|
|
@ -3,9 +3,9 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.marleyos.programs.hyprlock;
|
||||
cfg = config.marleyos.shell.hyprlock;
|
||||
in {
|
||||
options.marleyos.programs.hyprlock.enable = lib.mkEnableOption "hyprlock";
|
||||
options.marleyos.shell.hyprlock.enable = lib.mkEnableOption "hyprlock";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.hyprlock = {
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.marleyos.services.ly;
|
||||
cfg = config.marleyos.shell.ly;
|
||||
in {
|
||||
options.marleyos.services.ly.enable = lib.mkEnableOption "ly";
|
||||
options.marleyos.shell.ly.enable = lib.mkEnableOption "ly";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.displayManager.ly = {
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.marleyos.wayland.niri;
|
||||
cfg = config.marleyos.shell.niri;
|
||||
in {
|
||||
options.marleyos.wayland.niri.enable = lib.mkEnableOption "niri";
|
||||
options.marleyos.shell.niri.enable = lib.mkEnableOption "niri";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.niri = {
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.marleyos.bundles.desktop;
|
||||
|
||||
inherit (lib.marleyos) enabled disabled;
|
||||
in {
|
||||
options.marleyos.bundles.desktop.enable = lib.mkEnableOption "desktop";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
marleyos = {
|
||||
isDesktop = lib.mkDefault true;
|
||||
|
||||
mounts = {
|
||||
automounts = enabled;
|
||||
babeshare = enabled;
|
||||
};
|
||||
|
||||
appearance = {
|
||||
base = enabled;
|
||||
};
|
||||
|
||||
programs = {
|
||||
cli = enabled;
|
||||
tui = enabled;
|
||||
gui = enabled;
|
||||
|
||||
lutris = lib.mkForce disabled;
|
||||
steam = lib.mkForce disabled;
|
||||
};
|
||||
|
||||
services = {
|
||||
docker = enabled;
|
||||
mopidy = enabled;
|
||||
openssh = enabled; # Needed for agenix.
|
||||
protonmail-bridge = enabled;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.marleyos.bundles.server;
|
||||
|
||||
inherit (lib.marleyos) enabled;
|
||||
in {
|
||||
options.marleyos.bundles.server.enable = lib.mkEnableOption "server";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
marleyos = {
|
||||
isServer = lib.mkDefault true;
|
||||
|
||||
appearance = {
|
||||
base = enabled;
|
||||
};
|
||||
|
||||
programs = {
|
||||
cli = enabled;
|
||||
tui = enabled;
|
||||
};
|
||||
|
||||
services = {
|
||||
docker = enabled;
|
||||
openssh = enabled;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue