Compare commits

..

10 Commits

Author SHA1 Message Date
Patrick Neff 5612a343b1 enable nginx for vm 2024-04-29 03:53:43 +02:00
Patrick Neff 1b7f26328e Merge branch 'develop' of pi1.odie.intranet:odie/nixos-combined-flake into develop 2024-04-24 05:44:16 +02:00
Patrick Neff 46b78f2528 update internal domain name 2024-04-24 05:43:33 +02:00
Patrick Neff 49bcdba856 get kodi running 2024-04-16 21:23:37 +02:00
Patrick Neff d2a4f83c2e enable binary-cache for vm 2024-04-15 16:13:06 +02:00
Patrick Neff 2e7cd48957 reenable desktop for vm 2024-04-15 16:11:52 +02:00
Patrick Neff 3213d23a02 xsession and file manager updates 2024-04-15 16:07:59 +02:00
Patrick Neff 2b1684d24b add missing nix package 2024-04-15 00:01:08 +02:00
Patrick Neff c9ce9d2c90 disable nix config for non nixos machines 2024-04-15 00:00:01 +02:00
Patrick Neff 523ddfd122 add missing desktop stuff 2024-04-14 23:43:07 +02:00
33 changed files with 721 additions and 92 deletions

View File

@ -365,11 +365,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1713077896, "lastModified": 1713166971,
"narHash": "sha256-Noot8H0EZEAFRQWyGxh9ryvhK96xpIqKbh78X447JWs=", "narHash": "sha256-t0P/rKlsE5l1O3O2LYtAelLzp7PeoPCSzsIietQ1hSM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "630a0992b3627c64e34f179fab68e3d48c6991c0", "rev": "1c43dcfac48a2d622797f7ab741670fdbcf8f609",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -23,7 +23,7 @@
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA1QZO6fF2RLcmjMKdG1eZi0RLw3joa+VBXaKvfmA7Tg odie" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA1QZO6fF2RLcmjMKdG1eZi0RLw3joa+VBXaKvfmA7Tg odie"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINs89u4Kvwlmq67eV+H/n+x9M8gsKDxQU+dCPSEb2vJe odie" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINs89u4Kvwlmq67eV+H/n+x9M8gsKDxQU+dCPSEb2vJe odie"
]; ];
domain = "odie.intranet"; domain = "odie.home.arpa";
}; };
overlays = [ overlays = [
inputs.nixvim.overlays.default inputs.nixvim.overlays.default
@ -37,9 +37,9 @@
overlays = { overlays = {
kodi = final: prev: { kodi = final: prev: {
kodi-standalone = kodi-standalone =
final.kodi-wayland.passthru.withPackages final.kodi-wayland.withPackages
(kodiPkgs: (kodiPkgs:
with final.kodiPackages; [ with kodiPkgs; [
youtube youtube
pvr-iptvsimple pvr-iptvsimple
keymap keymap
@ -89,6 +89,7 @@
games = import ./modules/home-manager/games; games = import ./modules/home-manager/games;
mediacenter = import ./modules/home-manager/mediacenter; mediacenter = import ./modules/home-manager/mediacenter;
user = import ./modules/home-manager/user; user = import ./modules/home-manager/user;
binary-cache = import ./modules/home-manager/binary-cache;
}; };
homeConfigurations = homeConfigurations =
flakeLib.mkHomeConfiguration { flakeLib.mkHomeConfiguration {

View File

@ -7,19 +7,4 @@
home.packages = with pkgs; [ home.packages = with pkgs; [
home-manager home-manager
]; ];
nix = {
package = pkgs.nix;
settings = {
substituters = [
"http://nixcache.odie.intranet"
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
];
trusted-public-keys = [
"nixcache.odie.intranet:2j5qAVmtBUSZMPWlIRS8Gn0Il9tbotJ9c2y43N0RLKU="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
};
} }

View File

@ -0,0 +1,12 @@
_: {
nix = {
# package = pkgs.nix;
settings = {
substituters = [
"http://nixcache.odie.intranet"
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
];
};
};
}

View File

@ -24,8 +24,9 @@ lib.mkIf config.desktop.awesome.enable {
}; };
}; };
services.gnome-keyring.enable = true;
xsession = { xsession = {
enable = true;
windowManager.awesome = { windowManager.awesome = {
enable = true; enable = true;
luaModules = with pkgs.luaPackages; [ luaModules = with pkgs.luaPackages; [

View File

@ -1,4 +1,8 @@
{ lib, ... }: { {
lib,
config,
...
}: {
options = { options = {
desktop = { desktop = {
awesome = { awesome = {
@ -18,5 +22,5 @@
}; };
}; };
}; };
imports = [ ./awesomewm.nix ]; imports = [./awesomewm.nix ../xserver];
} }

View File

@ -0,0 +1,18 @@
{
lib,
config,
...
}: {
config = lib.mkIf config.desktop.enable {
services.darkman = {
enable = true;
settings = {
lat = 50.81;
lng = 7.03;
usegeoclue = true;
dbusserver = true;
portal = true;
};
};
};
}

View File

@ -1,4 +1,5 @@
{ {
pkgs,
lib, lib,
config, config,
nix-colors, nix-colors,
@ -15,7 +16,7 @@
fileManager = lib.mkOption { fileManager = lib.mkOption {
type = lib.types.str; type = lib.types.str;
description = "the default file_manager to use"; description = "the default file_manager to use";
default = "thunar"; default = "pcmanfm";
}; };
browser = lib.mkOption { browser = lib.mkOption {
type = lib.types.str; type = lib.types.str;
@ -42,9 +43,17 @@
./rofi ./rofi
./network-manager-applet ./network-manager-applet
./alacritty ./alacritty
./darkman
./pcmanfm
./thunar
]; ];
config = lib.mkIf config.desktop.enable { config = lib.mkIf config.desktop.enable {
desktop.awesome.enable = lib.mkDefault true; desktop = {
xserver.enable = lib.mkDefault true;
awesome.enable = lib.mkDefault true;
pcmanfm.enable = lib.mkDefault true;
network-manager.enable = lib.mkDefault true;
};
programs = { programs = {
keepassxc.enable = lib.mkDefault true; keepassxc.enable = lib.mkDefault true;
firefox.enable = lib.mkDefault true; firefox.enable = lib.mkDefault true;
@ -52,11 +61,44 @@
}; };
services = { services = {
nextcloud-client.enable = lib.mkDefault true; nextcloud-client.enable = lib.mkDefault true;
udiskie.enable = lib.mkDefault true; udiskie = {
enable = lib.mkDefault true;
settings = {
program_options = {
udisks_version = 2;
tray = true;
};
};
};
picom.enable = lib.mkDefault true; picom.enable = lib.mkDefault true;
}; };
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
colorScheme = nix-colors.colorSchemes.catppuccin-mocha; colorScheme = nix-colors.colorSchemes.catppuccin-mocha;
desktop.network-manager.enable = lib.mkDefault true; xdg = {
enable = lib.mkDefault true;
portal = {
enable = lib.mkDefault true;
config = {
common = {
default = [
"gtk"
];
};
awesome = {
default = [
"pantheon"
"gtk"
];
"org.freedesktop.impl.portal.Secret" = [
"gnome-keyring"
];
};
};
extraPortals = with pkgs; [
xdg-desktop-portal-gtk
];
};
userDirs.enable = true;
};
}; };
} }

View File

@ -1,5 +1,4 @@
{ {
pkgs,
config, config,
lib, lib,
... ...

View File

@ -0,0 +1,16 @@
{
pkgs,
lib,
config,
...
}: let
cfg = config.desktop.pcmanfm;
in
with lib; {
options = {
desktop.pcmanfm.enable = mkEnableOption "pcmanfm";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [pcmanfm];
};
}

View File

@ -0,0 +1,14 @@
{
pkgs,
config,
lib,
...
}:
with lib; {
options = {
desktop.thunar.enable = mkEnableOption "Thunar";
};
config = mkIf config.desktop.thunar.enable {
home.packages = with pkgs; [xfce.thunar];
};
}

View File

@ -0,0 +1,10 @@
{lib, ...}:
with lib; {
imports = [
./xresources.nix
./xsession.nix
];
options = {
desktop.xserver.enable = mkEnableOption "xserver";
};
}

View File

@ -0,0 +1,47 @@
{
config,
lib,
...
}: let
cfg = config.desktop.xserver;
in
with lib;
mkIf cfg.enable {
xresources.properties = {
"*background" = "#1E1E2E";
"*foreground" = "#CDD6F4";
"*cursorColor" = "#F5E0DC";
"*color0" = "#45475A";
"*color8" = "#585B70";
"*color1" = "#F38BA8";
"*color9" = "#F38BA8";
"*color2" = "#A6E3A1";
"*color10" = "#A6E3A1";
"*color3" = "#F9E2AF";
"*color11" = "#F9E2AF";
"*color4" = "#89B4FA";
"*color12" = "#89B4FA";
"*color5" = "#F5C2E7";
"*color13" = "#F5C2E7";
"*color6" = "#94E2D5";
"*color14" = "#94E2D5";
"*color7" = "#BAC2DE";
"*color15" = "#A6ADC8";
"URxvt.letterSpace" = "-1";
"URxvt.lineSpace" = "0";
"URxvt.saveline" = "10480";
"URxvt.scrollBar" = "false";
"URxvt.urgentOnBell" = "true";
"URxvt.font" = "xft:FiraCode Nerd Font Mono:size=9";
"URxvt.fontBold" = "xft:FiraCode Nerd Font Mono:bold:size=9";
"URxvt.depth" = "32";
"URxvt.background" = "[95]#1E1E2E";
"Xft.autohint" = "0";
"Xft.lcdfilter" = "lcddefault";
"Xft.hintstyle" = "hintslight";
"Xft.hinting" = "1";
"Xft.antialias" = "1";
"Xft.rgba" = "rgb";
"XTerm*faceName" = "FiraCode Nerd Font Mono:bold:size=9";
};
}

View File

@ -0,0 +1,15 @@
{
pkgs,
config,
lib,
...
}:
lib.mkIf config.desktop.xserver.enable {
xsession = {
enable = true;
profileExtra = ''
${pkgs.mate.mate-polkit}/usr/lib/mate-polkit/polkit-mate-authentication-agent-1 &
${pkgs.darkman}/bin/darkman set dark
'';
};
}

View File

@ -1,5 +1,6 @@
{ {lib, ...}: with lib; {
imports = [ imports = [
./kodi ./kodi
]; ];
mediacenter.kodi.enable = mkDefault true;
} }

View File

@ -0,0 +1,74 @@
{
vars,
mysql,
media,
...
}: let
inherit (vars) timeZone hostName domain;
datadirs = "smb://${media.host}/kodi/userdata";
in {
addons = {
unknownsources = "true";
};
services = {
devicename = "${hostName}.${domain}";
webserver = "true";
webserverauthentication = "false";
webserverusername = "kodi";
webserverpassword = "kodi";
webserverport = "8000";
webserverssl = "false";
zeroconf = "true";
wsdiscovery = "true";
upnp = "true";
upnpserver = "true";
airplay = "true";
airplayvideosupport = "true";
};
locale = {
language = "resource.language.de_de";
country = "Deutschland";
timezone = timeZone;
};
lookandfeed = {
enablerssfeeds = "false";
};
videodatabase = {
inherit (mysql) user pass host;
type = "mysql";
port = builtins.toString mysql.port;
};
musicdatabase = {
inherit (mysql) user pass host;
type = "mysql";
port = builtins.toString mysql.port;
};
videolibrary = {
importwatchedstate = "true";
importresumepoint = "true";
};
pathsubstitution = {
substitute = [
{
from = "special://profile/playlists/";
to = "${datadirs}/playlists/";
}
{
from = "special://profile/sources.xml";
to = "${datadirs}/sources.xml";
}
{
from = "special://profile/mediasources.xml";
to = "${datadirs}/mediasources.xml";
}
{
from = "special://profile/RssFeeds.xml";
to = "${datadirs}/RssFeeds.xml";
}
{
from = "special://profile/favourites.xml";
to = "${datadirs}/favourites.xml";
}
];
};
}

View File

@ -1,20 +1,64 @@
{ {
vars,
pkgs, pkgs,
config, config,
lib, lib,
... ...
}: let }: let
cfg = config.mediacenter.kodi; cfg = config.mediacenter.kodi;
in with lib; { inherit (lib) types;
options = { in
mediacenter.kodi = { with lib; {
enable = mkEnableOption "kodi"; options.mediacenter.kodi = {
# enable = mkEnableOption "kodi";
media = {
host = mkOption {
type = types.str;
default = "media";
};
user = mkOption {
type = types.str;
default = "kodi";
};
pass = mkOption {
type = types.str;
default = "kodi";
}; };
}; };
mysql = {
host = mkOption {
type = types.str;
default = "localhost";
};
port = mkOption {
type = types.int;
default = 3306;
};
user = mkOption {
type = types.str;
default = "kodi";
};
pass = mkOption {
type = types.str;
default = "kodi";
};
};
};
imports = [./kodi.nix]; # import overridden kodi module
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.kodi = { #programs.kodi = {
enable = true; mediacenter.kodi = {
# enable = true;
package = pkgs.kodi-standalone; package = pkgs.kodi-standalone;
settings = import ./advancedsettings.nix {inherit vars; inherit (cfg) mysql media;};
};
home.file = {
"kodi-passwords.xml" = {
target = ".kodi/userdata/passwords.xml";
text = import ./passwords.nix {
inherit (cfg) media;
}; };
}; };
} };
};
}

View File

@ -0,0 +1,262 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
stylesheetCommonHeader = ''
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
<xsl:strip-space elements="*"/>
'';
stylesheetCommonFooter = "</xsl:stylesheet>";
stylesheetNestedTags = ''
<xsl:template match="attr[attrs]">
<xsl:variable name="elementName" select="@name"/>
<xsl:element name="{$elementName}">
<xsl:apply-templates select="attrs" />
</xsl:element>
</xsl:template>
<xsl:template match="attr[list[attrs]]">
<xsl:variable name="elementName" select="@name"/>
<xsl:for-each select="list/attrs">
<xsl:element name="{$elementName}">
<xsl:apply-templates select="." />
</xsl:element>
</xsl:for-each>
</xsl:template>
<xsl:template match="attr[not(attrs|list)]">
<xsl:variable name="elementName" select="@name"/>
<xsl:element name="{$elementName}">
<xsl:if test="$elementName='path'">
<!-- needed in sources.xml but will be used for all "path" tags -->
<xsl:attribute name="pathversion">1</xsl:attribute>
</xsl:if>
<xsl:value-of select="*/@value" />
</xsl:element>
</xsl:template>
'';
stylesheetTagsAsSettingWithId = ''
<xsl:template match='attr'>
<setting>
<xsl:attribute name="id">
<xsl:value-of select="@name" />
</xsl:attribute>
<xsl:value-of select="*/@value" />
</setting>
</xsl:template>
'';
stylesheetAdvancedSettingsRootTag = ''
<xsl:template match='/'>
<xsl:comment> Generated by Home Manager. </xsl:comment>
<advancedsettings version="1.0">
<xsl:apply-templates/>
</advancedsettings>
</xsl:template>
'';
stylesheetSourcesRootTag = ''
<xsl:template match='/'>
<xsl:comment> Generated by Home Manager. </xsl:comment>
<sources>
<xsl:apply-templates/>
</sources>
</xsl:template>
'';
stylesheetAddonSettingsRootTag = ''
<xsl:template match='/'>
<xsl:comment> Generated by Home Manager. </xsl:comment>
<settings version="2">
<xsl:apply-templates/>
</settings>
</xsl:template>
'';
attrsetToXml = attrs: name: stylesheet:
pkgs.runCommand name {
# Package splicing for libxslt does not work correctly leading to errors
# when cross-compiling. Use the version from buildPackages explicitly to
# fix this.
nativeBuildInputs = [pkgs.buildPackages.libxslt.bin];
xml = builtins.toXML attrs;
passAsFile = ["xml"];
} ''
xsltproc ${stylesheet} - < "$xmlPath" > "$out"
'';
attrsetToAdvancedSettingsXml = attrs: name: let
stylesheet = builtins.toFile "stylesheet.xsl" ''
${stylesheetCommonHeader}
${stylesheetAdvancedSettingsRootTag}
${stylesheetNestedTags}
${stylesheetCommonFooter}
'';
in
attrsetToXml attrs name stylesheet;
attrsetToSourcesXml = attrs: name: let
stylesheet = builtins.toFile "stylesheet.xsl" ''
${stylesheetCommonHeader}
${stylesheetSourcesRootTag}
${stylesheetNestedTags}
${stylesheetCommonFooter}
'';
in
attrsetToXml attrs name stylesheet;
attrsetToAddonSettingsXml = attrs: name: let
stylesheet = builtins.toFile "stylesheet.xsl" ''
${stylesheetCommonHeader}
${stylesheetAddonSettingsRootTag}
${stylesheetTagsAsSettingWithId}
${stylesheetCommonFooter}
'';
in
attrsetToXml attrs name stylesheet;
in {
meta.maintainers = [hm.maintainers.dwagenk];
options.mediacenter.kodi = {
enable = mkEnableOption "Kodi";
package = mkOption {
type = types.package;
default = pkgs.kodi;
defaultText = literalExpression "pkgs.kodi";
example =
literalExpression
"pkgs.kodi.withPackages (exts: [ exts.pvr-iptvsimple ])";
description = ''
The `kodi` package to use.
Can be used to specify extensions.
'';
};
datadir = mkOption {
type = types.path;
default = "${config.home.homeDirectory}/.kodi";
defaultText =
literalExpression ''"''${config.home.homeDirectory}/.kodi"'';
example = literalExpression ''"''${config.xdg.dataHome}/kodi"'';
description = "Directory to store configuration and metadata.";
};
settings = mkOption {
type = with types; let
valueType =
oneOf [str (attrsOf valueType) (listOf valueType)]
// {
description = "attribute sets or lists of strings";
};
in
nullOr valueType;
default = null;
example = literalExpression ''
{ videolibrary.showemptytvshows = "true"; }
'';
description = ''
Configuration to write to the `advancedsettings.xml`
file in kodis userdata directory. Settings specified here will be
immutable from inside kodi and be hidden from the GUI settings dialog.
See <https://kodi.wiki/view/Advancedsettings.xml> as
reference for how settings need to be specified.
The innermost attributes must be of type str.
'';
};
sources = mkOption {
type = with types; let
valueType =
oneOf [str (attrsOf valueType) (listOf valueType)]
// {
description = "attribute sets or lists of strings";
};
in
nullOr valueType;
default = null;
example = literalExpression ''
{
video = {
default = "movies";
source = [
{ name = "videos"; path = "/path/to/videos"; allowsharing = "true"; }
{ name = "movies"; path = "/path/to/movies"; allowsharing = "true"; }
];
};
}
'';
description = ''
Contents to populate the file `sources.xml` in kodis
userdata directory.
See <https://kodi.wiki/view/Sources.xml> as
reference for how sources need to be specified.
Kodi will still show the dialogs to modify sources in the GUI and they
appear to be mutable. This however is not the case and the sources will
stay as specified via Home Manager.
The innermost attributes must be of type str.
'';
};
addonSettings = mkOption {
type = with types; nullOr (attrsOf (attrsOf str));
default = null;
example = literalExpression ''
{ "service.xbmc.versioncheck".versioncheck_enable = "false"; }
'';
description = ''
Attribute set with the plugin namespace as toplevel key and the plugins
settings as lower level key/value pairs.
Kodi will still show the settings of plugins configured via this
mechanism in the GUI and they appear to be mutable. This however is
not the case and the settings will stay as specified via Home Manager.
'';
};
};
config = let
cfg = config.mediacenter.kodi;
in
mkIf cfg.enable (mkMerge [
{
assertions = [
(lib.hm.assertions.assertPlatform "programs.kodi" pkgs
lib.platforms.linux)
];
home.packages = [cfg.package];
home.sessionVariables = {KODI_DATA = cfg.datadir;};
}
(mkIf (cfg.settings != null) {
home.file."${cfg.datadir}/userdata/advancedsettings.xml".source =
attrsetToAdvancedSettingsXml cfg.settings "kodi-advancedsettings.xml";
})
(mkIf (cfg.sources != null) {
home.file."${cfg.datadir}/userdata/sources.xml".source =
attrsetToSourcesXml cfg.sources "kodi-sources.xml";
})
(mkIf (cfg.addonSettings != null) {
home.file = mapAttrs' (k: v:
attrsets.nameValuePair
"${cfg.datadir}/userdata/addon_data/${k}/settings.xml" {
source = attrsetToAddonSettingsXml v "kodi-addon-${k}-settings.xml";
})
cfg.addonSettings;
})
]);
}

View File

@ -0,0 +1,8 @@
{media,...}: ''
<passwords>
<path>
<from>smb://${media.host}</from>
<to>smb://${media.user}:${media.pass}@${media.host}</to>
</path>
</passwords>
''

View File

@ -1,6 +1,7 @@
{ {
lib, lib,
config, config,
vars,
... ...
}: }:
let let
@ -13,7 +14,7 @@ lib.mkIf config.services.borgmatic.enable {
home = { home = {
location = { location = {
patterns = [ patterns = [
"R /home/odie" "R /home/${vars.username}"
] ++ commonExcludes; ] ++ commonExcludes;
repositories = [ repositories = [
{ {

View File

@ -5,7 +5,6 @@
substituters = [ substituters = [
"http://nixcache.odie.intranet" "http://nixcache.odie.intranet"
"https://nix-community.cachix.org" "https://nix-community.cachix.org"
"https://cache.nixos.org/"
]; ];
trusted-public-keys = [ trusted-public-keys = [
"nixcache.odie.intranet:2j5qAVmtBUSZMPWlIRS8Gn0Il9tbotJ9c2y43N0RLKU=" "nixcache.odie.intranet:2j5qAVmtBUSZMPWlIRS8Gn0Il9tbotJ9c2y43N0RLKU="

View File

@ -15,5 +15,6 @@
hardware.enableRedistributableFirmware = lib.mkDefault true; hardware.enableRedistributableFirmware = lib.mkDefault true;
services.openssh.enable = lib.mkDefault true; services.openssh.enable = lib.mkDefault true;
boot.loader.systemd-boot.enable = lib.mkDefault true; boot.loader.systemd-boot.enable = lib.mkDefault true;
services.udisks2.enable = lib.mkDefault true;
}; };
} }

View File

@ -1,10 +1,15 @@
{ config, lib, pkgs, vars, ... }:
let
inherit (vars) hostName;
in
{ {
vars,
...
}: let
inherit (vars) hostName domain;
in {
networking = { networking = {
inherit hostName; inherit hostName domain;
search = [
domain
"fritz.box"
];
firewall.enable = true; firewall.enable = true;
}; };
} }

View File

@ -1,39 +1,48 @@
{ config, lib, pkgs, vars, ... }: {
let config,
lib,
pkgs,
vars,
...
}: let
inherit (vars) username name locale hostname sshKeys; inherit (vars) username name locale hostname sshKeys;
baseGroups = [ baseGroups = [
"users" "users"
"wheel" "wheel"
];
rpiGroups =
if config.hardware.raspberry-pi.enable then [
"audio" "audio"
"video" "video"
"plugdev"
"adm"
"disk" "disk"
"power"
"adm"
"plugdev"
];
rpiGroups =
if config.hardware.raspberry-pi.enable
then [
"i2c" "i2c"
"spi" "spi"
"power" ]
] else [ ]; else [];
extraGroups = baseGroups ++ rpiGroups; extraGroups = baseGroups ++ rpiGroups;
basePackages = with pkgs; [ home-manager ]; basePackages = with pkgs; [home-manager];
wslPackages = wslPackages =
if config.wsl.enable then with pkgs; [ if config.wsl.enable
then
with pkgs; [
wslu wslu
wsl-open wsl-open
] else [ ]; ]
else [];
packages = basePackages ++ wslPackages; packages = basePackages ++ wslPackages;
in in {
{
options = { options = {
hardware.raspberry-pi.enable = lib.mkEnableOption "raspberry pi features"; hardware.raspberry-pi.enable = lib.mkEnableOption "raspberry pi features";
}; };
config = { config = {
users = { users = {
groups.${username} = { }; groups.${username} = {};
users = { users = {
${username} = { ${username} = {
inherit packages extraGroups; inherit packages extraGroups;
@ -50,4 +59,3 @@ in
}; };
}; };
} }

View File

@ -1,4 +1,4 @@
{ lib, ... }: { {lib, ...}: {
imports = [ imports = [
./fonts ./fonts
./sound ./sound
@ -14,5 +14,10 @@
programs.dconf.enable = lib.mkDefault true; programs.dconf.enable = lib.mkDefault true;
hardware.opengl.enable = lib.mkDefault true; hardware.opengl.enable = lib.mkDefault true;
desktop.enable = lib.mkDefault true; desktop.enable = lib.mkDefault true;
security.polkit.enable = lib.mkDefault true;
services = {
upower.enable = lib.mkDefault true;
gvfs.enable = lib.mkDefault true;
};
}; };
} }

View File

@ -21,6 +21,7 @@
}; };
xserver = { xserver = {
enable = true; enable = true;
updateDbusEnvironment = true;
windowManager.awesome = { windowManager.awesome = {
enable = true; enable = true;
luaModules = with pkgs.luaPackages; [ luaModules = with pkgs.luaPackages; [

View File

@ -14,12 +14,35 @@ in
}; };
config = let config = let
user = "kodi"; user = "kodi";
starter = pkgs.callPackage (
{pkgs, kodi-standalone, ...}:
pkgs.writeShellApplication {
name = "kodi-launcher";
runtimeInputs = [kodi-standalone];
text = ''
#!/usr/bin/env bash
while true
do
ping -c1 svartalbenheim.odie.intranet && break
sleep 5
done
while true
do
sleep 1
kodi-standalone
done
'';
}
) {};
in in
lib.mkIf cfg.enable { lib.mkIf cfg.enable {
services.cage = { services.cage = {
inherit user; inherit user;
enable = true; enable = true;
program = "${pkgs.kodi-standalone}/bin/kodi-standalone"; program = "${starter}/bin/kodi-launcher";
}; };
users.users.kodi = { users.users.kodi = {

View File

@ -8,5 +8,5 @@ with lib;
services.nginx = { services.nginx = {
recommendedProxySettings = true; recommendedProxySettings = true;
}; };
networking.firewall.allowedTCPPorts = [80]; networking.firewall.allowedTCPPorts = [80 443];
} }

View File

@ -16,7 +16,17 @@ in {
language.base = vars.locale; language.base = vars.locale;
stateVersion = "23.05"; stateVersion = "23.05";
}; };
mediacenter.kodi.enable = true; mediacenter.kodi = {
enable = true;
media = {
host = "svartalbenheim.odie.intranet";
pass = "Bx5sTkw1Qeg69I9!";
};
mysql = {
host = "svartalbenheim.odie.intranet";
pass = "Bx5sTkw1Qeg69I9!";
};
};
} }
]; ];
} }

View File

@ -18,6 +18,10 @@
awesome = { awesome = {
enable = false; enable = false;
}; };
network-manager.enable = false;
xserver.enable = false;
pcmanfm.enable = false;
thunar.enable = false;
}; };
programs = { programs = {
firefox.enable = false; firefox.enable = false;
@ -33,7 +37,6 @@
home.packages = with pkgs; [ home.packages = with pkgs; [
nix-serve nix-serve
]; ];
desktop.network-manager.enable = false;
} }
]; ];
} }

View File

@ -1,13 +1,30 @@
{ outputs, ... }: { {outputs, ...}: {
imports = [ imports = [
outputs.homeManagerModules.base outputs.homeManagerModules.base
outputs.homeManagerModules.shell outputs.homeManagerModules.shell
outputs.homeManagerModules.user outputs.homeManagerModules.user
# outputs.homeManagerModules.desktop outputs.homeManagerModules.desktop
outputs.homeManagerModules.development outputs.homeManagerModules.development
outputs.homeManagerModules.games outputs.homeManagerModules.games
{ outputs.homeManagerModules.binary-cache
services.picom.enable = false;
}
]; ];
desktop = {
enable = false;
awesome.enable = false;
pcmanfm.enable = false;
thunar.enable = false;
network-manager.enable = false;
};
programs = {
kitty.enable = true;
keepassxc.enable = false;
firefox.enable = false;
};
services = {
nextcloud-client.enable = false;
udiskie.enable = false;
picom.enable = false;
};
theme.cursor.enable = false;
theme.gtk.enable = false;
} }

View File

@ -11,6 +11,7 @@
outputs.homeManagerModules.development outputs.homeManagerModules.development
outputs.homeManagerModules.games outputs.homeManagerModules.games
outputs.homeManagerModules.user outputs.homeManagerModules.user
outputs.homeManagerModules.binary-cache
]; ];
home.stateVersion = "23.11"; home.stateVersion = "23.11";
desktop = { desktop = {
@ -23,5 +24,8 @@
terminal = "alacritty"; terminal = "alacritty";
}; };
services.picom.enable = false; services.picom.enable = false;
programs.rofi.enable = true; programs = {
rofi.enable = true;
kitty.enable = true;
};
} }

View File

@ -17,9 +17,6 @@
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
services.nginx.enable = true;
services.nix-serve.enable = true;
home-manager.users = home-manager.users =
flakeLib.mkNixosHomeConfiguration { flakeLib.mkNixosHomeConfiguration {
inherit vars system; inherit vars system;
@ -29,5 +26,7 @@
vars = vars // {username = "kodi";}; vars = vars // {username = "kodi";};
}; };
services.nginx.enable = true;
system.stateVersion = "23.11"; system.stateVersion = "23.11";
} }