Skip to content

Commit

Permalink
Merge pull request #15 from SuperSandro2000/misc
Browse files Browse the repository at this point in the history
Apply statix+deadnix
  • Loading branch information
gmodena authored Nov 14, 2023
2 parents 981dc59 + 19de8d2 commit 56f257d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
description = "Manage flatpak apps declaratively.";

outputs = { self, ... }:
outputs = _:
{
nixosModules = { nix-flatpak = import ./modules/nixos.nix; };
homeManagerModules = { nix-flatpak = import ./modules/home-manager.nix; };
Expand Down
8 changes: 4 additions & 4 deletions modules/home-manager.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let
in
{

options.services.flatpak = (import ./options.nix { inherit cfg lib pkgs; })
options.services.flatpak = (import ./options.nix { inherit lib pkgs; })
// {
enable = with lib; mkOption {
type = types.bool;
Expand All @@ -14,7 +14,7 @@ in
};
};

config = lib.mkIf (config.services.flatpak.enable) {
config = lib.mkIf config.services.flatpak.enable {
systemd.user.services."flatpak-managed-install" = {
Unit = {
After = [
Expand All @@ -28,15 +28,15 @@ in
};
Service = {
Type = "oneshot";
ExecStart = "${import ./installer.nix {inherit cfg pkgs lib; installation = installation; }}";
ExecStart = import ./installer.nix { inherit cfg pkgs lib installation; };
};
};

systemd.user.timers."flatpak-managed-install" = lib.mkIf config.services.flatpak.update.auto.enable {
Unit.Description = "flatpak update schedule";
Timer = {
Unit = "flatpak-managed-install";
OnCalendar = "${config.services.flatpak.update.auto.onCalendar}";
OnCalendar = config.services.flatpak.update.auto.onCalendar;
Persistent = "true";
};
Install.WantedBy = [ "timers.target" ];
Expand Down
6 changes: 3 additions & 3 deletions modules/nixos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let
installation = "system";
in
{
options.services.flatpak = import ./options.nix { inherit cfg lib pkgs; };
options.services.flatpak = import ./options.nix { inherit lib pkgs; };

config = lib.mkIf config.services.flatpak.enable {
systemd.services."flatpak-managed-install" = {
Expand All @@ -16,13 +16,13 @@ in
];
serviceConfig = {
Type = "oneshot";
ExecStart = "${import ./installer.nix {inherit cfg pkgs lib; installation = installation; }}";
ExecStart = import ./installer.nix { inherit cfg pkgs lib installation; };
};
};
systemd.timers."flatpak-managed-install" = lib.mkIf config.services.flatpak.update.auto.enable {
timerConfig = {
Unit = "flatpak-managed-install";
OnCalendar = "${config.services.flatpak.update.auto.onCalendar}";
OnCalendar = config.services.flatpak.update.auto.onCalendar;
Persistent = "true";
};
wantedBy = [ "timers.target" ];
Expand Down
12 changes: 5 additions & 7 deletions modules/options.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{ cfg, lib, pkgs, ... }:
{ lib, ... }:
with lib;
let
cfg = config.services.flatpak;

remoteOptions = { cfg, ... }: {
remoteOptions = _: {
options = {
name = mkOption {
type = types.str;
Expand All @@ -24,7 +22,7 @@ let
};
};

packageOptions = { cfg, ... }: {
packageOptions = _: {
options = {
appId = mkOption {
type = types.str;
Expand All @@ -45,7 +43,7 @@ let
};
};

updateOptions = { cfg, ... }: {
updateOptions = _: {
options = {
onActivation = mkOption {
type = types.bool;
Expand All @@ -59,7 +57,7 @@ let
'';
};
auto = mkOption {
type = with types; submodule ({ cfg, ... }: {
type = with types; submodule (_: {
options = {
enable = mkOption {
type = types.bool;
Expand Down

0 comments on commit 56f257d

Please sign in to comment.