diff --git a/flake.nix b/flake.nix index 94236a9..f841db5 100644 --- a/flake.nix +++ b/flake.nix @@ -45,12 +45,12 @@ specialArgs = inputs; modules = [ ./hosts/vm/apprentix ] ++ baseModules; }; - + belenios = nixosSystem { specialArgs = inputs; modules = [ ./hosts/vm/belenios ] ++ baseModules ++ additionalPackages; }; - + collabora = nixosSystem { specialArgs = inputs; modules = [ ./hosts/vm/collabora ] ++ baseModules; @@ -120,6 +120,8 @@ perSystem = { config, pkgs, ... }: { + packages = pkgs.callPackage ./pkgs/packages.nix { inherit pkgs; }; + devShells = { default = pkgs.callPackage ./devshells/default.nix { inherit (inputs) agenix; }; }; diff --git a/hosts/iso/default.nix b/hosts/iso/default.nix index 0933dcc..cfcfe1e 100644 --- a/hosts/iso/default.nix +++ b/hosts/iso/default.nix @@ -1,4 +1,9 @@ -{ pkgs, lib, modulesPath, ... }: +{ + pkgs, + lib, + modulesPath, + ... +}: { imports = [ @@ -12,14 +17,21 @@ }; nix = { - settings.experimental-features = [ "nix-command" "flakes" ]; + settings.experimental-features = [ + "nix-command" + "flakes" + ]; extraOptions = "experimental-features = nix-command flakes"; }; boot = { kernelParams = [ "console=ttyS0,115200" ]; kernelPackages = pkgs.linuxPackages_latest; - supportedFilesystems = lib.mkForce [ "btrfs" "vfat" "zfs"]; + supportedFilesystems = lib.mkForce [ + "btrfs" + "vfat" + "zfs" + ]; }; services.openssh = { @@ -37,35 +49,32 @@ programs.vim.enable = true; environment.systemPackages = - let crans-ip-config = - ( - pkgs.writeShellScriptBin "crans-ip-config" - '' - #!/usr/bin/env bash - echo -n "ID : " - read ID - ip -c l - echo -n "vlan 10, interface ensXX : " - read INTERFACE10 - ip addr add 172.16.10.$ID/24 dev ens$INTERFACE10 + let + crans-ip-config = ( + pkgs.writeShellScriptBin "crans-ip-config" '' + #!/usr/bin/env bash + echo -n "ID : " + read ID + ip -c l + echo -n "vlan 10, interface ensXX : " + read INTERFACE10 + ip addr add 172.16.10.$ID/24 dev ens$INTERFACE10 + ip link set ens$INTERFACE10 up + echo -n "souhaitez-vous configurer le vlan 3 ? (o/N)" + read REP + if [[ "$REP" == [oOyY] ]]; then + echo -n "vlan 3, interface ensXX : " + read INTERFACE3 + ip addr add 172.16.3.$ID/24 dev ens$INTERFACE3 ip link set ens$INTERFACE10 up - echo -n "souhaitez-vous configurer le vlan 3 ? (o/N)" - read REP - if [[ "$REP" == [oOyY] ]]; then - echo -n "vlan 3, interface ensXX : " - read INTERFACE3 - ip addr add 172.16.3.$ID/24 dev ens$INTERFACE3 - ip link set ens$INTERFACE10 up - ip route add default via 172.16.3.99 - else - ip route add default via 172.16.10.101 - fi - '' - ); - crans-disk-config = - ( - pkgs.writeShellScriptBin "crans-disk-config" + ip route add default via 172.16.3.99 + else + ip route add default via 172.16.10.101 + fi '' + ); + crans-disk-config = ( + pkgs.writeShellScriptBin "crans-disk-config" '' #!/usr/bin/env bash lsblk echo -n "disque /dev/XXX : " @@ -85,7 +94,9 @@ echo "Pensez également à vous mettre sur la branche appropriée" '' ); - in with pkgs; [ + in + with pkgs; + [ bat fd helix @@ -94,7 +105,7 @@ shelldap crans-ip-config crans-disk-config - ]; + ]; users.users.root = { password = "crans"; diff --git a/hosts/vm/collabora/collabora.nix b/hosts/vm/collabora/collabora.nix index 9956ee1..92e6b23 100644 --- a/hosts/vm/collabora/collabora.nix +++ b/hosts/vm/collabora/collabora.nix @@ -8,7 +8,9 @@ let pam_modules_path = "${pkgs.pam}/lib/security"; # nixos/modules/security/pam.nix - pam_ldap = "${if config.users.ldap.daemon.enable then pkgs.nss_pam_ldapd else pkgs.pam_ldap}/lib/security"; + pam_ldap = "${ + if config.users.ldap.daemon.enable then pkgs.nss_pam_ldapd else pkgs.pam_ldap + }/lib/security"; in { services.collabora-online = { @@ -22,13 +24,19 @@ in net = { listen = "loopback"; - post_allow.host = ["::1" "172.0.0.1"]; + post_allow.host = [ + "::1" + "172.0.0.1" + ]; }; # ouvre seulement les fichiers depuis nextcloud storage.wopi = { "@allow" = true; - host = ["nextcloud.crans.org" "nextcloud.adm.crans.org"]; + host = [ + "nextcloud.crans.org" + "nextcloud.adm.crans.org" + ]; }; admin_console.enable_pam = true; diff --git a/hosts/vm/collabora/hardware-configuration.nix b/hosts/vm/collabora/hardware-configuration.nix index 49d94ca..8f9a1cb 100644 --- a/hosts/vm/collabora/hardware-configuration.nix +++ b/hosts/vm/collabora/hardware-configuration.nix @@ -1,22 +1,35 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/profiles/qemu-guest.nix") - ]; + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; - boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; + boot.initrd.availableKernelModules = [ + "ata_piix" + "uhci_hcd" + "virtio_pci" + "virtio_scsi" + "sd_mod" + "sr_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/ef139717-388f-41f3-b707-b0f75af3f546"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/ef139717-388f-41f3-b707-b0f75af3f546"; + fsType = "ext4"; + }; swapDevices = [ ]; diff --git a/hosts/vm/nextcloud/nextcloud.nix b/hosts/vm/nextcloud/nextcloud.nix index 0636726..2d4ec65 100644 --- a/hosts/vm/nextcloud/nextcloud.nix +++ b/hosts/vm/nextcloud/nextcloud.nix @@ -44,7 +44,6 @@ ]; }; - appstoreEnable = true; extraAppsEnable = true; }; diff --git a/hosts/vm/periodique/hardware-configuration.nix b/hosts/vm/periodique/hardware-configuration.nix index 07f0ec4..a1f9edc 100644 --- a/hosts/vm/periodique/hardware-configuration.nix +++ b/hosts/vm/periodique/hardware-configuration.nix @@ -1,22 +1,35 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/profiles/qemu-guest.nix") - ]; + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; - boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; + boot.initrd.availableKernelModules = [ + "ata_piix" + "uhci_hcd" + "virtio_pci" + "virtio_scsi" + "sd_mod" + "sr_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/ad1cdd57-44a2-4e1c-83c7-8810a567e0f7"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/ad1cdd57-44a2-4e1c-83c7-8810a567e0f7"; + fsType = "ext4"; + }; swapDevices = [ ]; diff --git a/hosts/vm/periodique/networking.nix b/hosts/vm/periodique/networking.nix index b8e6068..a5fbb24 100644 --- a/hosts/vm/periodique/networking.nix +++ b/hosts/vm/periodique/networking.nix @@ -6,17 +6,21 @@ ens18 = { ipv4 = { - addresses = [{ - address = "172.16.10.118"; - prefixLength = 24; - }]; + addresses = [ + { + address = "172.16.10.118"; + prefixLength = 24; + } + ]; }; ipv6 = { - addresses = [{ - address = "fd00::10:0:ff:fe01:1810"; - prefixLength = 64; - }]; + addresses = [ + { + address = "fd00::10:0:ff:fe01:1810"; + prefixLength = 64; + } + ]; }; }; @@ -24,27 +28,35 @@ ens19 = { ipv4 = { - addresses = [{ - address = "172.16.3.118"; - prefixLength = 24; - }]; - routes = [{ - address = "0.0.0.0"; - via = "172.16.3.99"; - prefixLength = 0; - }]; + addresses = [ + { + address = "172.16.3.118"; + prefixLength = 24; + } + ]; + routes = [ + { + address = "0.0.0.0"; + via = "172.16.3.99"; + prefixLength = 0; + } + ]; }; ipv6 = { - addresses = [{ - address = "2a0c:700:3::ff:fe01:1803"; - prefixLength = 64; - }]; - routes = [{ - address = "::"; - via = "2a0c:700:3::ff:fe00:9903"; - prefixLength = 0; - }]; + addresses = [ + { + address = "2a0c:700:3::ff:fe01:1803"; + prefixLength = 64; + } + ]; + routes = [ + { + address = "::"; + via = "2a0c:700:3::ff:fe00:9903"; + prefixLength = 0; + } + ]; }; }; diff --git a/hosts/vm/reverseproxy/hardware-configuration.nix b/hosts/vm/reverseproxy/hardware-configuration.nix index f512116..a308559 100644 --- a/hosts/vm/reverseproxy/hardware-configuration.nix +++ b/hosts/vm/reverseproxy/hardware-configuration.nix @@ -1,22 +1,35 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/profiles/qemu-guest.nix") - ]; + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; - boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; + boot.initrd.availableKernelModules = [ + "ata_piix" + "uhci_hcd" + "virtio_pci" + "virtio_scsi" + "sd_mod" + "sr_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/c4c2de17-2965-4c0a-b4c5-7d518712c9aa"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/c4c2de17-2965-4c0a-b4c5-7d518712c9aa"; + fsType = "ext4"; + }; swapDevices = [ ]; diff --git a/modules/crans/grub.nix b/modules/crans/grub.nix index c4ce65b..e087630 100644 --- a/modules/crans/grub.nix +++ b/modules/crans/grub.nix @@ -1,4 +1,4 @@ -{...}: +{ ... }: { boot.loader.grub = { splashImage = ../../assets/nix-crans_bootloader.png; diff --git a/modules/crans/home.nix b/modules/crans/home.nix index e2e4bab..071f629 100644 --- a/modules/crans/home.nix +++ b/modules/crans/home.nix @@ -31,7 +31,7 @@ in home_adh = mkIf cfg.homeAdh.enable { mountPoint = "/home-adh"; device = "172.16.4.2:/pool/home"; - fsType = "nfs"; + fsType = "nfs"; }; }; }; diff --git a/modules/crans/restic_client.nix b/modules/crans/restic_client.nix index b0b3228..140a90e 100644 --- a/modules/crans/restic_client.nix +++ b/modules/crans/restic_client.nix @@ -52,11 +52,13 @@ in paths = [ "/etc" "/var" - ] ++ cfg.additionalPaths; + ] + ++ cfg.additionalPaths; exclude = [ "/var/cache" "/var/lib/lxcfs" - ] ++ cfg.additionalExcludes; + ] + ++ cfg.additionalExcludes; timerConfig = { OnCalendar = cfg.when; RandomizedDelaySec = "6h"; diff --git a/modules/services/reverseproxy.nix b/modules/services/reverseproxy.nix index 5098771..a142575 100644 --- a/modules/services/reverseproxy.nix +++ b/modules/services/reverseproxy.nix @@ -202,25 +202,27 @@ in }) cfg.virtualHosts; # Génération des alias - getAliases = name: config: lib.foldr ( - tld: acc: - acc - ++ - (lib.foldr (alias: acc: acc ++ ["${alias}.crans.${tld}"]) ["${name}.crans.${tld}"] config.serverAliases) - ) - (lib.foldr (alias: acc: acc ++ ["${alias}.crans.${mainTld}"]) [] config.serverAliases) - otherTld; + getAliases = + name: config: + lib.foldr + ( + tld: acc: + acc + ++ (lib.foldr (alias: acc: acc ++ [ "${alias}.crans.${tld}" ]) [ + "${name}.crans.${tld}" + ] config.serverAliases) + ) + (lib.foldr (alias: acc: acc ++ [ "${alias}.crans.${mainTld}" ]) [ ] config.serverAliases) + otherTld; # Configuration des alias aliasConfig = lib.foldr ( vhost: acc: acc - // - lib.foldr ( + // lib.foldr ( alias: acc: acc - // - { + // { "${vhost.name}-alias-${alias}" = rec { rejectSSL = vhost.value.httpOnly; forceSSL = !rejectSSL; diff --git a/pkgs/belenios/default.nix b/pkgs/belenios/default.nix index 3776e62..7f4441b 100644 --- a/pkgs/belenios/default.nix +++ b/pkgs/belenios/default.nix @@ -1,28 +1,83 @@ -{ - fetchFromGitLab, - ocamlPackages, - belenios-server, - belenios-tool -}: +{ pkgs }: + +let + ocamlPackages = pkgs.ocaml-ng.ocamlPackages_5_3; -ocamlPackages.buildDunePackage rec { - pname = "belenios"; version = "3.1"; - - src = fetchFromGitLab { + src = pkgs.fetchFromGitLab { domain = "gitlab.inria.fr"; - owner = pname; - repo = pname; + owner = "belenios"; + repo = "belenios"; rev = version; hash = "sha256-Mrx6AQakeBg6IeqNyDUZ5j6KaUGOh1AUfrLIxvDI45M="; }; - - nativeBuildInputs = with ocamlPackages; [ - odoc - ]; +in - buildInputs = [ - belenios-server - belenios-tool - ]; +pkgs.stdenvNoCC.mkDerivation rec { + name = "belenios"; + inherit version; + + belenios = ocamlPackages.buildDunePackage { + pname = "belenios"; + inherit version src; + + nativeBuildInputs = with ocamlPackages; [ + odoc + ]; + + buildInputs = [ + belenios-server + belenios-tool + ]; + }; + + belenios-lib = pkgs.callPackage ./lib.nix { + inherit + version + src + belenios-platform + ocamlPackages + ; + }; + + belenios-platform = pkgs.callPackage ./platform.nix { inherit version src ocamlPackages; }; + + belenios-platform-js = pkgs.callPackage ./platform-js.nix { + inherit + version + src + ocamlPackages + belenios-platform + ; + }; + + belenios-platform-native = pkgs.callPackage ./platform-native.nix { + inherit + version + src + ocamlPackages + belenios-platform + ; + }; + + belenios-server = pkgs.callPackage ./server.nix { + inherit + version + src + ocamlPackages + belenios-lib + belenios-platform-native + belenios-platform-js + ; + }; + + belenios-tool = pkgs.callPackage ./tool.nix { + inherit + version + src + ocamlPackages + belenios-lib + belenios-platform-native + ; + }; } diff --git a/pkgs/belenios/flake.lock b/pkgs/belenios/flake.lock deleted file mode 100644 index 2e80cc2..0000000 --- a/pkgs/belenios/flake.lock +++ /dev/null @@ -1,59 +0,0 @@ -{ - "nodes": { - "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1772408722, - "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", - "type": "github" - }, - "original": { - "id": "flake-parts", - "type": "indirect" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1774244481, - "narHash": "sha256-4XfMXU0DjN83o6HWZoKG9PegCvKvIhNUnRUI19vzTcQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "4590696c8693fea477850fe379a01544293ca4e2", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-25.11", - "type": "indirect" - } - }, - "nixpkgs-lib": { - "locked": { - "lastModified": 1772328832, - "narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixpkgs.lib", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/pkgs/belenios/lib.nix b/pkgs/belenios/lib.nix index 615b8a2..190564c 100644 --- a/pkgs/belenios/lib.nix +++ b/pkgs/belenios/lib.nix @@ -1,12 +1,13 @@ { - belenios, + version, + src, belenios-platform, ocamlPackages, }: ocamlPackages.buildDunePackage { pname = "belenios-lib"; - inherit (belenios) version src; + inherit version src; nativeBuildInputs = with ocamlPackages; [ atdgen @@ -18,16 +19,15 @@ ocamlPackages.buildDunePackage { biniou ]; - propagatedBuildInputs = - [ - belenios-platform - ] - ++ (with ocamlPackages; [ - atdgen-runtime - base64 - ocaml_gettext - re - uri - yojson - ]); + propagatedBuildInputs = [ + belenios-platform + ] + ++ (with ocamlPackages; [ + atdgen-runtime + base64 + ocaml_gettext + re + uri + yojson + ]); } diff --git a/pkgs/belenios/platform-js.nix b/pkgs/belenios/platform-js.nix index d980e57..8f72e8e 100644 --- a/pkgs/belenios/platform-js.nix +++ b/pkgs/belenios/platform-js.nix @@ -1,12 +1,13 @@ { - belenios, + version, + src, belenios-platform, ocamlPackages, }: ocamlPackages.buildDunePackage { pname = "belenios-platform-js"; - inherit (belenios) version src; + inherit version src; nativeBuildInputs = with ocamlPackages; [ odoc diff --git a/pkgs/belenios/platform-native.nix b/pkgs/belenios/platform-native.nix index aecc7be..b614839 100644 --- a/pkgs/belenios/platform-native.nix +++ b/pkgs/belenios/platform-native.nix @@ -1,27 +1,27 @@ { - belenios, + version, + src, belenios-platform, ocamlPackages, - libsodium + libsodium, }: ocamlPackages.buildDunePackage { pname = "belenios-platform-native"; - inherit (belenios) version src; + inherit version src; nativeBuildInputs = with ocamlPackages; [ odoc ]; - buildInputs = - [ - belenios-platform - libsodium - ] - ++ (with ocamlPackages; [ - lwt - cryptokit - digestif - zarith - ]); + buildInputs = [ + belenios-platform + libsodium + ] + ++ (with ocamlPackages; [ + lwt + cryptokit + digestif + zarith + ]); } diff --git a/pkgs/belenios/platform.nix b/pkgs/belenios/platform.nix index bc7dbeb..a18b384 100644 --- a/pkgs/belenios/platform.nix +++ b/pkgs/belenios/platform.nix @@ -1,15 +1,12 @@ { - belenios, + version, + src, ocamlPackages, }: ocamlPackages.buildDunePackage { pname = "belenios-platform"; - inherit (belenios) version src; - - # nativeBuildInputs = with ocamlPackages; [ - # odoc - # ]; + inherit version src; propagatedBuildInputs = with ocamlPackages; [ lwt diff --git a/pkgs/belenios/server.nix b/pkgs/belenios/server.nix index e95b5bc..1f15860 100644 --- a/pkgs/belenios/server.nix +++ b/pkgs/belenios/server.nix @@ -1,5 +1,6 @@ { - belenios, + version, + src, belenios-lib, belenios-platform-native, belenios-platform-js, @@ -8,9 +9,7 @@ ocamlPackages.buildDunePackage { pname = "belenios-server"; - inherit (belenios) version src; - - # dontDetectOcamlConflicts = true; + inherit version src; nativeBuildInputs = with ocamlPackages; [ atdgen @@ -21,39 +20,36 @@ ocamlPackages.buildDunePackage { patches = [ ./netstring.patch ]; - buildInputs = - [ - # belenios-lib - # belenios-platform-native - belenios-platform-js - ] - ++ (with ocamlPackages; [ - # calendar - # csv - eliom - gettext-camomile - # lwt - # ocamlnet - ocsipersist - ocsipersist-lib - ocsipersist-sqlite-config - ocsigen_server - ocaml_gettext - xml-light - tyxml - markup - sendmail - ]); + buildInputs = [ + # belenios-lib + # belenios-platform-native + belenios-platform-js + ] + ++ (with ocamlPackages; [ + # calendar + # csv + eliom + gettext-camomile + # lwt + # ocamlnet + ocsipersist + ocsipersist-lib + ocsipersist-sqlite-config + ocsigen_server + ocaml_gettext + xml-light + tyxml + markup + sendmail + ]); - propagatedBuildInputs = - [ - belenios-lib - belenios-platform-native - ] - ++ (with ocamlPackages; [ - calendar - lwt - xml-light - ]); + propagatedBuildInputs = [ + belenios-lib + belenios-platform-native + ] + ++ (with ocamlPackages; [ + calendar + lwt + xml-light + ]); } - diff --git a/pkgs/belenios/services.nix b/pkgs/belenios/services.nix index 1d19ec0..bdd4c0b 100644 --- a/pkgs/belenios/services.nix +++ b/pkgs/belenios/services.nix @@ -1,11 +1,16 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: let cfg = config.services.belenios; configFile = pkgs.writeText "belenios-server.conf" cfg.config; - inherit (lib) mkEnableOption mkPackageOption mkOption mkIf; + inherit (lib) mkEnableOption mkOption mkIf; in { options.services.belenios = { @@ -134,7 +139,7 @@ in group = "belenios"; }; users.groups.belenios = { }; - + systemd.services.belenios = { description = "Belenios Web server service"; wantedBy = [ "multi-user.target" ]; diff --git a/pkgs/belenios/tool.nix b/pkgs/belenios/tool.nix index 2549ae5..7db39d0 100644 --- a/pkgs/belenios/tool.nix +++ b/pkgs/belenios/tool.nix @@ -1,31 +1,30 @@ { - belenios, + version, + src, belenios-lib, - # belenios-platform, belenios-platform-native, libsodium, - ocamlPackages + ocamlPackages, }: ocamlPackages.buildDunePackage { pname = "belenios-tool"; - inherit (belenios) version src; + inherit version src; - buildInputs = - [ - belenios-lib - # belenios-platform - belenios-platform-native - libsodium - ] - ++ (with ocamlPackages; [ - cmdliner - cryptokit - hex - ]); + buildInputs = [ + belenios-lib + # belenios-platform + belenios-platform-native + libsodium + ] + ++ (with ocamlPackages; [ + cmdliner + cryptokit + hex + ]); propagatedBuildInputs = with ocamlPackages; [ lwt cohttp-lwt-unix - ]; + ]; } diff --git a/pkgs/default.nix b/pkgs/default.nix index 97a42e4..3737008 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,10 +1,9 @@ { ... }: { - imports = - [ - ./services.nix - ]; + imports = [ + ./services.nix + ]; # Import local packages nixpkgs.overlays = [ diff --git a/pkgs/flake.nix b/pkgs/flake.nix index 38637cd..1d8dbe4 100644 --- a/pkgs/flake.nix +++ b/pkgs/flake.nix @@ -3,25 +3,50 @@ nixpkgs.url = "nixpkgs/nixos-25.11"; }; - outputs = inputs@{ flake-parts, ... }: + outputs = + inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { systems = [ "x86_64-linux" ]; - perSystem = { pkgs, ... }: rec { - devShells.default = pkgs.mkShell { - packages = []; + perSystem = + { pkgs, ... }: + rec { + devShells.default = pkgs.mkShell { + packages = [ ]; + }; + packages = + let + ocamlPackages = pkgs.ocaml-ng.ocamlPackages_5_2; + in + rec { + belenios = pkgs.callPackage ./belenios { inherit ocamlPackages belenios-server belenios-tool; }; + belenios-lib = pkgs.callPackage ./belenios/lib.nix { + inherit belenios ocamlPackages belenios-platform; + }; + belenios-tool = pkgs.callPackage ./belenios/tool.nix { + inherit + belenios + ocamlPackages + belenios-lib + belenios-platform-native + ; + }; + belenios-server = pkgs.callPackage ./belenios/server.nix { + inherit + belenios + ocamlPackages + belenios-lib + belenios-platform-native + belenios-platform-js + ; + }; + belenios-platform = pkgs.callPackage ./belenios/platform.nix { inherit belenios ocamlPackages; }; + belenios-platform-native = pkgs.callPackage ./belenios/platform-native.nix { + inherit belenios ocamlPackages belenios-platform; + }; + belenios-platform-js = pkgs.callPackage ./belenios/platform-js.nix { + inherit belenios ocamlPackages belenios-platform; + }; + }; }; - packages = let - ocamlPackages = pkgs.ocaml-ng.ocamlPackages_5_2; - in rec { - belenios = pkgs.callPackage ./belenios { inherit ocamlPackages belenios-server belenios-tool; }; - belenios-lib = pkgs.callPackage ./belenios/lib.nix { inherit belenios ocamlPackages belenios-platform; }; - belenios-tool = pkgs.callPackage ./belenios/tool.nix { inherit belenios ocamlPackages belenios-lib belenios-platform-native; }; - belenios-server = pkgs.callPackage ./belenios/server.nix { inherit belenios ocamlPackages belenios-lib belenios-platform-native belenios-platform-js; }; - belenios-platform = pkgs.callPackage ./belenios/platform.nix { inherit belenios ocamlPackages; }; - belenios-platform-native = pkgs.callPackage ./belenios/platform-native.nix { inherit belenios ocamlPackages belenios-platform; }; - belenios-platform-js = pkgs.callPackage ./belenios/platform-js.nix { inherit belenios ocamlPackages belenios-platform; }; - }; - }; }; } - diff --git a/pkgs/packages.nix b/pkgs/packages.nix index c112367..ecf12ef 100644 --- a/pkgs/packages.nix +++ b/pkgs/packages.nix @@ -1,14 +1,5 @@ -{ pkgs ? import { } }: +{ pkgs, ... }: -let - ocamlPackages = pkgs.ocaml-ng.ocamlPackages_4_14; -in -rec { - belenios = pkgs.callPackage ./belenios { inherit ocamlPackages belenios-server belenios-tool; }; - belenios-lib = pkgs.callPackage ./belenios/lib.nix { inherit belenios ocamlPackages belenios-platform; }; - belenios-tool = pkgs.callPackage ./belenios/tool.nix { inherit belenios ocamlPackages belenios-lib belenios-platform belenios-platform-native; }; - belenios-server = pkgs.callPackage ./belenios/server.nix { inherit belenios ocamlPackages belenios-lib belenios-platform-native belenios-platform-js; }; - belenios-platform = pkgs.callPackage ./belenios/platform.nix { inherit belenios ocamlPackages; }; - belenios-platform-native = pkgs.callPackage ./belenios/platform-native.nix { inherit belenios ocamlPackages belenios-platform; }; - belenios-platform-js = pkgs.callPackage ./belenios/platform-js.nix { inherit belenios ocamlPackages belenios-platform; }; +{ + belenios = pkgs.callPackage ./belenios { inherit pkgs; }; } diff --git a/pkgs/services.nix b/pkgs/services.nix index baba8b8..d3f72a9 100644 --- a/pkgs/services.nix +++ b/pkgs/services.nix @@ -1,8 +1,7 @@ { ... }: { - imports = - [ - ./belenios/services.nix - ]; + imports = [ + ./belenios/services.nix + ]; }