Skip to content

Commit

Permalink
refactor: removed unused pkgs and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Wittano committed Feb 22, 2024
1 parent d21ce4f commit 68c7268
Show file tree
Hide file tree
Showing 31 changed files with 56 additions and 56 deletions.
6 changes: 3 additions & 3 deletions modules/desktop/apps/dunst.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{ pkgs, home-manager, lib, dotfiles, cfg, ... }:
with lib;
with lib.my;
with lib.my.mapper;
let
catppuccinDunstConfig = mapDirToAttrs (pkgs.fetchFromGitHub {
catppuccinDunstConfig = mapper.mapDirToAttrs (pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "dunst";
rev = "b0b838d38f134136322ad3df2b6dc57c4ca118cf";
sha256 = "sha256-ruFcHh1dkd4Zy9qNlAA8qAksTzNjXPd2hSSmhdGgflU=";
});
in {
in
{
home-manager.users.wittano.services.dunst = {
enable = true;
configFile = catppuccinDunstConfig.src."macchiato.conf".source;
Expand Down
1 change: 1 addition & 0 deletions modules/desktop/apps/gtk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ in
link.createMutableLinkActivation cfg "gtk-3.0/settings.ini";
};

# TODO create mapper attrs to TOML file
xdg.configFile = mkIf (cfg.enableDevMode == false) {
"gtk-3.0/bookmarks".text = ''
file:///tmp Temporary
Expand Down
3 changes: 2 additions & 1 deletion modules/desktop/apps/picom.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ pkgs, lib, cfg, ... }:
with lib;
with lib.my; {
with lib.my;
{
services.picom = {
enable = true;
package = pkgs.picom-allusive;
Expand Down
1 change: 0 additions & 1 deletion modules/desktop/apps/polybar.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ pkgs, lib, home-manager, dotfiles, cfg, ... }:
with lib;
with lib.my;
with builtins;
{
fonts.packages = with pkgs; [ font-awesome font-awesome_5 siji ];

Expand Down
3 changes: 0 additions & 3 deletions modules/desktop/apps/postman.nix

This file was deleted.

2 changes: 1 addition & 1 deletion modules/desktop/apps/ranger.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ with lib.my; {
packages = with pkgs; [ ranger ];

# It's required cause ranger doesn't allow non-writeable config (27.12.2023)
activation.copyRangerConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
activation.copyRangerConfig = hm.dag.entryAfter [ "writeBoundary" ] ''
${pkgs.coreutils}/bin/cp -r ${dotfiles.ranger.source} /home/wittano/.config
${pkgs.coreutils}/bin/chmod -R 755 /home/wittano/.config/ranger
Expand Down
1 change: 1 addition & 0 deletions modules/desktop/apps/switchOff.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ pkgs, lib, config, ... }:
# TODO Migarte to pkgs directory
let
kill = "${pkgs.toybox}/bin/kill";
pgrep = "${pkgs.toybox}/bin/pgrep";
Expand Down
3 changes: 0 additions & 3 deletions modules/desktop/apps/zeal.nix

This file was deleted.

2 changes: 1 addition & 1 deletion modules/dev/dotnet.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ in
{
environment.variables.DOTNET_CLI_TELEMETRY_OPTOUT = "0";

home-manager.users.wittano.home.packages = with pkgs; [ dotnet-sdk mono jetbrains.rider ];
home-manager.users.wittano.home.packages = with pkgs; [ jetbrains.rider ];
}
]);
}
4 changes: 2 additions & 2 deletions modules/dev/python.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ in
ppythonCommand
{
home-manager.users.wittano = {
home.packages = with pkgs; [ python3 pipenv poetry jetbrains.pycharm-professional ];
home.packages = with pkgs; [ jetbrains.pycharm-professional ];

programs.fish.shellAliases.tpy =
programs.fish.shellAliases.tpython =
"${pkgs.nixFlakes}/bin/nix flake init --template github:nix-community/poetry2nix";
};
}
Expand Down
4 changes: 1 addition & 3 deletions modules/editors/emacs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
with lib;
with lib.my;
let
inherit (lib) mkEnableOption mkOption mkIf types;

cfg = config.modules.editors.emacs;
downloadDoomEmacsScript = ''
if [ ! -e $HOME/.emacs.d/bin/doom ]; then
Expand Down Expand Up @@ -43,7 +41,7 @@ in
linkMutableDoomEmacsConfiguration = mkIf (cfg.version == "doom")
(link.createMutableLinkActivation cfg ".doom.d");
downloadDoomEmacs = mkIf (cfg.version == "doom")
(lib.hm.dag.entryAfter [ "writeBoundery" ] downloadDoomEmacsScript);
(hm.dag.entryAfter [ "writeBoundery" ] downloadDoomEmacsScript);
};

file.".doom.d" =
Expand Down
4 changes: 2 additions & 2 deletions modules/hardware/bluetooth.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ config, pkgs, lib, ... }:
with lib;
with lib.my;
let
inherit (lib) mkIf mkEnableOption;

cfg = config.modules.hardware.bluetooth;
in {
options = {
Expand Down
4 changes: 2 additions & 2 deletions modules/hardware/bootloader.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ config, pkgs, lib, ... }:
with lib;
with lib.my;
let
inherit (lib) mkIf mkEnableOption;

cfg = config.modules.hardware.grub;
in {
options = {
Expand Down
1 change: 1 addition & 0 deletions modules/hardware/nvidia.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ config, pkgs, lib, home-manager, ... }:
with lib;
with lib.my;
let
cfg = config.modules.hardware.nvidia;
in
Expand Down
4 changes: 2 additions & 2 deletions modules/hardware/sound.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ config, pkgs, lib, ... }:
with lib;
with lib.my;
let
inherit (lib) mkIf mkEnableOption mkDefault mkOption types;

cfg = config.modules.hardware.sound;
in {
options = {
Expand Down
1 change: 1 addition & 0 deletions modules/hardware/wacom.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ config, pkgs, lib, home-manager, ... }:
with lib;
with lib.my;
let
cfg = config.modules.hardware.wacom;
dependecies = strings.makeBinPath (with pkgs;[ xf86_input_wacom gawk ]);
Expand Down
2 changes: 1 addition & 1 deletion modules/hardware/wifi.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ config, pkgs, lib, ... }:
with lib;
with builtins;
with lib.my;
let
cfg = config.modules.hardware.wifi;
kernel = config.boot.kernelPackages.kernel;
Expand Down
2 changes: 1 addition & 1 deletion modules/services/autoUpgrade.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ pkgs, lib, config, home-manager, hostname, ... }:
with lib;
with builtins;
with lib.my;
let
cfg = config.modules.services.autoUpgrade;
workingDirectory = config.environment.variables.NIX_DOTFILES;
Expand Down
4 changes: 2 additions & 2 deletions modules/services/backup.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ config, pkgs, lib, ... }:
with lib;
with lib.my;
let
inherit (lib) mkEnableOption types mkIf mkOption;

cfg = config.modules.services.backup;

excludedList = builtins.toFile "exclude.txt" ''
Expand Down
1 change: 1 addition & 0 deletions modules/services/boinc.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ config, pkgs, lib, ... }:
with lib;
with lib.my;
let
cfg = config.modules.services.boinc;
nvidiaDriverPackage = lists.optionals
Expand Down
4 changes: 2 additions & 2 deletions modules/services/filebot.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ config, pkgs, lib, ... }:
with lib;
with lib.my;
let
inherit (lib) mkEnableOption mkIf;

cfg = config.modules.services.filebot;
in
{
Expand Down
14 changes: 8 additions & 6 deletions modules/services/flatpak.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{ config, pkgs, lib, ... }:
with lib;
with lib.my;
let
inherit (lib) mkEnableOption mkIf;

cfg = config.modules.services.flatpak;
in {
in
{
options = {
modules.services.flatpak = { enable = mkEnableOption "Enable flatpak"; };
modules.services.flatpak = {
enable = mkEnableOption "Enable flatpak";
};
};

config = mkIf cfg.enable {
services.flatpak.enable = true;
xdg.portal = {
enable = true;
extraPortals =
lib.mkIf (config.services.xserver.desktopManager.gnome.enable == false)
extraPortals = mkIf (config.services.xserver.desktopManager.gnome.enable == false)
[ pkgs.xdg-desktop-portal-gtk ];
config.common.default = "*";
};
Expand Down
2 changes: 1 addition & 1 deletion modules/services/kubernetes.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ pkgs, lib, config, home-manager, ... }:
with lib;
with builtins;
with lib.my;
let
cfg = config.modules.services.kubernetes;
ipAddress = (head config.networking.interfaces.eno1.ipv4.addresses).address;
Expand Down
2 changes: 1 addition & 1 deletion modules/services/polkit.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ pkgs, lib, config, ... }:
with lib;
with builtins;
with lib.my;
let
cfg = config.modules.services.polkit;
in
Expand Down
5 changes: 2 additions & 3 deletions modules/services/prometheus.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{ config, lib, pkgs, ... }:

with lib;
with lib.my;
let
inherit (lib) mkEnableOption mkIf;

cfg = config.modules.services.prometheus;
in
{
Expand Down
7 changes: 5 additions & 2 deletions modules/services/redshift.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{ config, pkgs, lib, ... }:
with lib;
let cfg = config.modules.services.redshift;
in {
with lib.my;
let
cfg = config.modules.services.redshift;
in
{
options = {
modules.services.redshift = {
enable = mkEnableOption ''
Expand Down
4 changes: 2 additions & 2 deletions modules/services/ssh.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ config, pkgs, lib, ... }:
with lib;
with lib.my;
let
inherit (lib) mkEnableOption mkIf;

cfg = config.modules.services.ssh;
in {
options = {
Expand Down
1 change: 1 addition & 0 deletions modules/services/syncthing.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ config, pkgs, lib, home-manager, ... }:
with lib;
with lib.my;
let
homeDir = "/home/wittano";
cfg = config.modules.services.syncthing;
Expand Down
8 changes: 4 additions & 4 deletions modules/themes/dracula.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{ config, pkgs, ... }:
with pkgs;
{ config, lib, pkgs, ... }:
with lib;
with lib.my;
let
cfg = config.modules.themes.dracula;
draculaOpenbox = fetchFromGitHub {
draculaOpenbox = pkgs.fetchFromGitHub {
owner = "dracula";
repo = "openbox";
rev = "b3222509bb291dc62d201a66a1547a7aac0040b3";
sha256 = "sha256-GZ6/ThHBP3TZshDPHdsNjQEpqowt4eqva0MI/mzELRg=";
};
draculaIcon = fetchzip {
draculaIcon = pkgs.fetchzip {
url = "https://github.com/dracula/gtk/files/5214870/Dracula.zip";
sha256 = "sha256-rcSKlgI3bxdh4INdebijKElqbmAfTwO+oEt6M2D1ls0=";
};
Expand Down
4 changes: 2 additions & 2 deletions modules/themes/gruvbox.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ config, pkgs, ... }:
with pkgs;
{ config, lib, pkgs, ... }:
with lib;
with lib.my;
let cfg = config.modules.themes.gruvbox;
in {
options = {
Expand Down
8 changes: 3 additions & 5 deletions modules/utils.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ config, pkgs, lib, home-manager, privateRepo, ... }:
{ config, lib, privateRepo, ... }:
with lib;
with lib.my;
let cfg = config.modules.utils;
in {
options = {
Expand All @@ -14,9 +15,6 @@ in {
};

config = mkIf cfg.enable {
home-manager.users.wittano.home.packages = mkIf (cfg.enable) ([ ]);

environment.systemPackages =
mkIf (cfg.enableGlobalUtils) ([ privateRepo.patcherDir ]);
environment.systemPackages = mkIf (cfg.enableGlobalUtils) ([ privateRepo.patcherDir ]);
};
}

0 comments on commit 68c7268

Please sign in to comment.