Compare commits

..

22 Commits

Author SHA1 Message Date
ecaa6dcb83 [flake] update 2025-03-16 15:44:01 -07:00
7729ff7434 [desktop] Fix moonlight package 2025-03-16 15:43:54 -07:00
52c110a505 [boxy] Enhance graphics drivers 2025-03-16 15:43:41 -07:00
d5997575df [boxy] Add sddm config 2025-03-16 14:34:19 -07:00
57bc35101e [kodi] Setup extra groups 2025-03-16 14:34:12 -07:00
6b09b1b0bc [desktop] Add moonlight 2025-03-16 14:33:58 -07:00
1851743a21 [desktop] Finish programs refactor 2025-03-16 14:33:44 -07:00
c6d787f9f5 [boxy] Enable bluetooth 2025-03-16 14:33:00 -07:00
f4a8f9d614 [home] Remove nixpkgs config
Need to find some better way of doing this so that it works across
home-manager-only installations as well as nixos home manager module
installations.
2025-03-08 14:46:47 -08:00
1e01d44f2f wip 2025-03-08 14:46:39 -08:00
39dbe6644c [kodi] Add moonlight-embedded 2025-03-07 14:51:39 -08:00
870e1073dc [home] Switch from gpg-agent to gnome-keyring 2025-03-05 13:30:32 -08:00
c1f132026a [home] Remove some accidental non-working update 2025-03-05 13:25:39 -08:00
5650125d7e Add .goosehints 2025-03-05 13:25:08 -08:00
6536213bd0 [home] Remove autoUpgrade
Flakes make this irrelevant
2025-03-05 13:24:51 -08:00
a0ce3b810e [home] Fix support for non-NixOS systems 2025-03-05 13:24:38 -08:00
abbcfebc97 [doom] Restore 2025-03-05 12:33:45 -08:00
495aba3fef [home] Support standalone home manager 2025-03-05 12:33:32 -08:00
f9bcec74d3 Revert "[audio] Setup squeezelite"
This reverts commit 1d0b3a0367.
2025-03-04 12:50:46 -08:00
97c4d7035c [squeezelite] Disable for now 2025-02-17 12:46:56 -08:00
8abd331619 [home] Add google-cookie-retrieval 2025-02-17 12:44:14 -08:00
aca0afa0dc [flake] Remove z790prors 2025-02-17 12:35:16 -08:00
14 changed files with 162 additions and 165 deletions

View File

@@ -1,21 +1,22 @@
This repository contains NixOS configurations for different machines and roles. Here's a brief overview based on the files present: NixOS Configurations Repository
================================
- **Secrets:** Overview:
- `secrets/secrets.yaml`: Contains secret configurations, possibly encrypted or sensitive data. ---------
This repository hosts modular and reproducible NixOS configurations managed via Nix flakes. It is structured to separate concerns across machine-specific setups, common roles, and custom packages.
- **Packages:** Directory Structure:
- `packages/`: Nix package definitions. ----------------------
• secrets/ - Confidential data (passwords, keys, etc.) required for system configuration.
• packages/ - Custom Nix packages leveraged across various configurations.
• roles/ - Role-based configurations (e.g., kodi, bluetooth) each with its own module (default.nix) for inclusion in machine setups.
• machines/ - Machine-specific configurations (e.g., nix-book, z790prors, boxy, wixos) including configuration.nix and hardware-configuration.nix tailored for each hardware.
• home/ - Home-manager configurations for personal environments and application settings (e.g., home-nix-book.nix, home-z790prors.nix).
- **Flake:** Design Principles:
- `flake.nix` and `flake.lock`: Nix Flake configuration files for managing the Nix environment dependencies. ------------------
• Modularity: Clear separation between roles, machines, and packages allows for flexible and reusable configurations.
• Declarative & Reproducible: Using Nix flakes guarantees a fully declarative setup that can be effortlessly reproduced across systems.
• Scalability: The structure is designed to accommodate adding new roles or machines with minimal disruption to existing configurations.
- **Roles:** This file serves as a concise guide for navigating and understanding the repository from an advanced Nix perspective. Further documentation can be found within the respective directories or individual README files where applicable.
- Various directories like `roles/kodi/`, `roles/bluetooth/`, etc., each containing `default.nix` files which possibly define role-specific configurations and modules.
- **Machines:**
- `machines/`: Machine-specific configurations for different machines like `nix-book`, `z790prors`, `boxy`, and `wixos`.
- Each machine has `configuration.nix` and `hardware-configuration.nix`, detailing the machine's system and hardware configuration.
- **Home:**
- `home/`: Pertains to user-specific configurations with different modules and home environment setups. Contains files like `home-nix-book.nix`, `home-z790prors.nix`, etc.
- Includes specific modules for software like Emacs, tmux, i3+sway, etc.

75
flake.lock generated
View File

@@ -3,11 +3,11 @@
"doomemacs": { "doomemacs": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1736881038, "lastModified": 1742013576,
"narHash": "sha256-i0GVHWoIqDcFB9JmEdd9T+qxrEx3ckBlPfTD/yLoNyg=", "narHash": "sha256-wgzv3IFBxJkAYfLG0vCp1jbajHKrrpFzKZ2BssWVSlo=",
"owner": "doomemacs", "owner": "doomemacs",
"repo": "doomemacs", "repo": "doomemacs",
"rev": "2bc052425ca45a41532be0648ebd976d1bd2e6c1", "rev": "466490c252d06f42a9c165f361de74a6e6abad8d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -26,11 +26,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1739673654, "lastModified": 1742113225,
"narHash": "sha256-J4+OtlyTMcZfVPXkn1ef/hew80KqoOuorp1iUwJqiso=", "narHash": "sha256-tUor57FbLwwy+duUbjq8Ff0TyayK1i50rUbXBfdgfuM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "9ab982da8f82359a7619f25718fb6bd838ca34ce", "rev": "7e13aa507d714371e6ff70a91d76dcb339311773",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -55,6 +55,26 @@
"type": "github" "type": "github"
} }
}, },
"google-cookie-retrieval": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1739823862,
"narHash": "sha256-h08hlS0ImlONZfeemVMzo29PUC3/abdSb9muYO9E048=",
"ref": "refs/heads/main",
"rev": "675f98b0145f908897c4d899836bcb3dad9da79a",
"revCount": 9,
"type": "git",
"url": "https://git.johnogle.info/johno/google-cookie-retrieval.git"
},
"original": {
"type": "git",
"url": "https://git.johnogle.info/johno/google-cookie-retrieval.git"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -62,11 +82,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1739724290, "lastModified": 1741955947,
"narHash": "sha256-dvByZPuVmBgOBLq8GohBy9hEd0/JXj5goXK2OY1Pvgk=", "narHash": "sha256-2lbURKclgKqBNm7hVRtWh0A7NrdsibD0EaWhahUVhhY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "ec130e700959ee10b63eedbc87758d20264a9588", "rev": "4e12151c9e014e2449e0beca2c0e9534b96a26b4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -85,11 +105,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1739694785, "lastModified": 1742122199,
"narHash": "sha256-Ks7hzuFsxAAseVpUQssvbMvDCOrH4evVVU45Vx6wE3E=", "narHash": "sha256-vEdsZd9MmjRYXutcSVnOoR15ikI9yU8Oc9f1UCNvUwI=",
"owner": "marienz", "owner": "marienz",
"repo": "nix-doom-emacs-unstraightened", "repo": "nix-doom-emacs-unstraightened",
"rev": "b8e20ff378f107c03d65d2b1dd849ebfe58fefd5", "rev": "366d3b516d4878e1f93158708015be3dac09a72f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -104,11 +124,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1739718817, "lastModified": 1741870048,
"narHash": "sha256-J3tgc57E41sEVHQtQeCPNAh62NDnZrJCkSlaAj2gYs8=", "narHash": "sha256-odXRdNZGdXg1LmwlAeWL85kgy/FVHsgKlDwrvbR2BsU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NixOS-WSL", "repo": "NixOS-WSL",
"rev": "c084e05fff6b2601de351e1bbee00485bf003f35", "rev": "5d76001e33ee19644a598ad80e7318ab0957b122",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -120,11 +140,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1739357830, "lastModified": 1740865531,
"narHash": "sha256-9xim3nJJUFbVbJCz48UP4fGRStVW5nv4VdbimbKxJ3I=", "narHash": "sha256-h00vGIh/jxcGl8aWdfnVRD74KuLpyY3mZgMFMy7iKIc=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0ff09db9d034a04acd4e8908820ba0b410d7a33a", "rev": "5ef6c425980847c78a80d759abc476e941a9bf42",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -136,11 +156,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1739580444, "lastModified": 1742069588,
"narHash": "sha256-+/bSz4EAVbqz8/HsIGLroF8aNaO8bLRL7WfACN+24g4=", "narHash": "sha256-C7jVfohcGzdZRF6DO+ybyG/sqpo1h6bZi9T56sxLy+k=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8bb37161a0488b89830168b81c48aed11569cb93", "rev": "c80f6a7e10b39afcc1894e02ef785b1ad0b0d7e5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -160,11 +180,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1739557722, "lastModified": 1740569341,
"narHash": "sha256-XikzLpPUDYiNyJ4w2SfRShdbSkIgE3btYdxCGInmtc4=", "narHash": "sha256-WV8nY2IOfWdzBF5syVgCcgOchg/qQtpYh6LECYS9XkY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "plasma-manager", "repo": "plasma-manager",
"rev": "1f3e1f38dedbbb8aad77e184fb54ec518e2d9522", "rev": "5eeb0172fb74392053b66a8149e61b5e191b2845",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -175,6 +195,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"google-cookie-retrieval": "google-cookie-retrieval",
"home-manager": "home-manager", "home-manager": "home-manager",
"nix-doom-emacs-unstraightened": "nix-doom-emacs-unstraightened", "nix-doom-emacs-unstraightened": "nix-doom-emacs-unstraightened",
"nixos-wsl": "nixos-wsl", "nixos-wsl": "nixos-wsl",
@@ -190,11 +211,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1739262228, "lastModified": 1741861888,
"narHash": "sha256-7JAGezJ0Dn5qIyA2+T4Dt/xQgAbhCglh6lzCekTVMeU=", "narHash": "sha256-ynOgXAyToeE1UdLNfrUn/hL7MN0OpIS2BtNdLjpjPf0=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "07af005bb7d60c7f118d9d9f5530485da5d1e975", "rev": "d016ce0365b87d848a57c12ffcfdc71da7a2b55f",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -25,6 +25,11 @@
url = "github:marienz/nix-doom-emacs-unstraightened"; url = "github:marienz/nix-doom-emacs-unstraightened";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
google-cookie-retrieval = {
url = "git+https://git.johnogle.info/johno/google-cookie-retrieval.git";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { self, nixpkgs, nixos-wsl, ... } @ inputs: let outputs = { self, nixpkgs, nixos-wsl, ... } @ inputs: let
@@ -39,26 +44,19 @@
inputs.plasma-manager.homeManagerModules.plasma-manager inputs.plasma-manager.homeManagerModules.plasma-manager
inputs.nix-doom-emacs-unstraightened.hmModule inputs.nix-doom-emacs-unstraightened.hmModule
]; ];
home-manager.extraSpecialArgs = {
globalInputs = inputs;
};
} }
]; ];
in { in {
nixosConfigurations.z790prors-nix = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = baseModules ++ [
./machines/z790prors/configuration.nix
{
home-manager.users.johno = import ./home/home-z790prors.nix;
}
];
};
nixosConfigurations.nix-book = nixpkgs.lib.nixosSystem rec { nixosConfigurations.nix-book = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux"; system = "x86_64-linux";
modules = baseModules ++ [ modules = baseModules ++ [
./machines/nix-book/configuration.nix ./machines/nix-book/configuration.nix
{ {
home-manager.users.johno = import ./home/home-nix-book.nix; home-manager.users.johno = import ./home/home-nix-book.nix;
home-manager.extraSpecialArgs = { inherit system; };
} }
]; ];
}; };
@@ -69,7 +67,8 @@
./machines/boxy/configuration.nix ./machines/boxy/configuration.nix
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
{ {
home-manager.users.johno = import ./home/home-default.nix; home-manager.users.johno = import ./home/home.nix;
home-manager.extraSpecialArgs = { inherit system; };
} }
]; ];
}; };
@@ -81,9 +80,23 @@
./machines/wixos/configuration.nix ./machines/wixos/configuration.nix
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
{ {
home-manager.users.johno = import ./home/home-default.nix; home-manager.users.johno = import ./home/home.nix;
home-manager.extraSpecialArgs = { inherit system; };
} }
]; ];
}; };
homeConfigurations."johno" = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = inputs.nixpkgs.legacyPackages."x86_64-linux";
modules = [
inputs.plasma-manager.homeManagerModules.plasma-manager
inputs.nix-doom-emacs-unstraightened.hmModule
./home/home.nix
];
extraSpecialArgs = {
system = "x86_64-linux";
globalInputs = inputs;
};
};
}; };
} }

View File

@@ -2,7 +2,7 @@
{ {
imports = [ imports = [
./home-default.nix ./home.nix
]; ];
home.i3_sway.extraSwayConfig = { home.i3_sway.extraSwayConfig = {

View File

@@ -1,7 +0,0 @@
{ config, lib, pkgs, ... }:
{
imports = [
./home-default.nix
];
}

View File

@@ -1,4 +1,4 @@
{ pkgs, customPkgs, ... }: { pkgs, customPkgs, globalInputs, system, ... }:
let let
customPkgs = pkgs.callPackage ../packages {}; customPkgs = pkgs.callPackage ../packages {};
@@ -55,7 +55,7 @@ in
pkgs.ncdu pkgs.ncdu
pkgs.nextcloud-talk-desktop pkgs.nextcloud-talk-desktop
pkgs.pandoc pkgs.pandoc
pkgs.pinentry-qt #pkgs.pinentry-qt
#pkgs.pytest #pkgs.pytest
pkgs.shellcheck pkgs.shellcheck
pkgs.solaar # Logitech management software pkgs.solaar # Logitech management software
@@ -63,6 +63,8 @@ in
pkgs.waybar pkgs.waybar
pkgs.wofi pkgs.wofi
pkgs.vlc pkgs.vlc
globalInputs.google-cookie-retrieval.packages.${system}.default
]; ];
# Home Manager is pretty good at managing dotfiles. The primary way to manage # Home Manager is pretty good at managing dotfiles. The primary way to manage
@@ -78,9 +80,10 @@ in
# org.gradle.console=verbose # org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000 # org.gradle.daemon.idletimeout=3600000
# ''; # '';
}; };
targets.genericLinux.enable = true;
# Home Manager can also manage your environment variables through # Home Manager can also manage your environment variables through
# 'home.sessionVariables'. These will be explicitly sourced when using a # 'home.sessionVariables'. These will be explicitly sourced when using a
# shell provided by Home Manager. If you don't want to manage your shell # shell provided by Home Manager. If you don't want to manage your shell
@@ -130,15 +133,6 @@ in
}; };
}; };
programs.gpg.enable = true;
services.gpg-agent = {
enable = true;
enableSshSupport = true;
defaultCacheTtl = 1800;
pinentryPackage = pkgs.pinentry-qt;
};
programs.jq.enable = true; programs.jq.enable = true;
programs.k9s.enable = true; programs.k9s.enable = true;
@@ -171,17 +165,16 @@ in
}; };
}; };
services.home-manager.autoUpgrade = {
enable = true;
frequency = "weekly";
};
services.kdeconnect = { services.kdeconnect = {
enable = true; enable = true;
indicator = true; indicator = true;
package = pkgs.kdePackages.kdeconnect-kde; package = pkgs.kdePackages.kdeconnect-kde;
}; };
services.gnome-keyring = {
enable = true;
};
services.syncthing = { services.syncthing = {
enable = true; enable = true;
tray = { tray = {

View File

@@ -20,7 +20,7 @@ with lib;
]; ];
programs.doom-emacs = { programs.doom-emacs = {
#enable = true; enable = true;
doomDir = ./doom; doomDir = ./doom;
}; };

View File

@@ -2,7 +2,7 @@
# your system. Help is available in the configuration.nix(5) man page, on # your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). # https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ lib, ... }: { lib, pkgs, ... }:
with lib; with lib;
@@ -14,9 +14,17 @@ with lib;
roles = { roles = {
audio.enable = true; audio.enable = true;
bluetooth.enable = true;
desktop = {
enable = true;
gaming = true;
kde = true;
sddm = true;
wayland = true;
};
kodi = { kodi = {
enable = true; enable = true;
autologin = true; autologin = false;
wayland = true; wayland = true;
}; };
users.enable = true; users.enable = true;
@@ -28,9 +36,15 @@ with lib;
networking.hostName = "boxy"; # Define your hostname. networking.hostName = "boxy"; # Define your hostname.
services.xserver.videoDrivers = [ "amdgpu" ];
hardware.graphics.enable = true; hardware.graphics.enable = true;
hardware.graphics.enable32Bit = true;
services.displayManager.enable = mkForce false; hardware.graphics.extraPackages = with pkgs; [
amdvlk
];
hardware.graphics.extraPackages32 = with pkgs; [
driversi686Linux.amdvlk
];
# This option defines the first version of NixOS you have installed on this particular machine, # 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. # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.

View File

@@ -9,7 +9,7 @@
]; ];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "thunderbolt" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "thunderbolt" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];

View File

@@ -8,36 +8,9 @@ in
{ {
options.roles.audio = { options.roles.audio = {
enable = mkEnableOption "Enable the audio role"; enable = mkEnableOption "Enable the audio role";
pulseAudio = mkOption { type = types.bool; default = false; description = "Use PulseAudio exclusively instead of Pipewire"; };
}; };
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable
(mkIf cfg.pulseAudio {
services.pipewire.enable = false;
services.pulseaudio = {
enable = true;
package = pkgs.pulseaudioFull;
systemWide = true;
extraConfig = ''
load-module module-combine-sink
load-module module-switch-on-connect
'';
};
nixpkgs.config.pulseaudio = true;
})
(mkIf (!cfg.pulseAudio) {
services.pipewire = {
enable = true;
systemWide = true;
audio.enable = true;
pulse.enable = true;
alsa = {
enable = true;
support32Bit = true;
};
jack.enable = true;
};
})
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
paprefs paprefs
@@ -45,10 +18,23 @@ in
pulsemixer pulsemixer
]; ];
services.squeezelite = { services.pipewire = {
enable = true; enable = true;
pulse.enable = true;
};
services.pulseaudio = {
package = pkgs.pulseaudioFull;
extraConfig = ''
load-module module-combine-sink
load-module module-switch-on-connect
'';
};
services.squeezelite = {
#enable = true;
pulseAudio = true; pulseAudio = true;
}; };
} };
]);
} }

View File

@@ -2,12 +2,10 @@
with lib; with lib;
let
cfg = config.roles.desktop;
in
{ {
options.roles.desktop = { options.roles.desktop = {
enable = mkEnableOption "Enable the desktop role."; enable = mkEnableOption "Enable the desktop role.";
x11 = mkOption { type = types.bool; default = false; description = "Enable X11 support."; }; x11 = mkOption { type = types.bool; default = false; description = "Enable X11 support."; };
wayland = mkOption { type = types.bool; default = false; description = "Enable Wayland support."; }; wayland = mkOption { type = types.bool; default = false; description = "Enable Wayland support."; };
kde = mkOption { type = types.bool; default = false; description = "Enable KDE."; }; kde = mkOption { type = types.bool; default = false; description = "Enable KDE."; };
@@ -20,17 +18,7 @@ in
./wayland.nix ./wayland.nix
./gaming.nix ./gaming.nix
./kde.nix ./kde.nix
./programs.nix
./sddm.nix ./sddm.nix
]; ];
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
brightnessctl
emacs-nox
];
programs.dconf.enable = true;
services.gnome.gnome-keyring.enable = true;
programs.kdeconnect.enable = true;
};
} }

View File

@@ -10,6 +10,7 @@ in
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
steam steam
lutris lutris
moonlight
]; ];
# Possibly other gaming specific services or settings # Possibly other gaming specific services or settings

View File

@@ -2,11 +2,15 @@
with lib; with lib;
let
cfg = config.roles.desktop;
in
{ {
config = { config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
brightnessctl brightnessctl
emacs-nox emacs-nox
moonlight-qt
]; ];
programs.dconf.enable = true; programs.dconf.enable = true;

View File

@@ -27,45 +27,28 @@ in
]); ]);
in mkIf cfg.enable in mkIf cfg.enable
{ {
users.extraUsers.kodi.isNormalUser = true; users.extraUsers.kodi = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "audio" "video" ];
};
networking.firewall = { networking.firewall = {
allowedTCPPorts = [ 8080 ]; allowedTCPPorts = [ 8080 ];
allowedUDPPorts = [ 8080 ]; allowedUDPPorts = [ 8080 ];
}; };
services = if cfg.autologin then mkMerge [ environment.systemPackages = with pkgs; [
(mkIf cfg.wayland { kodiPkg
cage = mkIf cfg.wayland { wget
user = "kodi"; ];
program = "${kodiPkg}/bin/kodi-standalone";
enable = true;
};
xserver = {
enable = false;
autorun = false;
};
})
(mkIf (!cfg.wayland) { services = if cfg.autologin then {
xserver = {
enable = true;
desktopManager.kodi = {
enable = true;
package = kodiPkg;
};
displayManager.lightdm = {
enable = true;
greeter.enable = false;
};
};
displayManager = { displayManager = {
autoLogin.enable = true; autoLogin.enable = true;
autoLogin.user = "kodi"; autoLogin.user = "kodi";
defaultSession = "kodi"; defaultSession = "kodi";
sessionData.autologinSession = "kodi"; sessionData.autologinSession = "plasma";
}; };
}) } else {};
] else {};
}; };
} }