Compare commits

...

2 Commits

Author SHA1 Message Date
18f0a37407 wip 2024-10-05 19:00:35 -07:00
ff3a0a4738 [roles] No config change unless enabled 2024-10-05 18:17:42 -07:00
10 changed files with 106 additions and 88 deletions

View File

@@ -55,13 +55,12 @@
system = "x86_64-linux";
modules = baseModules ++ [
./machines/boxy/configuration.nix
# inputs.home-manager.nixosModules.home-manager
# {
# home-manager.users.johno = import ./home/home-default.nix;
# home-manager.extraSpecialArgs.customPkgs =
# nixpkgs.legacyPackages."${system}".callPackage ./packages {};
# customPkgs = nixpkgs.legacyPackages."${system}".callPackage ./packages {};
# }
inputs.home-manager.nixosModules.home-manager
{
home-manager.users.johno = import ./home/home-default.nix;
home-manager.extraSpecialArgs.customPkgs =
nixpkgs.legacyPackages."${system}".callPackage ./packages {};
}
];
};
};

View File

@@ -17,8 +17,9 @@ with lib;
kodi = {
enable = true;
autologin = true;
wayland = false;
wayland = true;
};
users.enable = true;
};
# Use the systemd-boot EFI boot loader.
@@ -29,7 +30,7 @@ with lib;
hardware.graphics.enable = true;
#services.displayManager.enable = mkForce false;
services.displayManager.enable = mkForce false;
# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.

View File

@@ -10,7 +10,7 @@ in
enable = mkEnableOption "Enable the audio role";
};
config =
config = mkIf cfg.enable
{
environment.systemPackages = with pkgs; [
paprefs

View File

@@ -10,7 +10,7 @@ in
enable = mkEnableOption "Enable the bluetooth role";
};
config =
config = mkIf cfg.enable
{
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;

View File

@@ -25,7 +25,8 @@ in
steam-library
youtube
]);
in {
in mkIf cfg.enable
{
users.extraUsers.kodi.isNormalUser = true;
networking.firewall = {
@@ -33,14 +34,21 @@ in
allowedUDPPorts = [ 8080 ];
};
services = mkIf cfg.autologin {
services = if cfg.autologin then mkMerge [
mkIf cfg.wayland {
cage = mkIf cfg.wayland {
user = "kodi";
program = "${kodiPkg}/bin/kodi-standalone";
enable = true;
};
xserver = {
enable = false;
autorun = false;
};
}
xserver = mkIf (!cfg.wayland) {
mkIf (!cfg.wayland) {
xserver = {
enable = true;
desktopManager.kodi = {
enable = true;
@@ -50,14 +58,14 @@ in
enable = true;
greeter.enable = false;
};
displayManager.sddm.enable = mkForce false;
};
displayManager = mkIf (!cfg.wayland) {
displayManager = {
autoLogin.enable = true;
autoLogin.user = "kodi";
defaultSession = "kodi";
sessionData.autologinSession = "kodi";
};
};
}
] else {};
};
}

View File

@@ -16,7 +16,8 @@ in
};
};
config = {
config = mkIf cfg.enable
{
fileSystems."/media" = {
device = "10.0.0.43:/media";
fsType = "nfs";

View File

@@ -2,12 +2,16 @@
with lib;
let
cfg = config.roles.printing;
in
{
options.roles.printing = {
enable = mkEnableOption "Enable default printing setup";
};
config = {
config = mkIf cfg.enable
{
services.printing.enable = true;
services.avahi = {

View File

@@ -10,7 +10,8 @@ in
enable = mkEnableOption "Enable the spotifyd role";
};
config = {
config = mkIf cfg.enable
{
roles.audio.enable = true;
services.spotifyd = {

View File

@@ -21,7 +21,7 @@ in
kidsPackages = with pkgs; [
firefox
];
in {
in mkIf cfg.enable {
users.users.johno = {
isNormalUser = true;
description = "John Ogle";

View File

@@ -2,12 +2,16 @@
with lib;
let
cfg = config.roles.virtualisation;
in
{
options.roles.virtualisation = {
enable = mkEnableOption "Enable virtualisation";
};
config = {
config = mkIf cfg.enable
{
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
};