Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b10f4abe0 | |||
| a53519c339 | |||
| e88670ed60 | |||
| df77fd5c74 | |||
| 458bcb4cdf | |||
| 40e10bab34 | |||
| 3477a3480f | |||
| d2ae7f8e11 | |||
| ff3a0a4738 |
13
flake.nix
13
flake.nix
@@ -55,13 +55,12 @@
|
|||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = baseModules ++ [
|
modules = baseModules ++ [
|
||||||
./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-default.nix;
|
||||||
# home-manager.extraSpecialArgs.customPkgs =
|
home-manager.extraSpecialArgs.customPkgs =
|
||||||
# nixpkgs.legacyPackages."${system}".callPackage ./packages {};
|
nixpkgs.legacyPackages."${system}".callPackage ./packages {};
|
||||||
# customPkgs = nixpkgs.legacyPackages."${system}".callPackage ./packages {};
|
}
|
||||||
# }
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ let
|
|||||||
cfg = config.home.i3_sway;
|
cfg = config.home.i3_sway;
|
||||||
i3_cfg = config.xsession.windowManager.i3.config;
|
i3_cfg = config.xsession.windowManager.i3.config;
|
||||||
|
|
||||||
shared_config = recursiveUpdate {
|
shared_config = recursiveUpdate rec {
|
||||||
modifier = "Mod4";
|
modifier = "Mod4";
|
||||||
terminal = "kitty";
|
terminal = "kitty";
|
||||||
defaultWorkspace = "workspace number 1";
|
defaultWorkspace = "workspace number 1";
|
||||||
|
|
||||||
keybindings = {
|
keybindings = {
|
||||||
"${shared_config.modifier}+Return" = "exec ${i3_cfg.terminal}";
|
"${shared_config.modifier}+Return" = "exec ${terminal}";
|
||||||
"${shared_config.modifier}+Shift+q" = "kill";
|
"${shared_config.modifier}+Shift+q" = "kill";
|
||||||
"${shared_config.modifier}+d" = "exec ${i3_cfg.menu}";
|
"${shared_config.modifier}+d" = "exec ${i3_cfg.menu}";
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,13 @@ with lib;
|
|||||||
kodi = {
|
kodi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
autologin = true;
|
autologin = true;
|
||||||
wayland = false;
|
wayland = true;
|
||||||
};
|
};
|
||||||
|
spotifyd = {
|
||||||
|
enable = true;
|
||||||
|
deviceType = "t_v";
|
||||||
|
};
|
||||||
|
users.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
# Use the systemd-boot EFI boot loader.
|
||||||
@@ -29,7 +34,7 @@ with lib;
|
|||||||
|
|
||||||
hardware.graphics.enable = true;
|
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,
|
# 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.
|
||||||
|
|||||||
@@ -10,19 +10,18 @@ in
|
|||||||
enable = mkEnableOption "Enable the audio role";
|
enable = mkEnableOption "Enable the audio role";
|
||||||
};
|
};
|
||||||
|
|
||||||
config =
|
config = mkIf cfg.enable
|
||||||
{
|
{
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
alsa-utils
|
||||||
paprefs
|
paprefs
|
||||||
pavucontrol
|
pavucontrol
|
||||||
pulsemixer
|
pulsemixer
|
||||||
];
|
];
|
||||||
|
|
||||||
services.pipewire = {
|
hardware.pulseaudio.enable = true;
|
||||||
enable = true;
|
|
||||||
pulse.enable = true;
|
|
||||||
};
|
|
||||||
hardware.pulseaudio.package = pkgs.pulseaudioFull;
|
hardware.pulseaudio.package = pkgs.pulseaudioFull;
|
||||||
|
hardware.pulseaudio.support32Bit = true;
|
||||||
hardware.pulseaudio.extraConfig = "
|
hardware.pulseaudio.extraConfig = "
|
||||||
load-module module-combine-sink
|
load-module module-combine-sink
|
||||||
load-module module-switch-on-connect
|
load-module module-switch-on-connect
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ in
|
|||||||
enable = mkEnableOption "Enable the bluetooth role";
|
enable = mkEnableOption "Enable the bluetooth role";
|
||||||
};
|
};
|
||||||
|
|
||||||
config =
|
config = mkIf cfg.enable
|
||||||
{
|
{
|
||||||
hardware.bluetooth.enable = true;
|
hardware.bluetooth.enable = true;
|
||||||
hardware.bluetooth.powerOnBoot = true;
|
hardware.bluetooth.powerOnBoot = true;
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.roles;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./audio
|
./audio
|
||||||
@@ -19,10 +16,6 @@ in
|
|||||||
./virtualisation
|
./virtualisation
|
||||||
];
|
];
|
||||||
|
|
||||||
options.roles = {
|
|
||||||
enable = mkEnableOption "Enable roles";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
i18n.extraLocaleSettings = {
|
i18n.extraLocaleSettings = {
|
||||||
@@ -65,9 +58,6 @@ in
|
|||||||
substituters = [
|
substituters = [
|
||||||
"https://hyprland.cachix.org"
|
"https://hyprland.cachix.org"
|
||||||
];
|
];
|
||||||
trusted-public-keys = [
|
|
||||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config =
|
config = mkIf cfg.enable
|
||||||
{
|
{
|
||||||
services.xserver.xkb = {
|
services.xserver.xkb = {
|
||||||
layout = "us";
|
layout = "us";
|
||||||
|
|||||||
@@ -25,39 +25,47 @@ in
|
|||||||
steam-library
|
steam-library
|
||||||
youtube
|
youtube
|
||||||
]);
|
]);
|
||||||
in {
|
in mkIf cfg.enable
|
||||||
users.extraUsers.kodi.isNormalUser = true;
|
{
|
||||||
|
users.extraUsers.kodi.isNormalUser = true;
|
||||||
|
|
||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
allowedTCPPorts = [ 8080 ];
|
allowedTCPPorts = [ 8080 ];
|
||||||
allowedUDPPorts = [ 8080 ];
|
allowedUDPPorts = [ 8080 ];
|
||||||
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf (!cfg.wayland) {
|
||||||
|
xserver = {
|
||||||
|
enable = true;
|
||||||
|
desktopManager.kodi = {
|
||||||
|
enable = true;
|
||||||
|
package = kodiPkg;
|
||||||
|
};
|
||||||
|
displayManager.lightdm = {
|
||||||
|
enable = true;
|
||||||
|
greeter.enable = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
displayManager = {
|
||||||
|
autoLogin.enable = true;
|
||||||
|
autoLogin.user = "kodi";
|
||||||
|
defaultSession = "kodi";
|
||||||
|
sessionData.autologinSession = "kodi";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
] else {};
|
||||||
};
|
};
|
||||||
|
|
||||||
services = mkIf cfg.autologin {
|
|
||||||
cage = mkIf cfg.wayland {
|
|
||||||
user = "kodi";
|
|
||||||
program = "${kodiPkg}/bin/kodi-standalone";
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
xserver = mkIf (!cfg.wayland) {
|
|
||||||
enable = true;
|
|
||||||
desktopManager.kodi = {
|
|
||||||
enable = true;
|
|
||||||
package = kodiPkg;
|
|
||||||
};
|
|
||||||
displayManager.lightdm = {
|
|
||||||
enable = true;
|
|
||||||
greeter.enable = false;
|
|
||||||
};
|
|
||||||
displayManager.sddm.enable = mkForce false;
|
|
||||||
};
|
|
||||||
displayManager = mkIf (!cfg.wayland) {
|
|
||||||
autoLogin.enable = true;
|
|
||||||
autoLogin.user = "kodi";
|
|
||||||
defaultSession = "kodi";
|
|
||||||
sessionData.autologinSession = "kodi";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,15 +16,16 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = mkIf cfg.enable
|
||||||
fileSystems."/media" = {
|
{
|
||||||
device = "10.0.0.43:/media";
|
fileSystems."/media" = {
|
||||||
fsType = "nfs";
|
device = "10.0.0.43:/media";
|
||||||
options = [
|
fsType = "nfs";
|
||||||
"defaults"
|
options = [
|
||||||
"nofail"
|
"defaults"
|
||||||
"softreval"
|
"nofail"
|
||||||
];
|
"softreval"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,18 +2,22 @@
|
|||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.printing;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
options.roles.printing = {
|
options.roles.printing = {
|
||||||
enable = mkEnableOption "Enable default printing setup";
|
enable = mkEnableOption "Enable default printing setup";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = mkIf cfg.enable
|
||||||
services.printing.enable = true;
|
{
|
||||||
|
services.printing.enable = true;
|
||||||
|
|
||||||
services.avahi = {
|
services.avahi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
nssmdns4 = true;
|
nssmdns4 = true;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,36 +4,48 @@ with lib;
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.roles.spotifyd;
|
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
|
in
|
||||||
{
|
{
|
||||||
options.roles.spotifyd = {
|
options.roles.spotifyd = {
|
||||||
enable = mkEnableOption "Enable the spotifyd role";
|
enable = mkEnableOption "Enable the spotifyd role";
|
||||||
|
deviceType = mkOption {
|
||||||
|
default = "computer";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = mkIf cfg.enable
|
||||||
roles.audio.enable = true;
|
{
|
||||||
|
roles.audio.enable = true;
|
||||||
|
|
||||||
services.spotifyd = {
|
systemd.user.services.spotifyd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
wantedBy = [ "default.target" ];
|
||||||
global = {
|
after = [ "network-online.target" "sound.target" ];
|
||||||
use_mpris = false;
|
description = "spotifyd, a Spotify playing daemon";
|
||||||
backend = "alsa";
|
serviceConfig = {
|
||||||
device = "sysdefault";
|
ExecStart = "${spotifyd}/bin/spotifyd --no-daemon --cache-path=\${HOME}/.cache/spotifyd --config-path=${spotifydConf}";
|
||||||
bitrate = 320;
|
Restart = "always";
|
||||||
cache_path = "";
|
RestartSec = 12;
|
||||||
zeroconf_port = 1234;
|
|
||||||
autoplay = false;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
users.users."kodi".linger = true;
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
networking.firewall.allowedTCPPorts = [
|
||||||
1234
|
5354
|
||||||
57621
|
57621
|
||||||
];
|
];
|
||||||
networking.firewall.allowedUDPPorts = [
|
networking.firewall.allowedUDPPorts = [
|
||||||
5353
|
5353
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ in
|
|||||||
kidsPackages = with pkgs; [
|
kidsPackages = with pkgs; [
|
||||||
firefox
|
firefox
|
||||||
];
|
];
|
||||||
in {
|
in mkIf cfg.enable {
|
||||||
users.users.johno = {
|
users.users.johno = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "John Ogle";
|
description = "John Ogle";
|
||||||
|
|||||||
@@ -2,13 +2,17 @@
|
|||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.virtualisation;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
options.roles.virtualisation = {
|
options.roles.virtualisation = {
|
||||||
enable = mkEnableOption "Enable virtualisation";
|
enable = mkEnableOption "Enable virtualisation";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = mkIf cfg.enable
|
||||||
virtualisation.libvirtd.enable = true;
|
{
|
||||||
programs.virt-manager.enable = true;
|
virtualisation.libvirtd.enable = true;
|
||||||
};
|
programs.virt-manager.enable = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user