upgrade to nixos 23.11 & manual libtensorflow

This commit is contained in:
Danilo Reyes 2023-11-30 16:32:04 -06:00
parent 47db75aa0d
commit 9717a2422a
2 changed files with 45 additions and 20 deletions

View File

@ -32,7 +32,7 @@ configurations.
#+begin_src nix #+begin_src nix
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let let
version = "23.05"; version = "23.11";
myEmail = "CaptainJawZ@outlook.com"; myEmail = "CaptainJawZ@outlook.com";
myName = "Danilo Reyes"; myName = "Danilo Reyes";
cpuArchitecture = "skylake"; cpuArchitecture = "skylake";
@ -277,7 +277,6 @@ nixpkgs = {
allowUnfree = true; allowUnfree = true;
permittedInsecurePackages = [ permittedInsecurePackages = [
"openssl-1.1.1w" "openssl-1.1.1w"
"nodejs-14.21.3"
]; ];
}; };
# localSystem = { # localSystem = {
@ -383,7 +382,7 @@ fzf # fuzzy finder! super cool and useful
gdu # disk-space utility, somewhat useful gdu # disk-space utility, somewhat useful
du-dust # rusty du du-dust # rusty du
trash-cli # oop! didn't meant to delete that trash-cli # oop! didn't meant to delete that
unstable.eza # like ls but with colors eza # like ls but with colors
rmlint # probably my favourite app, amazing dupe finder that integrates well with BTRFS rmlint # probably my favourite app, amazing dupe finder that integrates well with BTRFS
smartmontools # check hard drie health smartmontools # check hard drie health
#+end_src #+end_src
@ -707,6 +706,34 @@ environment = {
dlib dlib
fd fd
ripgrep ripgrep
# Upgrades postgres
(let
# XXX specify the postgresql package you'd like to upgrade to.
# Do not forget to list the extensions you need.
newPostgres = pkgs.postgresql_16.withPackages (pp: [
# pp.plv8
]);
in pkgs.writeScriptBin "upgrade-pg-cluster" ''
set -eux
# XXX it's perhaps advisable to stop all services that depend on postgresql
systemctl stop postgresql
export NEWDATA="/var/lib/postgresql/${newPostgres.psqlSchema}"
export NEWBIN="${newPostgres}/bin"
export OLDDATA="${config.services.postgresql.dataDir}"
export OLDBIN="${config.services.postgresql.package}/bin"
install -d -m 0700 -o postgres -g postgres "$NEWDATA"
cd "$NEWDATA"
sudo -u postgres $NEWBIN/initdb -D "$NEWDATA"
sudo -u postgres $NEWBIN/pg_upgrade \
--old-datadir "$OLDDATA" --new-datadir "$NEWDATA" \
--old-bindir $OLDBIN --new-bindir $NEWBIN \
"$@"
'')
]; ];
variables = rec { variables = rec {
# PATH # PATH

View File

@ -1,7 +1,7 @@
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
let let
localhost = "127.0.0.1"; localhost = "127.0.0.1";
postgresPort = toString (config.services.postgresql.port); postgresSocket = "/run/postgresql";
unstable = import unstable = import
(builtins.fetchTarball "https://github.com/nixos/nixpkgs/tarball/master") { (builtins.fetchTarball "https://github.com/nixos/nixpkgs/tarball/master") {
config = config.nixpkgs.config; config = config.nixpkgs.config;
@ -19,7 +19,9 @@ in {
nextcloud = base // { nextcloud = base // {
extraGroups = [ "render" ]; extraGroups = [ "render" ];
packages = (with pkgs; [ packages = (with pkgs; [
nodejs_14 nodejs
python3
python3Packages.tensorflowWithCuda
perl perl
(perlPackages.buildPerlPackage rec { (perlPackages.buildPerlPackage rec {
pname = "Image-ExifTool"; pname = "Image-ExifTool";
@ -38,8 +40,8 @@ in {
group = "piracy"; group = "piracy";
}; };
in { in {
sonarr = base // { package = unstable.pkgs.sonarr; }; sonarr = base // { package = pkgs.sonarr; };
radarr = base // { package = unstable.pkgs.radarr; }; radarr = base // { package = pkgs.radarr; };
bazarr = base // { }; bazarr = base // { };
jellyfin = base // { }; jellyfin = base // { };
prowlarr.enable = true; prowlarr.enable = true;
@ -49,11 +51,8 @@ in {
consumptionDirIsPublic = true; consumptionDirIsPublic = true;
extraConfig = { extraConfig = {
PAPERLESS_DBENGINE = "postgress"; PAPERLESS_DBENGINE = "postgress";
PAPERLESS_DBHOST = "${localhost}";
PAPERLESS_DBNAME = "paperless"; PAPERLESS_DBNAME = "paperless";
PAPERLESS_DBUSER = "paperless"; PAPERLESS_DBHOST = postgresSocket;
PAPERLESS_DBPASS = "sopacerias";
PAPERLESS_DBPORT = "${postgresPort}";
PAPERLESS_CONSUMER_IGNORE_PATTERN = PAPERLESS_CONSUMER_IGNORE_PATTERN =
builtins.toJSON [ ".DS_STORE/*" "desktop.ini" ]; builtins.toJSON [ ".DS_STORE/*" "desktop.ini" ];
PAPERLESS_TIME_ZONE = "America/Mexico_City"; PAPERLESS_TIME_ZONE = "America/Mexico_City";
@ -66,15 +65,14 @@ in {
vaultwarden = { vaultwarden = {
enable = true; enable = true;
dbBackend = "postgresql"; dbBackend = "postgresql";
package = unstable.pkgs.vaultwarden; package = pkgs.vaultwarden;
config = { config = {
ROCKET_ADDRESS = "${localhost}"; ROCKET_ADDRESS = "${localhost}";
ROCKET_PORT = 8222; ROCKET_PORT = 8222;
WEBSOCKET_PORT = 8333; WEBSOCKET_PORT = 8333;
ADMIN_TOKEN = ADMIN_TOKEN =
"x9BLqz2QmnU5RmrMLt2kPpoPBTNPZxNFw/b8XrPgpQML2/01+MYENl87dmhDX+Jm"; "x9BLqz2QmnU5RmrMLt2kPpoPBTNPZxNFw/b8XrPgpQML2/01+MYENl87dmhDX+Jm";
DATABASE_URL = DATABASE_URL = "postgresql:///vaultwarden?host=${postgresSocket}";
"postgresql://vaultwarden:sopacerias@${localhost}:${postgresPort}/vaultwarden";
ENABLE_DB_WAL = false; ENABLE_DB_WAL = false;
WEBSOCKET_ENABLED = true; WEBSOCKET_ENABLED = true;
SHOW_PASSWORD_HINT = false; SHOW_PASSWORD_HINT = false;
@ -104,8 +102,7 @@ in {
overwriteProtocol = "https"; overwriteProtocol = "https";
defaultPhoneRegion = "MX"; defaultPhoneRegion = "MX";
dbtype = "pgsql"; dbtype = "pgsql";
dbuser = "nextcloud"; dbhost = postgresSocket;
dbpassFile = "${pkgs.writeText "dbpass" "sopacerias"}";
dbtableprefix = "oc_"; dbtableprefix = "oc_";
dbname = "nextcloud"; dbname = "nextcloud";
trustedProxies = [ "nginx" ]; trustedProxies = [ "nginx" ];
@ -153,22 +150,23 @@ in {
postgresql = { postgresql = {
enable = true; enable = true;
ensureDatabases = [ "paperless" "nextcloud" "mealie" "vaultwarden" ]; ensureDatabases = [ "paperless" "nextcloud" "mealie" "vaultwarden" ];
package = pkgs.postgresql_16;
ensureUsers = [ ensureUsers = [
{ {
name = "nextcloud"; name = "nextcloud";
ensurePermissions = { "DATABASE nextcloud" = "ALL PRIVILEGES"; }; ensureDBOwnership = true;
} }
{ {
name = "paperless"; name = "paperless";
ensurePermissions = { "DATABASE paperless" = "ALL PRIVILEGES"; }; ensureDBOwnership = true;
} }
{ {
name = "mealie"; name = "mealie";
ensurePermissions = { "DATABASE mealie" = "ALL PRIVILEGES"; }; ensureDBOwnership = true;
} }
{ {
name = "vaultwarden"; name = "vaultwarden";
ensurePermissions = { "DATABASE vaultwarden" = "ALL PRIVILEGES"; }; ensureDBOwnership = true;
} }
]; ];
authentication = pkgs.lib.mkOverride 10 '' authentication = pkgs.lib.mkOverride 10 ''