Help me install Flakpak

Yes,i followed the terminal commands from the wiki here :

But,still can’t install it.
Thanks !

Hey welcome to NixOS!

Maybe you could post any error message you are getting?

You did add services.flatpak.enable = true; to your config and rebuilt everything?

Got this error message,after this :

services.flatpak.enable: command not found

alright, but that is not a command in the terminal. You need to edit your “configuration.nix” file and add this line:

services.flatpak.enable = true; 

Sorry for the noob question,but how to do this?

Assuming your config file is in the default location: open /etc/nixos/configuration.nix with your favorite text editor and add anywhere the line that @APCodes suggested:

services.flatpak.enable = true;

Save the file and apply the changes by using sudo nixos-rebuild switch in a terminal.

Then, you will need to add a repository, for example, Flathub, using the following commands in a terminal:

$ flatpak remote-add --if-not-exists flathub
$ flatpak update

Finally, you can search and install programs:

$ flatpak search <app_name>
$ flatpak install <app_name>

I think the Manual section that you linked to in your original post explains it quite well.


That is a really great explanation, I have nothing to add it that :slight_smile:

1 Like

Big thanks,but i’m new linux user. :smiley:
Could you explain me with more details. :))
Specially i can’t open this file with text editor etc etc … sry im noob …
EDIT : I opened the configuration file,but when i tryed to save it.Got error message:

As a normal user you don’t have permission to write/change/save files in /etc/nixos . (That’s also what the error message tells you: “Check that you have write access to this file”.) For steps 2 and 6 of the following instructions you need either a) the root password you set during the installation of NixOS or b) your user password, if you chose to add the user as an administrator during the installation.

Open a terminal and use the following commands:

  1. cd /etc/nixos (to change directory)
  2. sudo nano configuration.nix and enter your password (to open the file with nano text editor)
  3. add services.flatpak.enable = true;
  4. press Ctrl+O and then Enter to save the file
  5. press Ctrl+X to exit nano
  6. sudo nixos-rebuild switch (to apply the changes)

Now follow the instructions from my previous post:

A word of advice though: as a general rule you shouldn’t just copy and paste any command you read on a random website if you don’t know what it actually does. (Of course this also includes me and you need to decide for yourself whether to trust me. :wink: )

Lastly, since you said you’re new to Linux in general, I would be hesitant to recommend using NixOS. If you feel like it’s too much to learn all at once, you might want to consider trying something like Fedora Silverblue first and then come back later when you feel more comfortable with using the command line. That being said, Linux in general and NixOS in particular are amazing. Welcome!


By the way, why do you want to use Flatpaks? It kind of defeats the purpose of the unique declarative approach of NixOS. The official nixpkgs software repository is the largest there is, and chances are you’ll find everything you need there. You can search for all available packages at .

1 Like