diff --git a/flake.lock b/flake.lock index 605e500..8972dd7 100644 --- a/flake.lock +++ b/flake.lock @@ -20,6 +20,22 @@ "type": "github" } }, + "nix-flatpak": { + "locked": { + "lastModified": 1708268179, + "narHash": "sha256-NNVuhf84AeDTxadfSGnFqPHR0ED+QyM2gmu+Wyz6PrY=", + "owner": "gmodena", + "repo": "nix-flatpak", + "rev": "a243cb0522f6240c194b873dde68e25370b06034", + "type": "github" + }, + "original": { + "owner": "gmodena", + "ref": "v0.3.0", + "repo": "nix-flatpak", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1708118438, @@ -39,6 +55,7 @@ "root": { "inputs": { "home-manager": "home-manager", + "nix-flatpak": "nix-flatpak", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index d2b2be9..4a295a8 100644 --- a/flake.nix +++ b/flake.nix @@ -12,12 +12,15 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; + + nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.3.0"; }; outputs = inputs@{ self, nixpkgs, home-manager, + nix-flatpak, ... }: { nixosConfigurations = { @@ -26,7 +29,6 @@ modules = [ ./hosts/nixos-test - home-manager.nixosModules.home-manager (import ./home/common-home-manager.nix { inherit inputs; }) ]; @@ -37,7 +39,6 @@ modules = [ ./hosts/perso-laptop - home-manager.nixosModules.home-manager (import ./home/common-home-manager.nix { inherit inputs; }) ]; @@ -48,7 +49,6 @@ modules = [ ./hosts/perso-desktop - home-manager.nixosModules.home-manager (import ./home/common-home-manager.nix { inherit inputs; }) ]; diff --git a/home/default.nix b/home/default.nix index e1ebc5a..e9f41af 100644 --- a/home/default.nix +++ b/home/default.nix @@ -7,7 +7,7 @@ # ./programs/vscode.nix ./programs/mise.nix ./programs/chromium.nix -# ./programs/discord.nix + ./programs/flatpak.nix # ./programs/skype.nix # ./programs/slack.nix # ./programs/thunderbird.nix diff --git a/home/programs/flatpak.nix b/home/programs/flatpak.nix new file mode 100644 index 0000000..b9b580d --- /dev/null +++ b/home/programs/flatpak.nix @@ -0,0 +1,16 @@ +{ config, pkgs, nix-flatpak, ... }: + +{ + imports = [ nix-flatpak.homeManagerModules.nix-flatpak ]; + + services.flatpak = { + enable = true; + + uninstallUnmanagedPackages = true; + + packages = [ + { appId = "com.discordapp.Discord"; origin = "flathub"; } + { appId = "com.valvesoftware.Steam"; origin = "flathub"; } + ]; + }; +} diff --git a/modules/system.nix b/modules/system.nix index 157f10f..9e6334b 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -35,6 +35,8 @@ packages = with pkgs; [nixd]; }; + services.flatpak.enable = true; + # Enable CUPS to print documents. services.printing.enable = true;