dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit 51f102dae1469e15f2760c806daf616c36216c32 parent 6ebe997526321415d2e7854d466f121792656909 Author: maydayv7 <maydayv7@gmail.com> Date: Wed, 15 Nov 2023 21:50:55 +0530 feat: Support declarative Flatpak app install /# Take 2 #/
Diffstat:
| M | README.md | | | 2 | ++ |
| M | flake.lock | | | 16 | ++++++++++++++++ |
| M | flake.nix | | | 3 | +++ |
| M | modules/README.md | | | 2 | +- |
| A | modules/apps/flatpak.nix | | | 58 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| M | modules/gui/desktop/gnome.nix | | | 17 | +++++++++++++++++ |
6 files changed, 97 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md @@ -39,6 +39,7 @@ This [repository](https://github.com/maydayv7/dotfiles) contains the configurati - Configuration [Checks](./modules/nix/checks.nix) using [`pre-commit-hooks.nix`](https://github.com/cachix/pre-commit-hooks.nix) - Support for `source` filters with [`nix-filter`](https://github.com/numtide/nix-filter) and [`gitignore.nix`](https://github.com/hercules-ci/gitignore.nix) - Support for Base16 color theming using [`stylix`](https://github.com/danth/stylix) +- Support for declaratively installing [Flatpak](./modules/apps/flatpak.nix) applications using [`nix-flatpak`](https://github.com/gmodena/nix-flatpak) - Wrapped `wine` [Applications](./packages/wine) using Emmanuel's [Wrapper](https://github.com/emmanuelrosa/erosanix/tree/0dabea58d483e13d2de141517cb4ff1cb230b2aa/pkgs/mkwindowsapp) - Support for Android Virtualisation using [Waydroid](https://waydro.id/) - Declaratively Configured [Windows VM](./devices/vm/Windows.nix) using the [WFVM](https://git.m-labs.hk/M-Labs/wfvm) module @@ -416,6 +417,7 @@ You can navigate to the `README`s present in the various directories to know mor - Fix Emoji Support - Miscellaneous Updates +- Support declarative [Flatpak](https://flatpak.org/) application install ### v13 diff --git a/flake.lock b/flake.lock @@ -229,6 +229,21 @@ "type": "github" } }, + "flatpak": { + "locked": { + "lastModified": 1699990197, + "narHash": "sha256-zsmELy+imDzoMTxAKhPRT2I7zJ3YGMP+yT0slgZZSxI=", + "owner": "gmodena", + "repo": "nix-flatpak", + "rev": "9b7e536b6e6ca41dd53d93a697470636f9d3ae56", + "type": "github" + }, + "original": { + "owner": "gmodena", + "repo": "nix-flatpak", + "type": "github" + } + }, "fromYaml": { "flake": false, "locked": { @@ -583,6 +598,7 @@ "root": { "inputs": { "filter": "filter", + "flatpak": "flatpak", "gaming": "gaming", "generators": "generators", "hardware": "hardware", diff --git a/flake.nix b/flake.nix @@ -145,6 +145,9 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + # Declarative Flatpak Wrapper + flatpak.url = "github:gmodena/nix-flatpak"; + # Wine Apps Wrapper wine = { url = "github:emmanuelrosa/erosanix"; diff --git a/modules/README.md b/modules/README.md @@ -6,7 +6,7 @@ The `modules` directory contains custom-made pure Flakes-compatible configuratio - [`apps`](./apps): Module that configures various apps and/or environments - - - `list`: List of all enabled applications - `[ "discord" "firefox" "git" "office" "wine" ]` + - `list`: List of all enabled applications - `[ "discord" "firefox" "flatpak" "git" "office" "wine" ]` - `git` - - `hosting` - - `enable`: Enable Gitea Code Hosting - `true / false` diff --git a/modules/apps/flatpak.nix b/modules/apps/flatpak.nix @@ -0,0 +1,58 @@ +{ + config, + lib, + inputs, + ... +}: let + enable = builtins.elem "flatpak" config.apps.list; +in { + imports = [inputs.flatpak.nixosModules.nix-flatpak]; + + ## Flatpak Configuration ## + config = lib.mkIf enable { + warnings = [ + '' + Flatpak app install isn't Generational + - Changes in package declaration will result in downloading them anew + '' + ]; + + xdg.portal.enable = true; + environment.persist.directories = ["/var/lib/flatpak"]; + user.persist.directories = [".cache/flatpak" ".local/share/flatpak"]; + + services.flatpak = { + enable = true; + + # Repositories + remotes = [ + { + name = "flathub"; + location = "https://dl.flathub.org/repo/flathub.flatpakrepo"; + } + { + name = "flathub-beta"; + location = "https://flathub.org/beta-repo/flathub-beta.flatpakrepo"; + } + ]; + + # Package List + # Use `flatpak remote-info --log` to find commit revisions + packages = [ + /* + { + appId = ""; + origin = ""; + commit = ""; + } + */ + ]; + + # Package Updates + update = { + onActivation = false; + auto.enable = false; + }; + }; + }; +} diff --git a/modules/gui/desktop/gnome.nix b/modules/gui/desktop/gnome.nix @@ -137,6 +137,23 @@ in { }; }; + # Flatpak Apps + services.flatpak = mkIf config.services.flatpak.enable { + remotes = [ + { + name = "gnome-nightly"; + location = "https://nightly.gnome.org/gnome-nightly.flatpakrepo"; + } + ]; + + packages = [ + { + appId = "com.github.tchx84.Flatseal"; + origin = "flathub"; + } + ]; + }; + ## Color Scheme stylix = { base16Scheme = colors.adwaita;