diff --git a/flake.lock b/flake.lock index 412e2c5..049de78 100644 --- a/flake.lock +++ b/flake.lock @@ -511,6 +511,21 @@ "type": "github" } }, + "nix-flatpak": { + "locked": { + "lastModified": 1733345341, + "narHash": "sha256-8S58zrdpzGhax6tmn1i+R3AA0N9DJMu5FQI8JkA0NNU=", + "owner": "gmodena", + "repo": "nix-flatpak", + "rev": "ebb0be49fc381112ff37726c6dd6df4df2ef5a1b", + "type": "github" + }, + "original": { + "owner": "gmodena", + "repo": "nix-flatpak", + "type": "github" + } + }, "nix-homebrew": { "inputs": { "brew-src": "brew-src", @@ -740,6 +755,7 @@ "homebrew-core": "homebrew-core", "lanzaboote": "lanzaboote", "nix-darwin": "nix-darwin", + "nix-flatpak": "nix-flatpak", "nix-homebrew": "nix-homebrew", "nix-index-database": "nix-index-database", "nixos-wsl": "nixos-wsl", diff --git a/flake.nix b/flake.nix index 3b1a11a..66a573a 100755 --- a/flake.nix +++ b/flake.nix @@ -24,6 +24,8 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + nix-flatpak.url = "github:gmodena/nix-flatpak"; + nix-homebrew = { url = "github:zhaofengli-wip/nix-homebrew"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/hosts/adrastea/configuration.nix b/hosts/adrastea/configuration.nix index 4e78ecf..c384fa4 100755 --- a/hosts/adrastea/configuration.nix +++ b/hosts/adrastea/configuration.nix @@ -86,8 +86,6 @@ # }; # }; - services.flatpak.enable = true; - boot.initrd.luks.devices."luks-52d1be6d-b32f-41e0-a6d7-2ff52599fe7c".device = "/dev/disk/by-uuid/52d1be6d-b32f-41e0-a6d7-2ff52599fe7c"; services.tlp.enable = true; diff --git a/hosts/adrastea/default.nix b/hosts/adrastea/default.nix index f4b2cc3..927177b 100644 --- a/hosts/adrastea/default.nix +++ b/hosts/adrastea/default.nix @@ -17,6 +17,7 @@ ../../modules/linux/wine ../../modules/linux/stylix ../../modules/linux/distrobox + ../../modules/linux/flatpak ../../overlays { home-manager.useGlobalPkgs = true; diff --git a/hosts/demeter/configuration.nix b/hosts/demeter/configuration.nix index f70fdbe..00f781f 100755 --- a/hosts/demeter/configuration.nix +++ b/hosts/demeter/configuration.nix @@ -126,8 +126,6 @@ services.xserver.videoDrivers = [ "nvidia" ]; - services.flatpak.enable = true; - # services.desktopManager.plasma6.enable = true; # Configure keymap in X11 diff --git a/hosts/demeter/default.nix b/hosts/demeter/default.nix index 83743eb..9414274 100644 --- a/hosts/demeter/default.nix +++ b/hosts/demeter/default.nix @@ -17,6 +17,7 @@ ../../modules/linux/audio-prod ../../modules/linux/stylix ../../modules/linux/wine + ../../modules/linux/flatpak ../../overlays { home-manager.useGlobalPkgs = true; diff --git a/modules/linux/flatpak/default.nix b/modules/linux/flatpak/default.nix new file mode 100644 index 0000000..d5d4a34 --- /dev/null +++ b/modules/linux/flatpak/default.nix @@ -0,0 +1,45 @@ +# NOTE: this module is IMPURE. Flatpaks are declaratively specified but not +# versioned. Therefore, they are not included in generational rollbacks and +# persist between generations. This is not ideal, but at least it is a better +# situation than imperative installation +{ inputs, ... }: +{ + imports = [ + inputs.nix-flatpak.nixosModules.nix-flatpak + ]; + + services.flatpak = { + enable = true; + + overrides = { + global = { + Context.sockets = [ + "wayland" + "!x11" + "!fallback-x11" + ]; + + Environment = { + # Fix un-themed cursor in some Wayland apps + XCURSOR_PATH = "/run/host/user-share/icons:/run/host/share/icons"; + }; + }; + }; + + update.auto = { + enable = true; + onCalendar = "weekly"; + }; + + packages = [ + { + flatpakref = "https://sober.vinegarhq.org/sober.flatpakref"; + sha256 = "sha256:1pj8y1xhiwgbnhrr3yr3ybpfis9slrl73i0b1lc9q89vhip6ym2l"; + } + { + appId = "org.vinegarhq.Sober"; + origin = "sober"; + } + ]; + }; +}