Enable system flatpak via nix-flatpak and simplify HM

This commit is contained in:
randogoth 2026-02-03 13:07:02 +02:00
parent b7e9e1a2c2
commit 83ea723834
7 changed files with 86 additions and 14 deletions

17
flake.lock generated
View file

@ -147,6 +147,22 @@
"url": "https://git.lix.systems/lix-project/nixos-module"
}
},
"nix-flatpak": {
"locked": {
"lastModified": 1767983141,
"narHash": "sha256-7ZCulYUD9RmJIDULTRkGLSW1faMpDlPKcbWJLYHoXcs=",
"owner": "gmodena",
"repo": "nix-flatpak",
"rev": "440818969ac2cbd77bfe025e884d0aa528991374",
"type": "github"
},
"original": {
"owner": "gmodena",
"ref": "latest",
"repo": "nix-flatpak",
"type": "github"
}
},
"nix-index-database": {
"inputs": {
"nixpkgs": [
@ -210,6 +226,7 @@
"inputs": {
"lanzaboote": "lanzaboote",
"lix-module": "lix-module",
"nix-flatpak": "nix-flatpak",
"nix-index-database": "nix-index-database",
"nixpkgs": "nixpkgs"
}

View file

@ -7,6 +7,7 @@
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=latest";
lix-module.url = "git+https://git.lix.systems/lix-project/nixos-module?ref=release-2.93";
lix-module.inputs.nixpkgs.follows = "nixpkgs";
lanzaboote.url = "github:nix-community/lanzaboote";

View file

@ -4,6 +4,8 @@
imports = [
inputs.lix-module.nixosModules.lixFromNixpkgs
inputs.nix-index-database.nixosModules.nix-index
inputs.nix-flatpak.nixosModules.nix-flatpak
../modules/system/flatpak.nix
../modules/system/base.nix
../modules/system/packages.nix
../modules/system/shell.nix

View file

@ -0,0 +1,25 @@
{ lib, ... }:
{
services.flatpak = {
enable = true;
remotes = [
{
name = "flathub";
location = "https://dl.flathub.org/repo/flathub.flatpakrepo";
}
{
name = "flathub-beta";
location = "https://dl.flathub.org/beta-repo/flathub-beta.flatpakrepo";
}
];
update.auto = {
enable = true;
onCalendar = "daily";
};
packages = [
"com.github.tchx84.Flatseal"
"io.github.kolunmi.Bazaar"
];
};
}

View file

@ -6,6 +6,7 @@
pkgs.distrobox
pkgs.distroshelf
pkgs.fastfetch
pkgs.flatpak
pkgs.ghostty
pkgs.git
pkgs.home-manager

View file

@ -7,12 +7,19 @@
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, home-manager, ... }: {
homeConfigurations."admin" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [ ./home.nix ];
nix-flatpak = {
url = "github:gmodena/nix-flatpak/?ref=latest";
inputs.nixpkgs.follows = "nixpkgs";
};
};
}
outputs = { nixpkgs, home-manager, nix-flatpak, ... }: {
homeConfigurations."admin" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [
nix-flatpak.homeManagerModules.nix-flatpak
./home.nix
];
};
};
}

View file

@ -1,4 +1,9 @@
{ config, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
home.username = "admin";
@ -7,6 +12,17 @@
nixpkgs.config.allowUnfree = true;
# User-level flatpaks
services.flatpak = {
enable = true;
packages = [ ];
update = {
auto.enable = true;
auto.onCalendar = "weekly";
onActivation = false;
};
};
programs = {
distrobox = {
enable = true;
@ -49,27 +65,27 @@
home.packages = with pkgs; [
# decibels # default GNOME audio player
gnome-calendar # default GNOME calendar
gnome-calendar # default GNOME calendar
# gnome-contacts # default GNOME contacts
firefox # Mozilla web browser
firefox # Mozilla web browser
# google-chrome # web browser from Google
# chromium # open source web browser from Google
# brave # privacy oriented web browser
# opera # fast alternative web browser
# vivaldi # powerful and personal web browser
thunderbird # full-featured Mozilla e-mail client
thunderbird # full-featured Mozilla e-mail client
# geary # default GNOME email client
ptyxis # container aware GNOME terminal
ptyxis # container aware GNOME terminal
# alacritty # GPU accelerated terminal emulator
# kitty # GPU accelerated terminal emulator
jetbrains-toolbox # fresh versions of Android Studio and other tools
jetbrains-toolbox # fresh versions of Android Studio and other tools
# devpod # open-source code spaces
pods # Podman desktop application
pods # Podman desktop application
];
@ -99,6 +115,9 @@
DEFAULT_TERMINAL = "${pkgs.ghostty}/bin/ghostty";
EDITOR = "${pkgs.micro}/bin/micro";
DBX_CONTAINER_HOME_PREFIX = "$HOME/distrobox";
XDG_DATA_DIRS =
"${config.home.profileDirectory}/share:${config.xdg.dataHome}/applications:"
+ "${config.xdg.dataHome}/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share";
};
}