diff --git a/common/nixos-wayland.nix b/common/nixos-wayland.nix index ada471d..0c5e58b 100644 --- a/common/nixos-wayland.nix +++ b/common/nixos-wayland.nix @@ -82,6 +82,9 @@ patches = prev.patches or [] ++ [ ../overlays/patches/flameshot-wayland.patch ]; })) + hyprpicker + satty + nwg-displays waybar /* (waybar.overrideAttrs (prev: { @@ -191,6 +194,37 @@ ### Output configuration output * scale 1 bg #121212 solid_color + output "HEADLESS-1" { + mode 1920x1080@1.0Hz + pos 5760 532 + transform normal + scale 1.0 + scale_filter nearest + adaptive_sync off + dpms on + } + + output "eDP-1" { + mode 1920x1080@60.001Hz + pos 0 884 + transform normal + scale 1.0 + scale_filter nearest + adaptive_sync off + dpms on + } + output "DP-1" { + mode 3840x2160@59.997Hz + pos 1920 0 + transform normal + scale 1.0 + scale_filter nearest + adaptive_sync off + dpms on + } + workspace 5 output eDP-1 + workspace 0 output HEADLESS-1 + ### Input configuration input type:keyboard { xkb_layout de,de @@ -319,8 +353,8 @@ bindsym $mod+Shift+Up move up bindsym $mod+Shift+Right move right - bindsym $mod+u workspace prev - bindsym $mod+i workspace next + #bindsym $mod+u workspace prev + #bindsym $mod+i workspace next # Workspaces: bindsym $mod+1 workspace number 1 @@ -459,8 +493,6 @@ "cpu" "temperature" "battery" - "power-profiles-daemon" - "custom/power-usage" "disk" ]; diff --git a/flake.lock b/flake.lock index 292535c..cabf8f6 100644 --- a/flake.lock +++ b/flake.lock @@ -1276,6 +1276,24 @@ "type": "github" } }, + "flake-utils_24": { + "inputs": { + "systems": "systems_18" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "flake-utils_3": { "inputs": { "systems": "systems_2" @@ -3667,6 +3685,7 @@ "robotnix": "robotnix", "systems": "systems_5", "victorinix": "victorinix", + "vscode-server": "vscode-server", "waveforms": "waveforms", "zephyr-nix": "zephyr-nix", "zmk-nix": "zmk-nix" @@ -3920,6 +3939,21 @@ "type": "github" } }, + "systems_18": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "systems_2": { "locked": { "lastModified": 1681028828, @@ -4158,6 +4192,27 @@ "type": "github" } }, + "vscode-server": { + "inputs": { + "flake-utils": "flake-utils_24", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729422940, + "narHash": "sha256-DlvJv33ml5UTKgu4b0HauOfFIoDx6QXtbqUF3vWeRCY=", + "owner": "nix-community", + "repo": "nixos-vscode-server", + "rev": "8b6db451de46ecf9b4ab3d01ef76e59957ff549f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-vscode-server", + "type": "github" + } + }, "waveforms": { "inputs": { "nixpkgs": [ diff --git a/flake.nix b/flake.nix index 4b57b5f..47493b6 100644 --- a/flake.nix +++ b/flake.nix @@ -88,6 +88,11 @@ url = "github:liff/waveforms-flake"; inputs.nixpkgs.follows = "nixpkgs"; }; + + vscode-server = { + url = "github:nix-community/nixos-vscode-server"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { self, nixpkgs, nixpkgs-unstable, nixos-generators, flake-utils, systems, ... }@inputs: @@ -114,6 +119,7 @@ #}) #]; }; + mypkgs = import nixpkgs { system = "x86_64-linux"; config = { @@ -129,8 +135,15 @@ ]; }; + pkgsUnstable = import nixpkgs-unstable { + system = "x86_64-linux"; + config = { + allowUnfree = true; + }; + }; + specialArgs = { - inherit inputs confDir workDir secretsDir persistentDir self tunepkgs unstable nur; + inherit inputs confDir workDir secretsDir persistentDir self tunepkgs unstable nur pkgsUnstable; system = "x86_64-linux"; pkgs = mypkgs; }; @@ -243,7 +256,7 @@ img = builtins.mapAttrs (name: value: # build tarball for wsl systems and sdImage for others..... - if value.config.wsl.enable then value.config.system.build.tarballBuilder else value.config.system.build.sdImage + if builtins.hasAttr "wsl" value.config && value.config.wsl.enable then value.config.system.build.tarballBuilder else value.config.system.build.sdImage ) (self.nixOnDroidConfigurations // self.nixosConfigurations); # this is my nur repo, that you can import and call with pkgs @@ -375,7 +388,6 @@ specialArgs = { inherit inputs confDir workDir secretsDir persistentDir self system; }; modules = [ ./hosts/lush.nix - ]; }; diff --git a/hosts/acern.nix b/hosts/acern.nix index 4efc6d9..263d9e0 100644 --- a/hosts/acern.nix +++ b/hosts/acern.nix @@ -12,6 +12,8 @@ programs.bash.loginShellInit = ""; + virtualisation.docker.enable = true; + users.users.me.extraGroups = [ "docker" ]; # to build rpi images boot.binfmt.emulatedSystems = [ diff --git a/hosts/fusu.nix b/hosts/fusu.nix index 4761f89..695077f 100644 --- a/hosts/fusu.nix +++ b/hosts/fusu.nix @@ -61,6 +61,8 @@ qemuSwtpm = true; #qemuOvmfPackage = pkgs.OVMFFull; }; + virtualisation.docker.enable = true; + users.users.server.extraGroups = [ "docker" ]; # Use the GRUB 2 boot loader. boot.loader.grub = { @@ -119,8 +121,17 @@ 49391 49392 49393 + ]; + + networking.firewall.allowedTCPPortRanges = [ + { from = 25500; to = 27777;} # minecraft + ]; + networking.firewall.allowedUDPPortRanges = [ + { from = 27700; to = 28800;} # minecraft + ]; + networking.firewall.allowedUDPPorts = [ 3702 # wsdd 67 # allow DHCP traffic @@ -313,6 +324,7 @@ "recycle:touch_mtime" = "Yes"; "recycle:maxsize" = "8000"; }; + mama = { "comment" = "Meine Dateien auf Mamas Laptop"; "path" = "/home/files/storage/files/stuff/Mamas-Laptop"; diff --git a/hosts/lush.nix b/hosts/lush.nix index 0720aaa..9eed47b 100644 --- a/hosts/lush.nix +++ b/hosts/lush.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, inputs, secretsDir, workDir, ... }: +{ lib, pkgs, inputs, secretsDir, config, ... }: { #system.stateVersion = "23.05"; # Did you read the comment? @@ -32,7 +32,13 @@ }; }; - boot.kernelParams = lib.mkForce ["console=ttyS0,115200n8" "console=tty0" "nohibernate" "loglevel=7" ]; + # get usbip working + boot.extraModulePackages = [ + config.boot.kernelPackages.usbip + ]; + + + boot.kernelParams = lib.mkForce ["console=ttyS0,115200n8" "console=ttyAMA0,115200n8" "console=tty0" "nohibernate" "loglevel=7" ]; # hardware.bluetooth.enable = true; @@ -62,9 +68,6 @@ services.blueman.enable = true; hardware.enableRedistributableFirmware = true; - # This causes an overlay which causes a lot of rebuilding - environment.noXlibs = lib.mkForce false; - environment.systemPackages = with pkgs; [ vim @@ -75,10 +78,11 @@ # "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" creates a # disk with this label on first boot. Therefore, we need to keep it. It is the # only information from the installer image that we need to keep persistent - fileSystems."/" = - { device = "/dev/disk/by-label/NIXOS_SD"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-label/NIXOS_SD"; + noCheck = true; + fsType = "ext4"; + }; boot = { #kernelPackages = lib.mkForce pkgs.linuxPackages_latest; @@ -115,6 +119,7 @@ networking.firewall.allowedTCPPorts = [ 8888 # general use 9999 # general use + 3240 # usbip ]; networking.hostName = "lush"; @@ -122,23 +127,6 @@ networking.networkmanager.enable = true; networking.networkmanager.profiles = { - home = { - connection = { - id = "main"; - uuid = "a02273d9-ad12-395e-8372-f61129635b6f"; - type = "ethernet"; - autoconnect-priority = "-999"; - interface-name = "eth0"; - autoconnect = true; - }; - - ipv4 = { - address1 = "192.168.1.44/24,192.168.1.1"; - dns = "1.1.1.1;"; - method = "manual"; - }; - }; - pw = { connection = { id = "pw"; @@ -198,7 +186,7 @@ id = "dhcp"; uuid = "c006389a-1697-4f77-91c3-95b466f85f13"; type = "ethernet"; - autoconnect = "false"; + autoconnect = "true"; interface-name = "end0"; }; @@ -207,6 +195,7 @@ }; ipv4 = { + address1 = "192.168.1.44/24,192.168.1.1"; method = "auto"; }; }; diff --git a/hosts/mac.nix b/hosts/mac.nix index ace3eda..06b53cb 100644 --- a/hosts/mac.nix +++ b/hosts/mac.nix @@ -1,4 +1,4 @@ -{ pkgs, inputs, ... }: let +{ secretsDir, pkgs, inputs, ... }: let myobs = pkgs.wrapOBS { plugins = with pkgs.obs-studio-plugins; [ @@ -16,13 +16,13 @@ in { ../common/building.nix inputs.home-manager.nixosModules.home-manager + inputs.networkmanager.nixosModules.networkmanager ../users/me/headless.nix ../users/root/default.nix ]; networking.hostName = "mac"; networking.firewall.enable = false; - networking.useDHCP = true; services.avahi = { enable = true; nssmdns = true; @@ -35,6 +35,30 @@ in { workstation = true; }; }; + networking.firewall.allowedTCPPorts = [ + 8888 # for general usage + 9999 # for general usage + 6000 # Xserver + 5900 # vnc for win VM + 5901 # vnc + 5902 # vnc + 4400 # rdp win VM + ]; + + boot.kernelModules = [ "usbip_core" ]; + boot.extraModprobeConfig = "options kvm_intel nested=1"; + + # to build rpi images + boot.binfmt.emulatedSystems = [ + "aarch64-linux" + ]; + + virtualisation.libvirtd = { + enable = true; + qemuOvmf = true; + qemuSwtpm = true; + #qemuOvmfPackage = pkgs.OVMFFull; + }; # Use the GRUB 2 boot loader. boot.loader.grub = { @@ -48,6 +72,7 @@ in { }; environment.systemPackages = with pkgs; [ + passt mount pkgs.hicolor-icon-theme efibootmgr @@ -154,4 +179,112 @@ in { systemd.defaultUnit = "graphical.target"; + + ############################# networkmanager + networking.networkmanager.enable = true; + + networking.networkmanager.profiles = { + home = { + connection = { + id = "home"; + uuid = "a02273d9-ad12-395e-8372-f61129635b6f"; + type = "ethernet"; + autoconnect-priority = "-999"; + interface-name = "enp2s0"; + }; + ipv4 = { + address1 = "192.168.1.33/24,192.168.1.1"; + dns = "1.1.1.1;"; + method = "manual"; + }; + }; + + pw = { + connection = { + id = "pw"; + uuid = "e0103dac-7da0-4e32-a01b-487b8c4c813c"; + type = "wifi"; + interface-name = "wlp3s0"; + }; + + wifi = { + hidden = "true"; + mode = "infrastructure"; + ssid = builtins.readFile "${secretsDir}/wifi-ssid"; + }; + + wifi-security = { + key-mgmt = "wpa-psk"; + psk = builtins.readFile "${secretsDir}/wifi-password"; + }; + + ipv4 = { + #address1 = "192.168.20.11/24"; + dns = "1.1.1.1;8.8.8.8;"; + method = "auto"; + }; + }; + + hot = { + connection = { + id = "hot"; + uuid = "ab51de8a-9742-465a-928b-be54a83ab6a3"; + type = "wifi"; + autoconnect = false; + interface-name = "wlp3s0"; + }; + wifi = { + mac-address = "0C:96:E6:E3:64:03"; + mode = "ap"; + ssid = "c2vi-mac"; + }; + + ipv4 = { + method = "shared"; + }; + }; + + share = { + connection = { + id = "share"; + uuid = "f55f34e3-4595-4642-b1f6-df3185bc0a04"; + type = "ethernet"; + autoconnect = false; + interface-name = "enp2s0"; + }; + + ethernet = { + mac-address = "C8:2A:14:0B:7F:3D"; + }; + + ipv4 = { + address1 = "192.168.4.1/24"; + method = "shared"; + }; + + ipv6 = { + addr-gen-mode = "stable-privacy"; + method = "auto"; + }; + }; + + dhcp = { + connection = { + id = "dhcp"; + uuid = "c006389a-1697-4f77-91c3-95b466f85f13"; + type = "ethernet"; + autoconnect = "false"; + interface-name = "enp2s0"; + }; + + ethernet = { + mac-address = "C8:2A:14:0B:7F:3D"; + }; + + ipv4 = { + method = "auto"; + }; + }; + + }; } diff --git a/hosts/main.nix b/hosts/main.nix index 6013020..db46288 100644 --- a/hosts/main.nix +++ b/hosts/main.nix @@ -1,5 +1,5 @@ -{ pkgs, lib, workDir, self, secretsDir, config, inputs, system, ... }: +{ pkgs, lib, workDir, self, secretsDir, config, inputs, system, pkgsUnstable, ... }: { # https://bugzilla.kernel.org/show_bug.cgi?id=110941 @@ -38,6 +38,7 @@ services.sunshine = { + /* package = pkgs.sunshine.overrideAttrs { src = pkgs.fetchFromGitHub { owner = "garnacho"; @@ -46,6 +47,32 @@ hash = "sha256-To1vhNQxjIa5Hc+z2xo+ODSQyIH6cnI3A7Ofc7MDL60="; }; }; + */ + + package = pkgsUnstable.sunshine.overrideAttrs (prev: { + patches = prev.patches or [] ++ [ + #(pkgs.fetchpatch { + #url = "https://github.com/LizardByte/Sunshine/pull/2507.patch"; + #hash = "sha256-DdyiR7djH4GF1bcQP/a20BYpTBvrAzd0UxJ0o0nC4rU="; + #}) + ]; + + buildInputs = prev.buildInputs or [] ++ [ + pkgsUnstable.pipewire + pkgsUnstable.xdg-desktop-portal + ]; + cmakeFlage = prev.cmakeFlags or [] ++ [ + (lib.cmakeBool "SUNSHINE_ENABLE_PORTAL" true) + ]; + + src = pkgs.fetchFromGitHub { + owner = "c2vi"; + repo = "Sunshine"; + rev = "2671cd374dc5d12d402de572d170c9dfee8c5d7b"; + hash = "sha256-7IOMXmvl7/WYF6ktSUrLZjq+Lnq9YpSqUsj0FVtG8tI="; + fetchSubmodules = true; + }; + }); enable = true; autoStart = true; capSysAdmin = true; @@ -55,6 +82,9 @@ + hardware.graphics.extraPackages = with pkgs; [ + intel-media-driver intel-ocl intel-vaapi-driver intel-compute-runtime-legacy1 + ]; @@ -78,7 +108,6 @@ services.nscd.enable = lib.mkForce false; - virtualisation.docker.enable = true; system.nssModules = lib.mkForce []; @@ -149,6 +178,11 @@ environment.systemPackages = with pkgs; [ inputs.waveforms.packages.${system}.waveforms + intel-compute-runtime-legacy1 + ffmpeg-full + remmina + vesktop + prismlauncher # add pyclip for waydroid python310Packages.pyclip @@ -164,6 +198,11 @@ ]; }) + (writeShellScriptBin "davinci" '' + NIXPKGS_ALLOW_UNFREE=1 OCL_ICD_ENABLE_TRACE=True QT_QPA_PLATFORM=xcb nix run nixpkgs#davinci-resolve --impure -L + '') + + # waveforms # my keyboar flash script, that opens as an alacritty window @@ -185,9 +224,7 @@ # shedule nix builds with low priority, so the laptop is still usable while building something nix.daemonCPUSchedPolicy = "idle"; nix.daemonIONiceLevel = 7; - - - systemd.services.nix-daemon.serviceConfig.Nice = 9; + systemd.services.nix-daemon.serviceConfig.Nice = 9; # enable ntp #services.ntp.enable = true; @@ -322,6 +359,7 @@ 8080 # for mitm proxy 51820 # wireguard 6000 # Xserver + 10000 # tailscale tcp funnel ]; networking.firewall.allowedUDPPorts = [ diff --git a/hosts/mosatop.nix b/hosts/mosatop.nix index abd54a6..eb3a1b3 100644 --- a/hosts/mosatop.nix +++ b/hosts/mosatop.nix @@ -33,6 +33,10 @@ 8888 # general use 9999 # general use 25565 # minecraft + 29901 + 29902 + 29903 + 29904 ]; diff --git a/misc/my-hosts b/misc/my-hosts index 5f78b8e..1adf5f5 100644 --- a/misc/my-hosts +++ b/misc/my-hosts @@ -2,8 +2,6 @@ 127.0.0.1 www.youtube.com 192.168.122.194 uwu 192.168.122.126 lako -::1 www.youtube.com -::1 youtube.com -::1 localhost 127.0.0.1 localhost 100.70.54.18 obsidian.c2vi.dev +192.168.1.2 mc.c2vi.dev diff --git a/mods/nurPkgs/cbm.nix b/mods/nurPkgs/cbm.nix index c861174..815a48c 100644 --- a/mods/nurPkgs/cbm.nix +++ b/mods/nurPkgs/cbm.nix @@ -12,8 +12,8 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "resurrecting-open-source-projects"; repo = "cbm"; - rev = "master"; - sha256 = "sha256-Ubm8jky8nbJZWVSlqipg22ZjlnsgdVmoQWxYi9cyags="; + rev = "b6bc84bd9702d711466348a7af5c25d4c4f0bbf5"; + sha256 = "sha256-rL9ttGK4CIPFHXmNBgVq1QzLkMDGtgF+1eoCH1bwvG0="; }; nativeBuildInputs = [ diff --git a/mods/nurPkgs/minecraft-server-whitelist-all-players.nix b/mods/nurPkgs/minecraft-server-whitelist-all-players.nix new file mode 100644 index 0000000..b2c033d --- /dev/null +++ b/mods/nurPkgs/minecraft-server-whitelist-all-players.nix @@ -0,0 +1,27 @@ +{ lib +, python3Packages +}: + +python3Packages.buildPythonApplication { + pname = "minecraft-server-whitelist-all-players"; + version = "1.0"; + pyproject = false; + + propagatedBuildInputs = with python3Packages; [ requests ]; + + + dontUnpack = true; + src = ./.; + + meta = with lib; { + description = "A small python script to generate a whitelist.json from all players that ever joined the server."; + longDescription = '' + A small python script to generate a whitelist.json from the playerdata directory of a minecraft server. It adds all players that were ever on the server to this generated whitelist.json file. + You need to specify the playerdata directory containing all the players .dat files as the first argument to the script. + ''; + homepage = "https://github.com/c2vi/nixos/tree/master/mods/nurPkgs"; + license = licenses.gpl2Only; + #maintainers = [ ]; + platforms = platforms.all; + }; +} diff --git a/mods/nurPkgs/minecraft-server-whitelist-all-players.py b/mods/nurPkgs/minecraft-server-whitelist-all-players.py new file mode 100644 index 0000000..b9e28c1 --- /dev/null +++ b/mods/nurPkgs/minecraft-server-whitelist-all-players.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 + +import requests +import json +import argparse +import os + +whiteListJson = [] + +parser = argparse.ArgumentParser( + prog='whitelist-all-players', + description='A small python script, which reads all .dat files in the playerdataDir and generates a whitelist.json in that directory.', + epilog='') + +parser.add_argument('playerdataDir', default=os.getcwd(), nargs='?', help='the playerdataDir (in the folder of your minecraft server the path ./world/playerdata). This will be enumerated to get a list of player uuids. The default is the current workdin directory.') + +args = parser.parse_args() + +print("playerdataDir:", args.playerdataDir) +x = os.listdir(args.playerdataDir) + +for i in x: + if i.endswith(".dat"): + #creating a blank set + whiteListEntry = {"uuid":"", "name":""} + #creating UUID string without the .dat extension + usrUUID = i[:-4] + print("processing uuid:", usrUUID) + + #adding player UUID to entry + whiteListEntry["uuid"] = usrUUID + + #taking the dashes out of the UUID to work with the API + trimmedUUID = usrUUID.replace("-", "") + #getting API response + response = requests.get(f"https://api.minecraftservices.com/minecraft/profile/lookup/" + trimmedUUID).json() + + #adding player's current username to entry + try: + whiteListEntry["name"] = response["name"] + except: + print("uuid has no name...") + print(response) + continue + print("found name:", whiteListEntry["name"]) + + #adding entry to master JSON file + whiteListJson.append(whiteListEntry) + +#creating a whitelist.json file +f = open("whitelist.json", 'w') +#converting master json to pretty print and then writing it to the file +f.write(json.dumps(whiteListJson, indent = 2, sort_keys=True)) +#closing file +f.close() diff --git a/mods/nurPkgs/vcs-cli-utils.nix b/mods/nurPkgs/vcs-cli-utils.nix index c1af94e..3bae436 100644 --- a/mods/nurPkgs/vcs-cli-utils.nix +++ b/mods/nurPkgs/vcs-cli-utils.nix @@ -5,16 +5,16 @@ rustPlatform.buildRustPackage rec { pname = "vcs-cli-utils"; - version = "0.3.2"; + version = "1.0.4"; src = fetchFromGitHub { owner = "henkelmax"; repo = "svc-cli-utils"; - rev = "82e0af5b5e4cb0aa60bfeea4f9b1d3929fe4e1f8"; - sha256 = "sha256-ojuRqtUTNz/ZOuxx3ab1y9NknEfJNWPMXBf3kfIwfXM="; + rev = "${version}"; + sha256 = "sha256-vRqYQd5OaYXAc74Jlg8twBGDr9YxP+Mk1ZY9JGJTmvc="; }; - cargoHash = "sha256-VvA7xlj7zcuHDNi4+TRSDheCchjpiK519OgNTJj2hPI="; + cargoHash = "sha256-xz+pi6awwDeiISGqJs5DxqFdryc5mY8wMuds1ZXRr1Q="; meta = with lib; { description = "Command line utilities for the Simple Voice Chat Minecraft Mod"; diff --git a/mybin/ru b/mybin/ru index f84e4c6..b28cd9c 100755 --- a/mybin/ru +++ b/mybin/ru @@ -22,6 +22,46 @@ then du -d 1 -h $2 | sort -h -r + + +elif [ "$1" == "davinci-resolve-convert-videos" ] +then +FFMPEG_ACCEL_ARGS="-hwaccel vaapi -hwaccel_device /dev/dri/renderD128" +KEEP=true +PRORES=$2 +if [[ "$1" == "d" ]] +then + KEEP=false +fi + +if [ -d "$PWD/vid" ]; +then + cd vid + mkdir -p "$PWD/for-davinci" + + files=() + for x in *.mp4; do + files+=("${x%%/*}") + done + + for file in "${files[@]}" + do + echo "handling file: $file" + if [ -f "$PWD/for-davinci/${file%.*}$PRORES.mov" ] + then + rm "$PWD/for-davinci/${file%.*}$PRORES.mov" + fi + echo "PRORES: $PRORES" + [[ "$PRORES" != "-prores" ]] && ffmpeg $FFMPEG_ACCEL_ARGS -i "$PWD/$file" -c:v mpeg4 -c:a mp3 "${PWD}/for-davinci/${file%.*}.mov" + [[ "$PRORES" == "-prores" ]] && ffmpeg $FFMPEG_ACCEL_ARGS -i "$PWD/$file" -c:v prores_ks -c:a pcm_s16le "${PWD}/for-davinci/${file%.*}-prores.mov" + [[ "$KEEP" == "false" ]] && rm "$file" + done +fi + + + + + elif [ "$1" == "mnt-wechner" ] then rclone mount --vfs-cache-mode full -vvvv onedrive-school:projekt-autobatterie ~/work/htl/projekt/wechner/mnt diff --git a/programs/bash.nix b/programs/bash.nix index b5f3688..ea3603c 100644 --- a/programs/bash.nix +++ b/programs/bash.nix @@ -6,7 +6,7 @@ enableCompletion = true; historyFile = if hostname == "main" then "/home/$USER/work/app-data/${hostname}/bash-history" else "/home/$USER/host/bash-history"; - historyFileSize = 100000; + historyFileSize = 10000000; historyControl = [ "ignoredups" ]; historyIgnore = [ "ls" @@ -101,6 +101,8 @@ export nl="--log-format bar-with-logs" export acern="ssh://acern x86_64-linux,aarch64-linux - 20 10 big-parallel - -" + export mac="ssh://mac x86_64-linux,aarch64-linux - 8 5 big-parallel - -" + export mosatop="ssh://mosatop x86_64-linux,aarch64-linux - 8 5 big-parallel - -" export hpm="ssh://hpm x86_64-linux,aarch64-linux - 8 5 big-parallel - -" # my prompt @@ -133,6 +135,14 @@ then xfreerdp /u:"seb" /v:acern /p:$(cat ${secretsDir}/acern-rdp-password) /dynamic-resolution +clipboard +auto-reconnect /wm-class:"Microsoft Windows" + elif [[ "$host" == "mwin" ]] + then + xfreerdp /u:"me" /v:mac:4400 /p:$(cat /home/me/secrets/win-vm-pwd) /dynamic-resolution +clipboard +auto-reconnect +home-drive /wm-class:"Microsoft Windows"; + + elif [[ "$host" == "win" ]] + then + xfreerdp /u:"me" /v:192.168.122.141 /p:$(cat /home/me/secrets/win-vm-pwd) /dynamic-resolution +clipboard +auto-reconnect +home-drive /wm-class:"Microsoft Windows"; + fi } complete -W "mosatop acern" rp @@ -280,9 +290,9 @@ sd() { if [ "$1" == "" ] then - sudo $(history | tail -n 2 | head -n 1 | awk '{$1=""; print $0}') + sudo -E $(history | tail -n 2 | head -n 1 | awk '{$1=""; print $0}') else - sudo $@ + sudo -E $@ fi } @@ -356,7 +366,7 @@ complete -W "start stop restart status daemon-reload" stl # run - complete -W "mnt-wechner sync-school wstunnel hibernate p speed-test-nixos-iso speed-test-upload speed-test-download bat bstat mnt-files-local mnt-lan-local mnt-files-remote mnt-lan-remote suspend rm-tab-cur rm-last-char mnt-school mnt-host" ru + complete -W "mnt-wechner sync-school wstunnel hibernate p speed-test-nixos-iso speed-test-upload speed-test-download bat bstat mnt-files-local mnt-lan-local mnt-files-remote mnt-lan-remote suspend rm-tab-cur rm-last-char mnt-school mnt-host davinci-resolve-convert-videos" ru ''; diff --git a/programs/ssh.nix b/programs/ssh.nix index d639a8a..6700ddf 100644 --- a/programs/ssh.nix +++ b/programs/ssh.nix @@ -52,6 +52,10 @@ user = "me"; port = 2222; }; + mac = { + user = "me"; + port = 22; + }; mosatop = { user = "me"; port = 2222; @@ -74,6 +78,12 @@ user = "me"; }; + fusus = { + port = 49388; + hostname = "fusu"; + user = "server"; + }; + ocih = { hostname = "152.67.70.13"; user = "ubuntu"; diff --git a/random-pkgs.nix b/random-pkgs.nix index 92c1844..0cb80dc 100644 --- a/random-pkgs.nix +++ b/random-pkgs.nix @@ -1,8 +1,9 @@ { mypkgs, specialArgs, nixos-generators, - system, inputs, nixpkgs, self, + system, inputs, nixpkgs, self, nixpkgs-unstable, ... }: let pkgs = import nixpkgs { inherit system; }; + pkgsUnstable = import nixpkgs-unstable { inherit system; }; lib = pkgs.lib; in rec { @@ -40,6 +41,44 @@ in rec { }; + resolve = pkgs.davinci-resolve.overrideAttrs (prev: { + extraBwrapArgs = prev.extraBwrapArgs or [] ++ [ + "--bind /etc/OpenCL /etc/OpenCL" + ]; + }); + + tmp-resolve = pkgs.stdenv.mkDerivation { + name = "my-test-env"; + nativeBuildInputs = with pkgs; [ intel-compute-runtime-legacy1 pkg-config ]; + buildInputs = with pkgs; [ intel-compute-runtime-legacy1 ]; + }; + + sunshine = pkgsUnstable.sunshine.overrideAttrs (prev: { + patches = prev.patches or [] ++ [ + #(pkgs.fetchpatch { + #url = "https://github.com/LizardByte/Sunshine/pull/2507.patch"; + #hash = "sha256-DdyiR7djH4GF1bcQP/a20BYpTBvrAzd0UxJ0o0nC4rU="; + #}) + ]; + + buildInputs = prev.buildInputs or [] ++ [ + pkgsUnstable.pipewire + pkgsUnstable.xdg-desktop-portal + ]; + cmakeFlage = prev.cmakeFlags or [] ++ [ + (lib.cmakeBool "SUNSHINE_ENABLE_PORTAL" true) + ]; + + src = pkgs.fetchFromGitHub { + #owner = "LizardByte"; + owner = "c2vi"; + repo = "Sunshine"; + rev = "2671cd374dc5d12d402de572d170c9dfee8c5d7b"; + hash = "sha256-7IOMXmvl7/WYF6ktSUrLZjq+Lnq9YpSqUsj0FVtG8tI="; + fetchSubmodules = true; + }; + }); + ####################################################################### # make an iso #to build: nix build .#random.iso.config.system.build.isoImage diff --git a/users/common/home.nix b/users/common/home.nix index 3c59854..71d7526 100644 --- a/users/common/home.nix +++ b/users/common/home.nix @@ -52,7 +52,7 @@ zip unzip arp-scan - lolcat + #lolcat comma delta jq diff --git a/users/me/gui-home.nix b/users/me/gui-home.nix index e57afcf..99a1f47 100755 --- a/users/me/gui-home.nix +++ b/users/me/gui-home.nix @@ -18,10 +18,23 @@ name = "Yaru"; }; + gtk = { + enable = true; + + gtk3.extraConfig = { + # needed for Prusa Slicer for example + "gtk-application-prefer-dark-theme" = 1; + }; + + gtk4.extraConfig = { + "gtk-application-prefer-dark-theme" = 1; + }; + }; + dconf.settings = { "org/virt-manager/virt-manager/connections" = { - autoconnect = ["qemu:///system"]; - uris = ["qemu:///system"]; + autoconnect = [ "qemu:///system" "qemu+ssh://me@mac/system" ]; + uris = [ "qemu:///system" "qemu+ssh://me@mac/system" ]; }; }; @@ -37,6 +50,7 @@ ".cache/rofi-3.runcache".source = config.lib.file.mkOutOfStoreSymlink "${persistentDir}/rofi-run-cache"; ".local/share/PrismLauncher/".source = config.lib.file.mkOutOfStoreSymlink "${workDir}/app-data/prism-launcher"; + ".local/share/DaVinciResolve/".source = config.lib.file.mkOutOfStoreSymlink "${workDir}/app-data/DaVinciResolve"; }; @@ -163,6 +177,10 @@ print(line, end="") exit() + if sys.argv[1] == "v": + os.system("sudo vim /etc/hosts") + exit() + net = sys.argv[1] diff --git a/users/server/headless.nix b/users/server/headless.nix index 75e97c9..ca2faf4 100644 --- a/users/server/headless.nix +++ b/users/server/headless.nix @@ -13,12 +13,23 @@ hostname = config.networking.hostName; }; - home-manager.users.server = import ../common/home.nix; + home-manager.users.server = { + services.vscode-server.enable = true; + imports = [ + "${inputs.vscode-server}/modules/vscode-server/home.nix" + ../common/home.nix + ]; + }; users.users.server.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPAgNB1nsKZ5KXnmR6KWjQLfwhFKDispw24o8M7g/nbR me@bitwarden" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII/mCDzCBE2J1jGnEhhtttIRMKkXMi1pKCAEkxu+FAim me@main" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGw5kYmBQl8oolNg2VUlptvvSrFSESfeuWpsXRovny0x me@phone" + + + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDU8OZxpeEuwVYFQC1ZYOECfU8fVg0BhNIYk5tK6aNeUe4JBJezwBWIQLsxuo1YgUX1CwbP5IAAj0JyoYUzWT5H4Qyev6rj3JWvBl+kVTnJyiipRccasXD/3IuRK2GBpMcK67sUoHtgiq1kS8myuAtGh2dVeukCp196pCZC9VI0NiEmk2M6/pCiuKmaeaeyKEpkzd2wcdvqyXu3OKtq/qZyw+N8eLk8hC8wQK5lq/Syg8aZh7OV2jqe7CnRLnybybrVy3wRNI4DdoP51YEv+Q3eMlOpOdc7SGTyDPUMnTDNbBFL8u7o7xeLs/+v3neWOz/+rNkQbAoqEvN741lCozTcAxSTT8gnTOdrf+ClMFRpFMUkl3Z6JNymw0Zx2JFibhxQJWIKJq6Wh1YuDJXenIZka0sN5ut5W0KJMmCfzeyAXHy3qruYktbmUFz8iUm1ywbURZZNCmRlzESL2lE7iuTM06SxSYw4YxQHYIC4P6leMyN3hfrr4RUPtO8wJ1lALUs= kilix@epimetheus" + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDrQUmZtpxDx669VjACdtLSLcIFZ5uJl4xsj49yJW6A39IglJ4S9ViPtp/kQhGZ3jJMCCFzwDLNNJBf8XfcAtio57cucUQxtRMnY57pKH284eucCanpCq8z9KgBYtrIdzYwRVQZo2tjxdAwKS5mHSOstUnqH8CzcG0kbq7k3s31MKQhzKWXx7lZEn3osQx/aIpt0eWB/SNAS4DWhx+mdGSqO2ryBqbZKaJuH90MEWyd5MKu25+h0ELbHrkkPYOwq0EnpGqvr0mps8AjEV4iExb28E+GGtS+R7yg2tw0QWM1m4PI4XF5JRAuLqt187YvgQe9DIKTuhu2BT/EN2Os7jx9r14Pq2P/IhrR0hVloSTn2/r3geUuFYNvYiL64dkZIRxBOlC3SKut/lB3cir0FPdDkxoIuRHICrsvdSC5wFfYJfhrf0ivkEk5Jgj+lS1QlC40Xw7e0ixKILo6uiriQor02bFY4ngQHTnBLKgjNsB3K23MN80vd8V6DVZdFB+XWr8= kilia@nomos" + ];