Skip to content

Commit

Permalink
feat: declaratively install flatpak
Browse files Browse the repository at this point in the history
  • Loading branch information
youwen5 committed Dec 9, 2024
1 parent 8f86ce2 commit 2b2c43a
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 4 deletions.
16 changes: 16 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 0 additions & 2 deletions hosts/adrastea/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions hosts/adrastea/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
../../modules/linux/wine
../../modules/linux/stylix
../../modules/linux/distrobox
../../modules/linux/flatpak
../../overlays
{
home-manager.useGlobalPkgs = true;
Expand Down
2 changes: 0 additions & 2 deletions hosts/demeter/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@

services.xserver.videoDrivers = [ "nvidia" ];

services.flatpak.enable = true;

# services.desktopManager.plasma6.enable = true;

# Configure keymap in X11
Expand Down
1 change: 1 addition & 0 deletions hosts/demeter/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
../../modules/linux/audio-prod
../../modules/linux/stylix
../../modules/linux/wine
../../modules/linux/flatpak
../../overlays
{
home-manager.useGlobalPkgs = true;
Expand Down
45 changes: 45 additions & 0 deletions modules/linux/flatpak/default.nix
Original file line number Diff line number Diff line change
@@ -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";
}
];
};
}

0 comments on commit 2b2c43a

Please sign in to comment.