moved flatpak config to desktop/default.nix

This commit is contained in:
Aly Raffauf 2024-03-02 09:31:39 -05:00
parent c5e42be682
commit 7f02443960
3 changed files with 45 additions and 53 deletions

View file

@ -1,7 +1,7 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
# Enable the X11 windowing system. ## Enable the X11 windowing system.
services.xserver.enable = true; services.xserver.enable = true;
services.xserver.excludePackages = with pkgs; [ services.xserver.excludePackages = with pkgs; [
xterm xterm
@ -12,4 +12,39 @@
layout = "us"; layout = "us";
xkbVariant = ""; xkbVariant = "";
}; };
## Needed for Flatpaks
xdg.portal.enable = true;
services.flatpak.enable = true;
services.flatpak.packages = [
"org.mozilla.firefox"
];
# services.flatpak.overrides = {
# sockets = [
# "gpg-agent" # Expose GPG agent
# "pcsc" # Expose smart cards (i.e. YubiKey)
# ];
# "org.onlyoffice.desktopeditors".Context.sockets = ["x11"]; # No Wayland support
# };
fonts.fontDir.enable = true;
system.fsPackages = [ pkgs.bindfs ];
fileSystems = let
mkRoSymBind = path: {
device = path;
fsType = "fuse.bindfs";
options = [ "ro" "resolve-symlinks" "x-gvfs-hide" ];
};
aggregatedFonts = pkgs.buildEnv {
name = "system-fonts";
paths = config.fonts.packages;
pathsToLink = [ "/share/fonts" ];
};
in {
# Create an FHS mount to support flatpak host icons/fonts
"/usr/share/icons" = mkRoSymBind (config.system.path + "/share/icons");
"/usr/share/fonts" = mkRoSymBind (aggregatedFonts + "/share/fonts");
};
} }

View file

@ -27,22 +27,21 @@
./hosts/rustboro ./hosts/rustboro
./system ./system
./users/aly.nix ./users/aly.nix
./flatpak
./desktop/gnome ./desktop/gnome
./programs/podman ./programs/podman
./programs/steam ./programs/steam
./programs/via-qmk ./programs/via-qmk
# Add managed flatpak module.
nix-flatpak.nixosModules.nix-flatpak nix-flatpak.nixosModules.nix-flatpak
# make home-manager as a module of nixos
# so that home-manager configuration will be deployed automatically when executing `nixos-rebuild switch` # Add home-manager nixos module so home-manager config deploys on nixos-rebuild.
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager {
{
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.aly = import ./home/aly; home-manager.users.aly = import ./home/aly;
# Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix
} }
# nixos-hardware configuration for t440p # nixos-hardware configuration for t440p
nixos-hardware.nixosModules.lenovo-thinkpad-t440p nixos-hardware.nixosModules.lenovo-thinkpad-t440p
]; ];
@ -55,23 +54,20 @@
./hosts/petalburg ./hosts/petalburg
./system ./system
./users/aly.nix ./users/aly.nix
./flatpak
./desktop/gnome ./desktop/gnome
./programs/podman ./programs/podman
./programs/steam ./programs/steam
./programs/via-qmk ./programs/via-qmk
# Add managed flatpak module.
nix-flatpak.nixosModules.nix-flatpak nix-flatpak.nixosModules.nix-flatpak
# make home-manager as a module of nixos
# so that home-manager configuration will be deployed automatically when executing `nixos-rebuild switch` # Add home-manager nixos module so home-manager config deploys on nixos-rebuild.
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager {
{
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.aly = import ./home/aly; home-manager.users.aly = import ./home/aly;
# Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix
} }
]; ];
}; };
}; };

View file

@ -1,39 +0,0 @@
{ config, pkgs, ... }:
{
xdg.portal.enable = true;
services.flatpak.enable = true;
services.flatpak.packages = [
"org.mozilla.firefox"
];
services.flatpak.overrides = {
sockets = [
"gpg-agent" # Expose GPG agent
"pcsc" # Expose smart cards (i.e. YubiKey)
];
};
"org.onlyoffice.desktopeditors".Context.sockets = ["x11"]; # No Wayland support
};
fonts.fontDir.enable = true;
system.fsPackages = [ pkgs.bindfs ];
fileSystems = let
mkRoSymBind = path: {
device = path;
fsType = "fuse.bindfs";
options = [ "ro" "resolve-symlinks" "x-gvfs-hide" ];
};
aggregatedFonts = pkgs.buildEnv {
name = "system-fonts";
paths = config.fonts.packages;
pathsToLink = [ "/share/fonts" ];
};
in {
# Create an FHS mount to support flatpak host icons/fonts
"/usr/share/icons" = mkRoSymBind (config.system.path + "/share/icons");
"/usr/share/fonts" = mkRoSymBind (aggregatedFonts + "/share/fonts");
};
}