Compare commits

...

9 Commits

Author SHA1 Message Date
9b10f4abe0 (wip) spotifyd experimentation 2024-10-21 12:31:30 -07:00
a53519c339 [spotifyd] Update to lean in on pulseaudio 2024-10-05 20:37:44 -07:00
e88670ed60 [audio] Switch to pulseaudio
This is an attempt to get spotifyd running as a system user working
2024-10-05 20:37:10 -07:00
df77fd5c74 [i3+sway] Fix terminal reference 2024-10-05 19:49:17 -07:00
458bcb4cdf [roles] Remove unused trusted public key 2024-10-05 19:12:49 -07:00
40e10bab34 [roles] Remove unused config option 2024-10-05 19:12:38 -07:00
3477a3480f [boxy] Fix wayland and user setup 2024-10-05 19:10:15 -07:00
d2ae7f8e11 [roles] Also make desktop opt-in 2024-10-05 19:09:58 -07:00
ff3a0a4738 [roles] No config change unless enabled 2024-10-05 18:17:42 -07:00
13 changed files with 128 additions and 106 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

@@ -6,13 +6,13 @@ let
cfg = config.home.i3_sway;
i3_cfg = config.xsession.windowManager.i3.config;
shared_config = recursiveUpdate {
shared_config = recursiveUpdate rec {
modifier = "Mod4";
terminal = "kitty";
defaultWorkspace = "workspace number 1";
keybindings = {
"${shared_config.modifier}+Return" = "exec ${i3_cfg.terminal}";
"${shared_config.modifier}+Return" = "exec ${terminal}";
"${shared_config.modifier}+Shift+q" = "kill";
"${shared_config.modifier}+d" = "exec ${i3_cfg.menu}";

View File

@@ -17,8 +17,13 @@ with lib;
kodi = {
enable = true;
autologin = true;
wayland = false;
wayland = true;
};
spotifyd = {
enable = true;
deviceType = "t_v";
};
users.enable = true;
};
# Use the systemd-boot EFI boot loader.
@@ -29,7 +34,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,19 +10,18 @@ in
enable = mkEnableOption "Enable the audio role";
};
config =
config = mkIf cfg.enable
{
environment.systemPackages = with pkgs; [
alsa-utils
paprefs
pavucontrol
pulsemixer
];
services.pipewire = {
enable = true;
pulse.enable = true;
};
hardware.pulseaudio.enable = true;
hardware.pulseaudio.package = pkgs.pulseaudioFull;
hardware.pulseaudio.support32Bit = true;
hardware.pulseaudio.extraConfig = "
load-module module-combine-sink
load-module module-switch-on-connect

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

@@ -1,10 +1,7 @@
{ config, lib, pkgs, ... }:
{ lib, pkgs, ... }:
with lib;
let
cfg = config.roles;
in
{
imports = [
./audio
@@ -19,10 +16,6 @@ in
./virtualisation
];
options.roles = {
enable = mkEnableOption "Enable roles";
};
config = {
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
@@ -65,9 +58,6 @@ in
substituters = [
"https://hyprland.cachix.org"
];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
];
};
};

View File

@@ -37,7 +37,7 @@ in
};
};
config =
config = mkIf cfg.enable
{
services.xserver.xkb = {
layout = "us";

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

@@ -4,32 +4,44 @@ with lib;
let
cfg = config.roles.spotifyd;
spotifyd = pkgs.spotifyd.override { withMpris = true; withPulseAudio = true; };
spotifydConf = pkgs.writeText "spotifyd-config" ''
[global]
backend = "pulseaudio"
bitrate = 320
use_mpris = false
zeroconf_port = 5354
autoplay = false
device_type = "${cfg.deviceType}"
'';
in
{
options.roles.spotifyd = {
enable = mkEnableOption "Enable the spotifyd role";
deviceType = mkOption {
default = "computer";
};
};
config = {
config = mkIf cfg.enable
{
roles.audio.enable = true;
services.spotifyd = {
systemd.user.services.spotifyd = {
enable = true;
settings = {
global = {
use_mpris = false;
backend = "alsa";
device = "sysdefault";
bitrate = 320;
cache_path = "";
zeroconf_port = 1234;
autoplay = false;
};
wantedBy = [ "default.target" ];
after = [ "network-online.target" "sound.target" ];
description = "spotifyd, a Spotify playing daemon";
serviceConfig = {
ExecStart = "${spotifyd}/bin/spotifyd --no-daemon --cache-path=\${HOME}/.cache/spotifyd --config-path=${spotifydConf}";
Restart = "always";
RestartSec = 12;
};
};
users.users."kodi".linger = true;
networking.firewall.allowedTCPPorts = [
1234
5354
57621
];
networking.firewall.allowedUDPPorts = [

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;
};