summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rwxr-xr-xflake.nix344
1 files changed, 296 insertions, 48 deletions
diff --git a/flake.nix b/flake.nix

index 7d6284c..dec5b12 100755 --- a/flake.nix +++ b/flake.nix
@@ -2,27 +2,38 @@ description = "Rory&'s services flake"; nixConfig = { - extra-substituters = [ "https://attic.computer.surgery/grapevine" ]; - extra-trusted-public-keys = [ "grapevine:nYiZ0Qz9nT7Y7kNC/2NdoS3+J9gwTyWxOvlwZnFgceA=" ]; + extra-substituters = [ + # private + "http://nix-bincache.rory-desktop.local" + # public + "https://attic.computer.surgery/grapevine" + "https://hyprland.cachix.org" + "https://nix-bincache.rory.gay" + ]; + extra-trusted-public-keys = [ + "nix-bincache.rory-desktop.local:LDcVGNQoaprWeggWcRE1N0jjEqdjOR1D0kOI3fZne24=" + "grapevine:nYiZ0Qz9nT7Y7kNC/2NdoS3+J9gwTyWxOvlwZnFgceA=" + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "nix-bincache.rory.gay:663PIW8xxgIImxLcsokODWI2PHFWXvzJEfjX6TaIjxQ=" + ]; }; inputs = { # Different nixpkgs versions - nixpkgs = { - url = "github:NixOS/nixpkgs/nixos-unstable"; - }; - - nixpkgs-master = { - url = "github:NixOS/nixpkgs/master"; - }; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.05"; + nixpkgs-master.url = "github:NixOS/nixpkgs/master"; nixpkgs-RoryNix = { #url = "github:NixOS/nixpkgs/nixos-23.05"; - url = "github:NixOS/nixpkgs/nixos-23.11"; + url = "github:NixOS/nixpkgs/master"; }; # Draupnir module/package - nixpkgs-Draupnir.url = "github:TheArcaneBrony/nixpkgs/master"; + #nixpkgs-override-synapse.url = "github:teutat3s/nixpkgs/matrix-synapse-1.136.0"; + nixpkgs-override-draupnir.url = "github:NixOS/nixpkgs/master"; +# nixpkgs-override-draupnir.url = "github:r-ryantm/nixpkgs/auto-update/draupnir"; +# nixpkgs-override-jetbrains.url = "github:TheArcaneBrony/nixpkgs/jetbrains-2025-4"; # Base modules home-manager.url = "github:nix-community/home-manager/master"; @@ -30,26 +41,75 @@ flake-utils.url = "github:numtide/flake-utils"; # Packages - grapevine.url = "gitlab:matrix/grapevine-fork?host=gitlab.computer.surgery"; # &ref=benjamin/debug-emma-kde-room"; + grapevine.url = "gitlab:matrix/grapevine-fork?host=gitlab.computer.surgery"; conduit.url = "gitlab:famedly/conduit/next"; - #conduwuit.url = "github:girlbossceo/conduwuit"; - nixos-wsl.url = "github:nix-community/NixOS-WSL"; + drasl = { + url = "github:unmojang/drasl"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # - AUR imports + # aur-visual-paradigm = { + # url = "git+https://aur.archlinux.org/visual-paradigm.git"; + # flake = false; + # }; - # Own projects + lix = { + url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz"; + flake = false; + }; + + lix-module = { + url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.lix.follows = "lix"; + }; + + # Own projects/custom modules botcore-v4 = { url = "gitlab:BotCore-Devs/BotCore-v4/staging"; - inputs.nixpkgs.follows = "nixpkgs"; # We need this to avoid a LIBC error. + }; + + ooye = { + url = "git+https://cgit.rory.gay/nix/OOYE-module.git"; + }; + + cgit-magenta = { + url = "git+https://cgit.rory.gay/cgit-magenta.git"; + inputs.nixpkgs.follows = "nixpkgs"; }; # Packages built from git + synapseHttpAntispamSrc = { + url = "github:TheArcaneBrony/synapse-http-antispam"; + flake = false; + }; + nhekoSrc = { url = "github:Nheko-reborn/nheko/master"; flake = false; }; + mtxclientSrc = { url = "github:Nheko-reborn/mtxclient/master"; flake = false; }; + + draupnirSrc = { + url = "github:the-draupnir-project/Draupnir/main"; + flake = false; + }; + + matrixSpecSrc = { + url = "github:matrix-org/matrix-spec/main"; + flake = false; + }; + + hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1&ref=refs/tags/v0.50.1"; + hy3 = { + url = "github:outfoxxed/hy3?ref=hl0.50.0"; + inputs.hyprland.follows = "hyprland"; + }; + }; outputs = @@ -57,33 +117,44 @@ with inputs; { nixosConfigurations = { - #NIXPKGS FORK - Rory-nginx = nixpkgs.lib.nixosSystem { + Module-dev = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - ./host/Rory-nginx/configuration.nix + ./host/Module-dev/configuration.nix + home-manager.nixosModules.home-manager + lix-module.nixosModules.default + ]; + }; + Rory-ovh = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./host/Rory-ovh/configuration.nix ./hardware-configuration.nix + + ./host/Rory-nginx/services/matrix/synapse/workers/module.nix + home-manager.nixosModules.home-manager + lix-module.nixosModules.default grapevine.nixosModules.default - - # these arent really modules... - botcore-v4.modules.bots - botcore-v4.modules.frontend - botcore-v4.modules.dataupdater - botcore-v4.modules.users + drasl.nixosModules.drasl + ooye.modules.default ( - { pkgs, ... }: + { pkgs, lib, ... }: { disabledModules = [ "services/matrix/synapse.nix" ]; imports = [ "${nixpkgs-master}/nixos/modules/services/matrix/synapse.nix" - "${nixpkgs-Draupnir}/nixos/modules/services/matrix/draupnir.nix" + #"${nixpkgs-Draupnir}/nixos/modules/services/matrix/draupnir.nix" ]; nixpkgs.overlays = [ (final: prev: { - matrix-synapse-unwrapped = inputs.nixpkgs-master.legacyPackages.${pkgs.stdenv.hostPlatform.system}.matrix-synapse-unwrapped; - draupnir = inputs.nixpkgs-Draupnir.legacyPackages.${pkgs.stdenv.hostPlatform.system}.draupnir; + matrix-synapse-unwrapped = self.packages.${pkgs.stdenv.hostPlatform.system}.matrix-synapse-unwrapped-patched; + #draupnir = inputs.nixpkgs-DraupnirPkg.legacyPackages.${pkgs.stdenv.hostPlatform.system}.draupnir; + matrix-synapse-plugins.synapse-http-antispam = prev.matrix-synapse-plugins.synapse-http-antispam.overrideAttrs (oldAttrs: { + src = inputs.synapseHttpAntispamSrc; + version = inputs.synapseHttpAntispamSrc.rev; + }); }) ]; } @@ -94,8 +165,38 @@ inherit home-manager; inherit grapevine; inherit conduit; - inherit nixpkgs-Draupnir; - #inherit conduwuit; + #inherit nixpkgs-Draupnir; + #inherit nixpkgs-DraupnirPkg; + inherit cgit-magenta; + + inherit (inputs) draupnirSrc; + inherit (inputs) nixpkgs-master; + matrix-synapse-unwrapped-patched = self.packages.x86_64-linux.matrix-synapse-unwrapped-patched; + draupnir = self.packages.x86_64-linux.draupnir; + }; + }; + + Rory-nginx = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./host/Rory-nginx/configuration.nix + ./hardware-configuration.nix + ./packages/redpanda-connect/module.nix + home-manager.nixosModules.home-manager + lix-module.nixosModules.default + grapevine.nixosModules.default + + # these arent really modules... + botcore-v4.modules.bots + botcore-v4.modules.frontend + botcore-v4.modules.dataupdater + botcore-v4.modules.users + ]; + specialArgs = { + inherit botcore-v4; + inherit home-manager; + inherit grapevine; + inherit conduit; }; }; @@ -112,13 +213,90 @@ # }; #}; - Rory-desktop = nixpkgs.lib.nixosSystem { + Rory-desktop = nixpkgs-master.lib.nixosSystem { system = "x86_64-linux"; modules = [ ./host/Rory-desktop/configuration.nix ./hardware-configuration.nix + # ./packages/overlays/jetbrains-plugins.nix + home-manager.nixosModules.home-manager + lix-module.nixosModules.default + sops-nix.nixosModules.sops + ( + { ... }: + { + nix = { + registry.nixpkgs.flake = nixpkgs-master; + nixPath = [ "nixpkgs=${nixpkgs-master.outPath}" ]; + }; + } + ) + ( + { pkgs, lib, ... }: + { + nixpkgs.overlays = [ + (final: prev: { + jetbrains = self.packages.${pkgs.stdenv.hostPlatform.system}.jetbrains; + v4l2loopback = (pkgs.callPackage "${inputs.nixpkgs-master}/pkgs/os-specific/linux/v4l2loopback/default.nix" { }); + # jetbrains = (prev.jetbrains // { + # plugins = (prev.jetbrains.plugins // { + # addPlugins = (pkgs.callPackage "${inputs.nixpkgs-JetbrainsPlugins}/pkgs/applications/editors/jetbrains/plugins/default.nix" { }).addPlugins; + # }); + # }); +# rabbitmq-server = (pkgs.callPackage "${inputs.nixpkgs-stable}/pkgs/by-name/ra/rabbitmq-server/package.nix" { }); + }) + ]; + } + ) + ]; + specialArgs = { + inherit home-manager; + inherit (inputs) mtxclientSrc; + inherit (inputs) nhekoSrc; + inherit hyprland; + inherit hy3; + }; + }; + Rory-laptop = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./host/Rory-laptop/configuration.nix + ./hardware-configuration.nix + ./packages/overlays/jetbrains-plugins.nix home-manager.nixosModules.home-manager + lix-module.nixosModules.default sops-nix.nixosModules.sops + + #temporary: + ./packages/overlays/lldb.nix + + ( + { ... }: + { + nix = { + registry.nixpkgs.flake = nixpkgs; + nixPath = [ "nixpkgs=${nixpkgs.outPath}" ]; + }; + } + ) + ]; + specialArgs = { + inherit home-manager; + inherit (inputs) matrixSpecSrc; + inherit (inputs) mtxclientSrc; + inherit (inputs) nhekoSrc; + inherit hyprland; + inherit hy3; + }; + }; + + Arc = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./host/Arc/configuration.nix + ./hardware-configuration.nix + home-manager.nixosModules.home-manager + lix-module.nixosModules.default ( { ... }: { @@ -131,8 +309,12 @@ ]; specialArgs = { inherit home-manager; + inherit nixpkgs-stable; + inherit (inputs) mtxclientSrc; inherit (inputs) nhekoSrc; + inherit hyprland; + inherit hy3; }; }; @@ -151,12 +333,29 @@ }; } ) - # ... add this line to the rest of your configuration modules - #nix-ld.nixosModules.nix-ld + ]; + specialArgs = { + inherit home-manager; + inherit (inputs) mtxclientSrc; + inherit (inputs) nhekoSrc; + }; + }; - # The module in this repository defines a new module under (programs.nix-ld.dev) instead of (programs.nix-ld) - # to not collide with the nixpkgs version. - #{ programs.nix-ld.dev.enable = true; } + Rory-NTFS = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./host/Rory-NTFS/configuration.nix + ./hardware-configuration.nix + home-manager.nixosModules.home-manager + ( + { ... }: + { + nix = { + registry.nixpkgs.flake = nixpkgs; + nixPath = [ "nixpkgs=${nixpkgs.outPath}" ]; + }; + } + ) ]; specialArgs = { inherit home-manager; @@ -174,44 +373,93 @@ ( { ... }: { + nixpkgs.hostPlatform = "i686-linux"; + nixpkgs.buildPlatform = "x86_64-linux"; nix.registry.nixpkgs.flake = nixpkgs-RoryNix; } ) ]; }; - #WSL - Rory-wsl = nixpkgs.lib.nixosSystem { + # ISO images + uISO = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - nixos-wsl.nixosModules.default - ./host/Rory-wsl/configuration.nix - # ./hardware-configuration.nix - home-manager.nixosModules.home-manager - #nur.nixosModules.nur + ./host/uISO/iso-root.nix + ./host/uISO/development.nix ]; specialArgs = { - inherit (inputs) mtxclientSrc; - inherit (inputs) nhekoSrc; + # inherit spacebarchat-server-master; }; }; }; + + modules = { + monitoring = import ./modules/monitoring/module.nix; + redpanda-connect = import ./packages/redpanda-connect/module.nix; + }; } // flake-utils.lib.eachSystem flake-utils.lib.allSystems ( system: let pkgs = import nixpkgs { inherit system; }; + pkgs-jetbrains = + if inputs ? nixpkgs-override-jetbrains + then import nixpkgs-override-jetbrains { inherit system; config.allowUnfree = true; } + else import nixpkgs { inherit system; config.allowUnfree = true; }; in { packages.nheko-git = ( - pkgs.callPackage ./modules/packages/nheko-git.nix { + pkgs.callPackage ./packages/nheko-git.nix { inherit nhekoSrc; inherit mtxclientSrc; voipSupport = false; } ); - packages.mtxclient-git = (pkgs.callPackage ./modules/packages/mtxclient-git.nix { inherit mtxclientSrc; }); + packages.mtxclient-git = (pkgs.callPackage ./packages/mtxclient-git.nix { inherit mtxclientSrc; }); + packages.matrix-spec-git = (pkgs.callPackage ./packages/matrix-spec.nix { inherit matrixSpecSrc; }); + packages.nbtexplorer = pkgs.callPackage ./packages/nbtexplorer.nix { }; + + # untested + #packages.draupnir-main = pkgs.draupnir.overrideAttrs (oldAttrs: { + # src = draupnirSrc; + # version = draupnirSrc.rev; + #}); + + packages.redpanda-connect = (pkgs.callPackage ./packages/redpanda-connect/default.nix { }); + + packages.matrix-synapse-unwrapped-patched = (self.inputs.nixpkgs-override-synapse or self.inputs.nixpkgs-master).legacyPackages.${system}.matrix-synapse-unwrapped.overrideAttrs (oldAttrs: rec { + patches = + (if oldAttrs ? patches then oldAttrs.patches else [ ]) + ++ pkgs.lib.map (path: ./packages/overlays/matrix-synapse/patches/${path}) (builtins.attrNames (builtins.readDir ./packages/overlays/matrix-synapse/patches)); + + cargoDeps = pkgs.rustPlatform.fetchCargoVendor { + inherit (oldAttrs) src; + inherit patches; + name = "${oldAttrs.pname}-${oldAttrs.version}"; + hash = "sha256-6jsOGcUAamyQyIcuDZiZGxEGPSwDpYcQkfvPjaHEKjA="; + }; + + #doInstallCheck = false; + #doCheck = true; + installCheckPhase = '' + runHook preCheck + + # remove src module, so tests use the installed module instead + rm -rf ./synapse + + # Emma: removed core limitation for tests + PYTHONPATH=".:$PYTHONPATH" ${(self.inputs.nixpkgs-override-synapse or self.inputs.nixpkgs-master).legacyPackages.${system}.python3Packages.python.interpreter} -m twisted.trial -j $NIX_BUILD_CORES tests + + runHook postCheck + ''; + }); + + packages.draupnir = (self.inputs.nixpkgs-override-draupnir or self.inputs.nixpkgs-master).legacyPackages.${system}.draupnir; + +# packages.jetbrains = (self.inputs.jetbrains or self.inputs.nixpkgs).legacyPackages.${system}.jetbrains; + packages.jetbrains = pkgs-jetbrains.jetbrains; } ); }