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"); - }; -}