feat!(flake): update homix

Update flake (`neovim-nightly-overlay` is fixed)
Format all `.nix` files
Unify package/module argument order:
    - `inputs`, `outputs`, `lib`, `pkgs`, `config`, ...
Move Jellyfin config to a `NixOS` module (first one, yay)
Add `direnv` to `reo101-shell` modules (was used, but not defined as wanted)
    - TODO: make it optional (module config options)
This commit is contained in:
reo101 2023-02-13 00:33:57 +02:00
parent 6a0898753d
commit df9ce2d4e2
Signed by: reo101
GPG key ID: 675AA7EF13964ACB
17 changed files with 194 additions and 158 deletions

View file

@ -1,8 +1,10 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.reo101.shell;
in {
in
{
imports = [
];
@ -15,10 +17,10 @@ in {
config = mkIf cfg.enable {
home.packages = with pkgs; [
# Shell
zsh
starship
zoxide
direnv
];
programs.zsh = {
@ -216,7 +218,7 @@ in {
};
custom.local = {
shell = ["zsh" "-d" "-f"];
shell = [ "zsh" "-d" "-f" ];
when = ''[[ -z "$SSH_CLIENT" ]] && [[ `whoami` != "root" ]]'';
format = "[$symbol$output]($style)[@](bold yellow)";
command = "whoami";
@ -225,7 +227,7 @@ in {
};
custom.local_root = {
shell = ["zsh" "-d" "-f"];
shell = [ "zsh" "-d" "-f" ];
when = ''[[ -z "$SSH_CLIENT" ]] && [[ `whoami` == "root" ]]'';
format = "[ $output ]($style)[@](bold yellow)";
command = "whoami";
@ -233,7 +235,7 @@ in {
};
custom.ssh = {
shell = ["zsh" "-d" "-f"];
shell = [ "zsh" "-d" "-f" ];
when = ''[[ -n "$SSH_CLIENT" ]] && [[ `whoami` != "root" ]]'';
format = "[ $symbol$output ]($style)[@](bold yellow)";
command = "whoami";
@ -243,7 +245,7 @@ in {
};
custom.ssh_root = {
shell = ["zsh" "-d" "-f"];
shell = [ "zsh" "-d" "-f" ];
when = ''[[ -n "$SSH_CLIENT" ]] && [[ `whoami` == "root" ]]'';
format = "[ $symbol$output ]($style)[@](bold yellow)";
command = "whoami";
@ -253,4 +255,8 @@ in {
};
};
};
meta = {
maintainers = with lib.maintainers; [ reo101 ];
};
}

View file

@ -4,4 +4,5 @@
{
# List your module files here
# my-module = import ./my-module.nix;
jellyfin = import ./jellyfin.nix;
}

View file

@ -1,60 +1,61 @@
{ config, nixpkgs, ... }:
{ lib, pkgs, config, ... }:
### Jellyfin
# nixpkgs.config.packageOverrides = pkgs: {
# arc = import (builtins.fetchTarball {
# url = "https://github.com/arcnmx/nixexprs/archive/1a2ca1935e243383dfc8dc89f88f55678d33fcd4.tar.gz";
# sha256 = "sha256:0zjy3916sxxk7ds763dmmbzfdc46wdlw10m5dg6kkpqi2i81109f";
# }) {
# inherit pkgs;
# };
# vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
# };
# hardware.nvidia.package = pkgs.arc.packages.nvidia-patch.override {
# nvidia_x11 = config.boot.kernelPackages.nvidiaPackages.stable;
# };
# hardware.opengl = {
# enable = true;
# extraPackages = with pkgs; [
# intel-media-driver
# vaapiIntel
# vaapiVdpau
# libvdpau-va-gl
# intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
# ];
# };
virtualisation.oci-containers.containers."jellyfin" = {
autoStart = true;
image = "docker.io/jellyfin/jellyfin:latest";
volumes = [
"/var/cache/jellyfin/config:/config"
"/var/cache/jellyfin/cache:/cache"
"/var/log/jellyfin:/log"
"/media:/media:ro"
with lib;
let
cfg = config.reo101.jellyfin;
in
{
imports = [
];
ports = [ "8096:8096" ];
environment = {
JELLYFIN_LOG_DIR = "/log";
options = {
reo101.jellyfin = {
enable = mkEnableOption "reo101 Jellyfin config";
image = mkOption {
type = types.strMatching ".+/.+:.+";
default = "docker.io/jellyfin/jellyfin:latest";
defaultText = "docker.io/jellyfin/jellyfin:latest";
description = ''
The Docker image for Jellyfin
'';
};
volumes = mkOption {
type = types.listOf (types.strMatching ".+:.+");
default = [
"/var/cache/jellyfin/config:/config"
"/var/cache/jellyfin/cache:/cache"
"/var/log/jellyfin:/log"
"/media:/media:ro"
];
description = ''
The volumes the Jellyfin container should bind to
'';
};
ports = mkOption {
type = types.listOf (types.strMatching ".+:.+");
default = [
"8096:8096"
];
description = ''
The ports the Jellyfin container should bind to
'';
};
};
};
};
## services.jellyfin.enable = true;
## systemd.services."jellyfin".serviceConfig = {
## DeviceAllow = pkgs.lib.mkForce [
## "char-drm rw"
## "char-nvidia-frontend rw"
## "char-nvidia-uvm rw"
## ];
## PrivateDevices = pkgs.lib.mkForce true;
## RestrictAddressFamilies = pkgs.lib.mkForce [
## "AF_UNIX"
## "AF_NETLINK"
## "AF_INET"
## "AF_INET6"
## ];
## };
config = mkIf cfg.enable {
virtualisation.oci-containers.containers."jellyfin" = {
autoStart = true;
image = cfg.image;
volumes = cfg.volumes;
ports = cfg.ports;
environment = {
JELLYFIN_LOG_DIR = "/log";
};
};
};
meta = {
maintainers = with lib.maintainers; [ reo101 ];
};
}