Compare commits

...

9 Commits

Author SHA1 Message Date
Giulio De Pasquale
b785fe04aa flake update 2024-03-14 11:15:06 +00:00
Giulio De Pasquale
8768e555df navidrome: reenable beets-import and update 2024-03-14 11:07:35 +00:00
Giulio De Pasquale
5d27c4829e navidrome: use music.giugl.io 2024-03-14 11:07:18 +00:00
Giulio De Pasquale
0fb14ce253 lidarr: move to architect options 2024-03-14 11:06:51 +00:00
Giulio De Pasquale
c0ceb7729a architect: enabled navidrome, disabled lidarr 2024-03-14 11:05:57 +00:00
Giulio De Pasquale
5c81aa0ad9 architect: commented out nvidia in main 2024-03-14 11:05:41 +00:00
Giulio De Pasquale
00973bfc59 flake: add nvidia-patch flake 2024-03-13 18:38:32 +00:00
Giulio De Pasquale
04f1d5a42b sunshine: use nvfbc 2024-03-13 18:37:35 +00:00
Giulio De Pasquale
98d2e39d28 architect: remove vdpau as default libva driver 2024-03-13 13:22:39 +00:00
6 changed files with 115 additions and 69 deletions

55
flake.lock generated
View File

@ -24,7 +24,7 @@
"local-unstable": {
"locked": {
"lastModified": 0,
"narHash": "sha256-IpDKZGbaoaWizPo0tst5yJ5ZIDwL6iq/juqXjGpQ7jQ=",
"narHash": "sha256-po3G6QMecwbQjwevncJXrIYFWHqdOnZosO/pH+8RZ+k=",
"path": "/home/giulio/dev/nixpkgs",
"type": "path"
},
@ -35,27 +35,27 @@
},
"nixos-unstable": {
"locked": {
"lastModified": 1708296515,
"narHash": "sha256-FyF489fYNAUy7b6dkYV6rGPyzp+4tThhr80KNAaF/yY=",
"lastModified": 1710414438,
"narHash": "sha256-UmaVMvCKex3gm7JasposQxTrxD8TlpRk82gtzr//yaU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b98a4e1746acceb92c509bc496ef3d0e5ad8d4aa",
"rev": "3e33aea56df04bfb498f7ccbc76b1f4f87390de7",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1708509836,
"narHash": "sha256-Gk86rEGzpc4ZtlJs2wqCCpAlDcmVgojazG2FqkHrB6Y=",
"lastModified": 1710399145,
"narHash": "sha256-yhGlmdqxfstngEs3qikYyqU93iqi39GLOiJ7XDWFdPQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e837b632e2417b275998501e381be3270afc3ee2",
"rev": "d3eeab67779382692725ac423b023edecbd8547e",
"type": "github"
},
"original": {
@ -65,12 +65,49 @@
"type": "github"
}
},
"nvidia-patch": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"utils": "utils"
},
"locked": {
"lastModified": 1710353022,
"narHash": "sha256-f4hsLsOqPUlh3iqg6gARj+c4pZzJhaPhoeoH36u0yQM=",
"owner": "peperunas",
"repo": "nvidia-patch-nixos",
"rev": "021ad79e03f4a2266a98f90ac63b08d3e72f0ab0",
"type": "github"
},
"original": {
"owner": "peperunas",
"repo": "nvidia-patch-nixos",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"local-unstable": "local-unstable",
"nixos-unstable": "nixos-unstable",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"nvidia-patch": "nvidia-patch"
}
},
"utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},

View File

@ -7,9 +7,13 @@
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nvidia-patch = {
url = "github:peperunas/nvidia-patch-nixos";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nixos-unstable, local-unstable, home-manager }:
outputs = { self, nixpkgs, nixos-unstable, local-unstable, home-manager, nvidia-patch }:
let
sysLinuxX64 = "x86_64-linux";
sysDarwin = "aarch64-darwin";
@ -36,6 +40,7 @@
overlays = [
(final: prev: { inherit unstablePkgs; })
(final: prev: { inherit localPkgs; })
(nvidia-patch.overlay)
];
};
@ -54,7 +59,7 @@
});
pkgsLinuxX64Cuda = wrapPkgsSystem { system = sysLinuxX64; cudaSupport = true; };
pkgsLinuxX64Cuda = wrapPkgsSystem { system = sysLinuxX64; };
utilsLinuxX64Cuda = wrapUtils { system = sysLinuxX64; pkgs = pkgsLinuxX64Cuda; };
pkgsLinuxAarch = wrapPkgsSystem { system = sysLinuxAarch; };

View File

@ -31,7 +31,7 @@ in
./libreddit.nix
# ./invidious.nix
# ./lidarr.nix
# ./navidrome.nix
./navidrome.nix
./jellyfin.nix
# ./prosody.nix
# ./deluge.nix
@ -146,7 +146,9 @@ in
fwupd.enable = true;
das_watchdog.enable = true;
zfs.autoScrub.enable = true;
xserver.videoDrivers = [ "nvidia" ];
# TODO: put NVIDIA related in another module
# xserver.videoDrivers = [ "nvidia" ];
openssh = {
enable = true;
@ -161,9 +163,5 @@ in
};
smartd.enable = true;
};
environment = {
variables = { LIBVA_DRIVER_NAME = "vdpau"; };
};
}

View File

@ -1,11 +1,7 @@
{ config, lib, ... }:
{ config, ... }:
let
domain = "htlid.giugl.io";
auth_block = (import ./openid.nix { inherit lib; }).openresty_oidc_block;
utilities = import ./utilities.nix { inherit lib config; };
inherit (utilities) architectInterfaceAddress;
in
{
services = {
@ -13,23 +9,17 @@ in
enable = true;
group = "media";
};
};
nginx.virtualHosts.${domain} = {
forceSSL = true;
enableACME = true;
architect.vhost.${domain} = {
dnsInterfaces = [ "lan" "tailscale" ];
locations."/" = {
proxyPass = "http://127.0.0.1:8686";
extraConfig = auth_block {
access_role = "lidarr";
port = 8686;
allowLan = true;
allowWAN = false;
allow = [ config.architect.networks."tailscale".net ];
};
};
};
};
networking.extraHosts = ''
${architectInterfaceAddress "lan"} ${domain}
${architectInterfaceAddress "tailscale"} ${domain}
'';
users.groups.media.members = [ "lidarr" ];
}

View File

@ -1,7 +1,7 @@
{ config, lib, pkgs, ... }:
let
domain = "music.runas.rocks";
domain = "music.giugl.io";
library_path = "/media/Music";
beets_config = "/media/beets.conf";
in
@ -30,29 +30,30 @@ in
};
};
# systemd.services = {
# "beets-update" = {
# enable = true;
# # requires = [ "remove-badmp3.service" "remove-badflac.service" ];
# before = [ "beets-import.service" ];
# serviceConfig = {
# Type = "oneshot";
# ExecStart = "${pkgs.beets}/bin/beet -c ${beets_config} update";
# };
# };
systemd.services = {
"beets-update" = {
enable = true;
# requires = [ "remove-badmp3.service" "remove-badflac.service" ];
before = [ "beets-import.service" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.beets}/bin/beet -c ${beets_config} update";
};
};
# "beets-import" = {
# enable = true;
# path = [ pkgs.imagemagick ];
# requires = [ "beets-update.service" ];
# after = [ "beets-update.service" ];
# serviceConfig = {
# Type = "oneshot";
# ExecStart =
# "${pkgs.beets}/bin/beet -c ${beets_config} import --flat -q ${library_path}";
# };
# startAt = "weekly";
# };
"beets-import" = {
enable = true;
path = [ pkgs.imagemagick ];
requires = [ "beets-update.service" ];
after = [ "beets-update.service" ];
serviceConfig = {
Type = "oneshot";
ExecStart =
"${pkgs.beets}/bin/beet -c ${beets_config} import --flat -q ${library_path}";
};
startAt = "weekly";
};
};
# "remove-badmp3" = {
# enable = true;

View File

@ -1,15 +1,14 @@
{ config, pkgs, ... }:
let
# nvidia-patch
rev = "b63013c"; # revision from https://github.com/keylase/nvidia-patch to use
hash = "sha256-EDPoMTj3J1f/7Sv/q7P/lZ4r2aXOCdsbZ4FumbvuCWk="; # sha256sum for https://github.com/keylase/nvidia-patch at the specified revision
rev = "c4388cf"; # revision from https://github.com/keylase/nvidia-patch to use
hash = "sha256-ua6LpbV3ymR22hAT2AZenoMXDqr3DUJ1wtBi/Psypow="; # sha256sum for https://github.com/keylase/nvidia-patch at the specified revision
# create patch functions for the specified revision
nvidia-patch = pkgs.nvidia-patch rev hash;
# nvidia package to patch
nvidiaPackage = config.boot.kernelPackages.nvidiaPackages.stable;
nvidiaPackage = config.boot.kernelPackages.nvidiaPackages.latest;
user = "sunshine";
resolutionScript = pkgs.writeTextFile {
@ -35,19 +34,23 @@ let
xrandr --output DP-0 --primary --mode ''${mode_alias} --pos 0x0 --rotate normal
/run/current-system/sw/bin/nvidia-settings -a 'SyncToVBlank=0'
/run/current-system/sw/bin/nvidia-smi --persistence-mode=ENABLED
'';
executable = true;
destination = "/bin/resolution.sh";
};
configFile = pkgs.writeText "sunshine.conf"
''
output_name=1
capture=nvfbc
encoder=nvenc
wan_encryption_mode = 0
lan_encryption_mode = 0
origin_web_ui_allowed=lan
channels=2
min_threads=12
global_prep_cmd=[{"do":"${pkgs.bash}/bin/bash -c \"${resolutionScript}/bin/resolution.sh ''${SUNSHINE_CLIENT_WIDTH} ''${SUNSHINE_CLIENT_HEIGHT} ''${SUNSHINE_CLIENT_FPS}\""}]
'';
sunshineOverride = pkgs.unstablePkgs.sunshine.override { cudaSupport = true; };
sunshinePkg = pkgs.unstablePkgs.sunshine.override { cudaSupport = true; };
in
{
security = {
@ -62,22 +65,29 @@ in
}
});
'';
rtkit.enable = true;
};
environment.systemPackages = with pkgs; [
sunshineOverride
sunshinePkg
xorg.xrandr
xorg.xorgserver
xorg.libxcvt
gamemode
];
environment.variables = {
VDPAU_DRIVER = "nvidia";
LIBVA_DRIVER_NAME = "nvidia";
NVD_BACKEND = "direct";
};
sound.enable = true;
services.xserver = {
enable = true;
videoDrivers = [ "nvidia" ];
displayManager = {
sddm = {
enable = true;
@ -155,7 +165,7 @@ in
after = [ "graphical-session.target" ];
path = with pkgs; [ resolutionScript xorg.xrandr bash xorg.libxcvt xorg.xorgserver gawk gamemode ];
serviceConfig = {
ExecStart = "${sunshineOverride}/bin/sunshine ${configFile}";
ExecStart = "${sunshinePkg}/bin/sunshine ${configFile}";
Restart = "on-failure";
RestartSec = "5s";
};
@ -165,6 +175,10 @@ in
services.avahi.publish.userServices = true;
boot.kernelModules = [ "uinput" ];
services.udev.extraRules = ''
KERNEL=="uinput", SUBSYSTEM=="misc", OPTIONS+="static_node=uinput", TAG+="uaccess"
'';
programs.steam.enable = true;
hardware = {
@ -182,6 +196,7 @@ in
open = false;
nvidiaSettings = true;
package = nvidia-patch.patch-nvenc (nvidia-patch.patch-fbc nvidiaPackage);
# package = config.boot.kernelPackages.nvidiaPackages.production;
};
};