From 7f02443960b18bcb614c937542afb293a9fdd94f Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sat, 2 Mar 2024 09:31:39 -0500 Subject: [PATCH] moved flatpak config to desktop/default.nix --- desktop/default.nix | 37 ++++++++++++++++++++++++++++++++++++- flake.nix | 22 +++++++++------------- flatpak/default.nix | 39 --------------------------------------- 3 files changed, 45 insertions(+), 53 deletions(-) delete mode 100644 flatpak/default.nix diff --git a/desktop/default.nix b/desktop/default.nix index 7dd54587..dc18178d 100644 --- a/desktop/default.nix +++ b/desktop/default.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: { - # Enable the X11 windowing system. + ## Enable the X11 windowing system. services.xserver.enable = true; services.xserver.excludePackages = with pkgs; [ xterm @@ -12,4 +12,39 @@ layout = "us"; 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"); + }; } diff --git a/flake.nix b/flake.nix index dd114fa4..f7009bc2 100644 --- a/flake.nix +++ b/flake.nix @@ -27,22 +27,21 @@ ./hosts/rustboro ./system ./users/aly.nix - ./flatpak ./desktop/gnome ./programs/podman ./programs/steam ./programs/via-qmk + # Add managed flatpak module. 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` - home-manager.nixosModules.home-manager - { + + # Add home-manager nixos module so home-manager config deploys on nixos-rebuild. + home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; 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.nixosModules.lenovo-thinkpad-t440p ]; @@ -55,23 +54,20 @@ ./hosts/petalburg ./system ./users/aly.nix - ./flatpak ./desktop/gnome ./programs/podman ./programs/steam ./programs/via-qmk + # Add managed flatpak module. 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` - home-manager.nixosModules.home-manager - { + + # Add home-manager nixos module so home-manager config deploys on nixos-rebuild. + home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.aly = import ./home/aly; - # Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix } - ]; }; }; diff --git a/flatpak/default.nix b/flatpak/default.nix deleted file mode 100644 index 257c91a0..00000000 --- a/flatpak/default.nix +++ /dev/null @@ -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"); - }; -}