From 28dfe9e981b71bf99542969b3f82193b8e067cf2 Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Wed, 25 Mar 2026 22:06:30 -0400 Subject: [PATCH] Working flatpak builds --- flake.lock | 85 +++++++++++++++++++++++++++++++++++++++++++++++++----- flake.nix | 33 ++++++++++++++++----- 2 files changed, 103 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index 7826732..97a63fc 100644 --- a/flake.lock +++ b/flake.lock @@ -18,17 +18,54 @@ "type": "github" } }, - "nixpkgs": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1767640445, - "narHash": "sha256-UWYqmD7JFBEDBHWYcqE6s6c77pWdcU/i+bwD6XxMb8A=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "9f0c42f8bc7151b8e7e5840fb3bd454ad850d8c5", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { - "owner": "nixos", + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nix2flatpak": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1773751765, + "narHash": "sha256-ksSfcMZOYdkHKiOxhYosgl7fqNOb9a6qp5szCPJK2Jo=", + "owner": "neobrain", + "repo": "nix2flatpak", + "rev": "8e4029b7f1fd085c84258a81d7ab0c0cdc0cbeb5", + "type": "github" + }, + "original": { + "owner": "neobrain", + "repo": "nix2flatpak", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1773389992, + "narHash": "sha256-wvfdLLWJ2I9oEpDd9PfMA8osfIZicoQ5MT1jIwNs9Tk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c06b4ae3d6599a672a6210b7021d699c351eebda", + "type": "github" + }, + "original": { + "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" @@ -49,10 +86,42 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1767640445, + "narHash": "sha256-UWYqmD7JFBEDBHWYcqE6s6c77pWdcU/i+bwD6XxMb8A=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "9f0c42f8bc7151b8e7e5840fb3bd454ad850d8c5", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs" + "nix2flatpak": "nix2flatpak", + "nixpkgs": "nixpkgs_2" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index fdcf894..d842834 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,7 @@ self.submodules = true; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; + nix2flatpak.url = "github:neobrain/nix2flatpak"; }; outputs = @@ -39,14 +40,32 @@ }; }; - packages = { - default = pkgs.callPackage ./linux/nix/pkg { - src = self; + packages = + let + default = pkgs.callPackage ./linux/nix/pkg { + src = self; + }; + in + { + inherit default; + + flatpak = inputs.nix2flatpak.lib.${system}.mkFlatpak { + appId = "nexus.federated.Nexus"; + package = default; + runtime = "org.gnome.Platform/49"; + permissions = { + share = [ "network" ]; + sockets = [ + "fallback-x11" + "wayland" + ]; + }; + }; + + gomuks = pkgs.callPackage ./linux/nix/pkg/gomuks.nix { + src = self; + }; }; - gomuks = pkgs.callPackage ./linux/nix/pkg/gomuks.nix { - src = self; - }; - }; devShells.default = pkgs.callPackage ./linux/nix/devshell.nix { }; };