diff --git a/flake.lock b/flake.lock index 4e2fcff..492913e 100644 --- a/flake.lock +++ b/flake.lock @@ -80,6 +80,25 @@ "type": "github" } }, + "copyparty": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1758061721, + "narHash": "sha256-+agPUV+fOJSpqjVOEM0xC8+xhBFbnQesyy+8ErwGpks=", + "owner": "9001", + "repo": "copyparty", + "rev": "5996a58b20fa015bd404dfdb2cef8892909b3d69", + "type": "github" + }, + "original": { + "owner": "9001", + "repo": "copyparty", + "type": "github" + } + }, "darwin": { "inputs": { "nixpkgs": [ @@ -249,6 +268,40 @@ } }, "flake-utils": { + "locked": { + "lastModified": 1678901627, + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils-plus": { + "inputs": { + "flake-utils": "flake-utils_2" + }, + "locked": { + "lastModified": 1715533576, + "narHash": "sha256-fT4ppWeCJ0uR300EH3i7kmgRZnAVxrH+XtK09jQWihk=", + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f", + "type": "github" + }, + "original": { + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f", + "type": "github" + } + }, + "flake-utils_2": { "inputs": { "systems": "systems_5" }, @@ -266,25 +319,6 @@ "type": "github" } }, - "flake-utils-plus": { - "inputs": { - "flake-utils": "flake-utils" - }, - "locked": { - "lastModified": 1715533576, - "narHash": "sha256-fT4ppWeCJ0uR300EH3i7kmgRZnAVxrH+XtK09jQWihk=", - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", - "rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f", - "type": "github" - }, - "original": { - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", - "rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f", - "type": "github" - } - }, "gitignore": { "inputs": { "nixpkgs": [ @@ -463,7 +497,7 @@ "hyprlang": "hyprlang_2", "hyprutils": "hyprutils_2", "hyprwayland-scanner": "hyprwayland-scanner_2", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "pre-commit-hooks": "pre-commit-hooks_2", "systems": "systems_3", "xdph": "xdph" @@ -758,6 +792,24 @@ "type": "github" } }, + "musnix": { + "inputs": { + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1756852730, + "narHash": "sha256-qPere4RBHoZxiEGl8zXU8gjroZg4gkYGEwaAbKmL4vE=", + "owner": "musnix", + "repo": "musnix", + "rev": "7ccc92050e43dc92309396c6f2fe1f542214a242", + "type": "github" + }, + "original": { + "owner": "musnix", + "repo": "musnix", + "type": "github" + } + }, "nix-filter": { "locked": { "lastModified": 1693833173, @@ -774,6 +826,21 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1748162331, + "narHash": "sha256-rqc2RKYTxP3tbjA+PB3VMRQNnjesrT0pEofXQTrMsS8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7c43f080a7f28b2774f3b3f43234ca11661bf334", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-25.05", + "type": "indirect" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1754725699, "narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=", @@ -789,7 +856,23 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_3": { + "locked": { + "lastModified": 1756542300, + "narHash": "sha256-tlOn88coG5fzdyqz6R93SQL5Gpq+m/DsWpekNFhqPQk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d7600c775f877cd87b4f5a831c28aa94137377aa", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { "locked": { "lastModified": 1755186698, "narHash": "sha256-wNO3+Ks2jZJ4nTHMuks+cxAiVBGNuEBXsT29Bz6HASo=", @@ -855,13 +938,15 @@ "inputs": { "agenix": "agenix", "agenix-rekey": "agenix-rekey", + "copyparty": "copyparty", "darwin": "darwin_2", "disko": "disko", "docker-compose-1": "docker-compose-1", "home-manager": "home-manager_2", "hypridle": "hypridle", "hyprland": "hyprland", - "nixpkgs": "nixpkgs_2", + "musnix": "musnix", + "nixpkgs": "nixpkgs_4", "rose-pine-hyprcursor": "rose-pine-hyprcursor", "snowfall": "snowfall", "split-monitor-workspaces": "split-monitor-workspaces" diff --git a/flake.nix b/flake.nix index 3697e5e..95f5d73 100644 --- a/flake.nix +++ b/flake.nix @@ -14,8 +14,10 @@ # Global system modules to be included for all systems systems.modules = with inputs; { nixos = [ + disko.nixosModules.default agenix.nixosModules.default agenix-rekey.nixosModules.default + copyparty.nixosModules.default ./modules/common ]; darwin = [ @@ -28,10 +30,11 @@ # Add modules only to specific hosts systems.hosts = with inputs; { cobalt.modules = [ - disko.nixosModules.default + copyparty.nixosModules.default + musnix.nixosModules.default ]; - mercury.modules = [ - disko.nixosModules.default + beryllium.modules = [ + copyparty.nixosModules.default ]; }; @@ -42,6 +45,10 @@ permittedInsecurePackages = []; }; + overlays = with inputs; [ + copyparty.overlays.default + ]; + outputs-builder = channels: { formatter = channels.nixpkgs.alejandra; }; @@ -83,6 +90,8 @@ agenix-rekey.url = "github:oddlama/agenix-rekey"; agenix-rekey.inputs.nixpkgs.follows = "nixpkgs"; + copyparty.url = "github:9001/copyparty"; + hyprland.url = "github:hyprwm/hyprland"; hypridle = { @@ -101,6 +110,8 @@ inputs.hyprland.follows = "hyprland"; }; + musnix.url = "github:musnix/musnix"; + docker-compose-1.url = github:nixos/nixpkgs/b0f0b5c6c021ebafbd322899aa9a54b87d75a313; }; } diff --git a/homes/x86_64-linux/christopher@cobalt/default.nix b/homes/x86_64-linux/christopher@cobalt/default.nix index f20f93f..18c5659 100644 --- a/homes/x86_64-linux/christopher@cobalt/default.nix +++ b/homes/x86_64-linux/christopher@cobalt/default.nix @@ -21,6 +21,7 @@ key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHl33DPxxzxrNNjM8rL4ktAj4ExzCyGiU8rKog0csxNA"; needs = { + copypartyPassword = "copyparty-password.age"; repoUpdatePAT = "repo-update-pat.age"; npmrc = { rekeyFile = "npmrc.age"; diff --git a/homes/x86_64-linux/christopher@cobalt/misc/everything.nix b/homes/x86_64-linux/christopher@cobalt/misc/everything.nix index 6e52539..788eca0 100644 --- a/homes/x86_64-linux/christopher@cobalt/misc/everything.nix +++ b/homes/x86_64-linux/christopher@cobalt/misc/everything.nix @@ -15,9 +15,12 @@ solaar # Logitech mouse driver btop # Better resource monitor bottom # System resource monitor + copyparty # GUI vcv-rack # Audio synthesizer/eurorack simulator + ardour # General DAW + reaper # Narrating DAW vlc # Video player todoist-electron # Todo application logseq # Knowledge Base @@ -38,7 +41,7 @@ # spacedrive # File explorer (Alpha, not usable yet) thunderbird # Email client speedcrunch # GUI calculator app - shotcut # Video editing + davinci-resolve # Video editing naps2 # Scanning feh # Image viewer diff --git a/homes/x86_64-linux/christopher@cobalt/misc/gaming.nix b/homes/x86_64-linux/christopher@cobalt/misc/gaming.nix index eb11f1e..b8065a6 100644 --- a/homes/x86_64-linux/christopher@cobalt/misc/gaming.nix +++ b/homes/x86_64-linux/christopher@cobalt/misc/gaming.nix @@ -13,11 +13,8 @@ ]; }) - # wine - #(wineWowPackages.stable.override {waylandSupport = true;}) - #winetricks - gamemode # performance mode mangohud # performance overlays + alvr ]; } diff --git a/homes/x86_64-linux/christopher@cobalt/misc/launcher.nix b/homes/x86_64-linux/christopher@cobalt/misc/launcher.nix index 0f219da..62472bb 100644 --- a/homes/x86_64-linux/christopher@cobalt/misc/launcher.nix +++ b/homes/x86_64-linux/christopher@cobalt/misc/launcher.nix @@ -3,7 +3,10 @@ lib, ... }: { - home.packages = with pkgs; [tofi]; + home.packages = with pkgs; [ + tofi + fuzzel + ]; # Clear the tofi cache after each activation so that newly installed packages # are immediately available using tofi-drun. diff --git a/modules/nixos/services/beszel.nix b/modules/nixos/services/beszel.nix new file mode 100644 index 0000000..b5d8b3a --- /dev/null +++ b/modules/nixos/services/beszel.nix @@ -0,0 +1,36 @@ +{ + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.services.beszel-agent; +in { + options.services = { + beszel-agent = { + enable = mkEnableOption "Enable the Beszel Agent"; + }; + }; + + config = mkIf cfg.enable { + environment.systemPackages = [ + pkgs.beszel + pkgs.rocmPackages.rocm-smi # Interface with AMD GPUs + ]; + + systemd.services.beszel-agent = { + enable = true; + description = "Beszel Agent (remote monitoring)"; + + environment = { + KEY = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMkUPOw28Cu2LMuzfmvjT/L2ToNHcADwGyGvSpJ4wH2T"; + LISTEN = "45876"; + }; + + serviceConfig = { + ExecStart = "${pkgs.beszel}/bin/beszel-agent"; + }; + }; + }; +} diff --git a/modules/nixos/services/default.nix b/modules/nixos/services/default.nix index bf74e67..fc7421c 100644 --- a/modules/nixos/services/default.nix +++ b/modules/nixos/services/default.nix @@ -1,5 +1,6 @@ {...}: { imports = [ ./lnxlink.nix + ./beszel.nix ]; } diff --git a/modules/nixos/wm/default.nix b/modules/nixos/wm/default.nix new file mode 100644 index 0000000..02451eb --- /dev/null +++ b/modules/nixos/wm/default.nix @@ -0,0 +1,69 @@ +{ + pkgs, + config, + lib, + inputs, + ... +}: +with lib; let + cfg = config.elements.wm; + tuigreet = "${pkgs.tuigreet}/bin/tuigreet"; + hyprland-pkg = inputs.hyprland.packages.${pkgs.system}.hyprland; + hyprland-portal-pkg = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; + hyprland-session = "${hyprland-pkg}/share/wayland-sessions"; +in { + options.elements = { + wm = { + enable = mkEnableOption "Enable window manager configuration"; + }; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + swaynotificationcenter + inputs.rose-pine-hyprcursor.packages.${pkgs.system}.default + xwayland-satellite + hyprshot + ]; + + programs.hyprland = { + enable = true; + package = hyprland-pkg; + portalPackage = hyprland-portal-pkg; + }; + + security = { + polkit.enable = true; + pam.services.swaylock = {}; + }; + + xdg.portal = { + config.common.default = ["hyprland"]; + config.hyprland.default = ["wlr" "gtk"]; + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + ]; + wlr.enable = true; + }; + + services.greetd = { + enable = true; + settings = { + default_session = { + command = "${tuigreet} --asterisks --time --remember --remember-session --sessions ${hyprland-session}"; + user = "greeter"; + }; + }; + }; + + systemd.services.greetd.serviceConfig = { + Type = "idle"; + StandardInput = "tty"; + StandardOutput = "tty"; + StandardError = "journal"; + TTYReset = true; + TTYVHangup = true; + TTYVTDisallocate = true; + }; + }; +} diff --git a/secrets/copyparty-password.age b/secrets/copyparty-password.age new file mode 100644 index 0000000..e8e94a6 Binary files /dev/null and b/secrets/copyparty-password.age differ diff --git a/secrets/rekeyed/christopher_cobalt/8b7841e1fb795a01f358cb86b43dfc3b-copypartyPassword.age b/secrets/rekeyed/christopher_cobalt/8b7841e1fb795a01f358cb86b43dfc3b-copypartyPassword.age new file mode 100644 index 0000000..06bf4cd --- /dev/null +++ b/secrets/rekeyed/christopher_cobalt/8b7841e1fb795a01f358cb86b43dfc3b-copypartyPassword.age @@ -0,0 +1,8 @@ +age-encryption.org/v1 +-> ssh-ed25519 Sih9FA 0KicXG2Efz0e9uzmZVEVfJT/i7enxSZOHN403NX/TQI +SMTWuslXUrZ4uTAAoBJPW2qI/uyUpirNs+qutENWpEY +-> u1J0d-grease 3Yf,I\u njKv!al +7tlxC1cHMMzeCC9BuAmRXuC19dLT2Oa416bN5ZEU9y7bKKwxdlHDCQA40E8yuSRk +asdGgYzSxPIqTwIsTQ +--- S+Dtx+pCwnQtyh1lSa7CA1wy0Ye4Yy8rqg5RXXFAVPc +$zM2\z:N@:,3zyf  U7x \ No newline at end of file diff --git a/secrets/rekeyed/cobalt/afecc51553c369aac56ed88fd0c798ef-copypartyPassword.age b/secrets/rekeyed/cobalt/afecc51553c369aac56ed88fd0c798ef-copypartyPassword.age new file mode 100644 index 0000000..caf6f4d --- /dev/null +++ b/secrets/rekeyed/cobalt/afecc51553c369aac56ed88fd0c798ef-copypartyPassword.age @@ -0,0 +1,7 @@ +age-encryption.org/v1 +-> ssh-ed25519 /u/eYA xmiJ76GC9OgIuJcMRzPK1Mwo1DdRsAc1LPXbpshXag8 +5WmXKC4YQhc9qqmQVs26GXXlpmxh7rYvww3L0FPLmPQ +-> ]KoF}\i-grease _q#e +JnCuJ2FjXe3WtG0VmvNj3ww+sa7i +--- YdgtSb+pPQgjgdtY7XLBHGcbWPLDXd0ph7s6Pq3Sn7M +XSPfѧٕjMV\mTpY4sR0 \ No newline at end of file diff --git a/systems/x86_64-linux/cobalt/beszel-agent.nix b/systems/x86_64-linux/cobalt/beszel-agent.nix deleted file mode 100644 index a86d2b8..0000000 --- a/systems/x86_64-linux/cobalt/beszel-agent.nix +++ /dev/null @@ -1,20 +0,0 @@ -{pkgs, ...}: { - environment.systemPackages = [ - pkgs.beszel - pkgs.rocmPackages.rocm-smi # Interface with AMD GPUs - ]; - - systemd.services.beszel-agent = { - enable = true; - description = "Beszel Agent (remote monitoring)"; - - environment = { - KEY = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMkUPOw28Cu2LMuzfmvjT/L2ToNHcADwGyGvSpJ4wH2T"; - LISTEN = "45876"; - }; - - serviceConfig = { - ExecStart = "${pkgs.beszel}/bin/beszel-agent"; - }; - }; -} diff --git a/systems/x86_64-linux/cobalt/default.nix b/systems/x86_64-linux/cobalt/default.nix index 32beb09..e4810b0 100644 --- a/systems/x86_64-linux/cobalt/default.nix +++ b/systems/x86_64-linux/cobalt/default.nix @@ -4,30 +4,42 @@ { pkgs, lib, + config, ... }: with lib._elements; { imports = [ ./hardware.nix ./disk-config.nix - ./beszel-agent.nix - - ./wayland.nix ]; elements = { hostname = "cobalt"; users = ["christopher"]; quirks = ["avahi" "docker" "nix-ld"]; + wm = enabled; secrets = { key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPjqieS4GkYAa1WRYZpxjgYsj7VGZ9U+rTFCkX8M0umD"; + + needs = { + copypartyPassword = rec { + owner = "christopher"; + group = owner; + rekeyFile = "copyparty-password.age"; + }; + }; }; }; # Set the default drive disko.devices.disk.main.device = "/dev/nvme1n1"; + musnix = { + enable = true; + rtcqs.enable = true; + }; + qt = { enable = true; platformTheme = "gnome"; @@ -50,12 +62,7 @@ with lib._elements; { xdg.portal = { enable = true; - config.common.default = ["hyprland"]; - config.hyprland.default = ["wlr" "gtk"]; - extraPortals = [ - pkgs.xdg-desktop-portal-gtk - ]; - wlr.enable = true; + xdgOpenUsePortal = true; }; programs = { @@ -84,19 +91,31 @@ with lib._elements; { }; services = { + openssh.enable = true; + openssh.settings.PasswordAuthentication = false; + # Bluetooth manager blueman.enable = true; # Linux link via MQTT lnxlink.enable = true; + beszel-agent.enable = true; - pulseaudio.enable = true; - pulseaudio.support32Bit = true; - pipewire.enable = lib.mkForce false; + pipewire = { + enable = lib.mkForce true; + alsa.enable = true; + jack.enable = true; + pulse.enable = true; + }; # Automatic mounting of removable media udisks2.enable = true; + usbmuxd = { + enable = true; + package = pkgs.usbmuxd2; + }; + gvfs.enable = true; # Mount/trash/... tumbler.enable = true; # Thumbnail support in Thunar @@ -116,6 +135,38 @@ with lib._elements; { # Smartcard support, necessary for Yubikey logins pcscd.enable = true; + + copyparty = { + enable = false; + user = "christopher"; + + settings = { + i = "0.0.0.0"; + }; + + accounts.c.passwordFile = config.age.secrets.copypartyPassword.path; + + volumes = { + "/" = { + path = "/home/christopher"; + access.rwmdga = "c"; + flags = { + fk = 4; + scan = 60; + e2d = true; + }; + }; + "/hdd" = { + path = "/mnt/hdd"; + access.rwmdga = "c"; + flags = { + fk = 4; + scan = 60; + e2d = true; + }; + }; + }; + }; }; programs = { @@ -141,8 +192,11 @@ with lib._elements; { htop gnumake libnotify + gtk3 lact # GPU tuning + libimobiledevice + ifuse # Oxidized coreutils uutils-coreutils-noprefix diff --git a/systems/x86_64-linux/cobalt/wayland.nix b/systems/x86_64-linux/cobalt/wayland.nix deleted file mode 100644 index 72a24e8..0000000 --- a/systems/x86_64-linux/cobalt/wayland.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - pkgs, - inputs, - ... -}: let - tuigreet = "${pkgs.tuigreet}/bin/tuigreet"; - hyprland-pkg = inputs.hyprland.packages.${pkgs.system}.hyprland; - hyprland-portal-pkg = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; - hyprland-session = "${hyprland-pkg}/share/wayland-sessions"; -in { - environment.systemPackages = with pkgs; [ - swaynotificationcenter # Notification daemon for Wayland - inputs.rose-pine-hyprcursor.packages.${pkgs.system}.default - hyprshot - ]; - - programs.hyprland = { - enable = true; - package = hyprland-pkg; - portalPackage = hyprland-portal-pkg; - }; - - services.greetd = { - enable = true; - settings = rec { - default_session = { - command = "${tuigreet} --asterisks --time --remember --remember-session --sessions ${hyprland-session}"; - user = "greeter"; - }; - }; - }; - - systemd.services.greetd.serviceConfig = { - Type = "idle"; - StandardInput = "tty"; - StandardOutput = "tty"; - StandardError = "journal"; - TTYReset = true; - TTYVHangup = true; - TTYVTDisallocate = true; - }; -}