diff options
Diffstat (limited to 'modules/profiles')
-rw-r--r-- | modules/profiles/default.nix | 7 | ||||
-rw-r--r-- | modules/profiles/dev/containers.nix | 7 | ||||
-rw-r--r-- | modules/profiles/dev/default.nix | 7 | ||||
-rw-r--r-- | modules/profiles/dev/sql.nix | 11 | ||||
-rw-r--r-- | modules/profiles/email.nix | 26 | ||||
-rw-r--r-- | modules/profiles/headful.nix | 24 |
6 files changed, 39 insertions, 43 deletions
diff --git a/modules/profiles/default.nix b/modules/profiles/default.nix index 34093d0..cbfb665 100644 --- a/modules/profiles/default.nix +++ b/modules/profiles/default.nix @@ -5,20 +5,19 @@ this, ... }: -with lib; let cfg = config.nixfiles.modules.profiles.default; in { - imports = attrValues (modulesIn ./.); + imports = lib.modulesIn ./. |> lib.attrValues; options.nixfiles.modules.profiles.default.enable = - mkEnableOption "The most default profile of them all." + lib.mkEnableOption "The most default profile of them all." // { default = true; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { assertions = [ { assertion = !(with this; isHeadless && isHeadful); diff --git a/modules/profiles/dev/containers.nix b/modules/profiles/dev/containers.nix index 598289c..ce686b5 100644 --- a/modules/profiles/dev/containers.nix +++ b/modules/profiles/dev/containers.nix @@ -4,18 +4,17 @@ pkgs, ... }: -with lib; let cfg = config.nixfiles.modules.profiles.dev.containers; in { options.nixfiles.modules.profiles.dev.containers.enable = - mkEnableOption "Tools for working with containers and container orchestration" + lib.mkEnableOption "Tools for working with containers and container orchestration" // { default = config.nixfiles.modules.profiles.dev.enable; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { nixfiles.modules = { common.shell.aliases = { h = "helm"; @@ -63,7 +62,7 @@ in ]; }; - xdg.dataFile."minikube/config/config.json".text = generators.toJSON { } { + xdg.dataFile."minikube/config/config.json".text = lib.generators.toJSON { } { config.Rootless = true; driver = "podman"; container-runtime = "cri-o"; diff --git a/modules/profiles/dev/default.nix b/modules/profiles/dev/default.nix index a6cc61d..89ed7a3 100644 --- a/modules/profiles/dev/default.nix +++ b/modules/profiles/dev/default.nix @@ -4,17 +4,16 @@ pkgs, ... }: -with lib; let cfg = config.nixfiles.modules.profiles.dev; in { - imports = attrValues (modulesIn ./.); + imports = lib.modulesIn ./. |> lib.attrValues; options.nixfiles.modules.profiles.dev.enable = - mkEnableOption "Catch-all profile for stuff related to software development and etc."; + lib.mkEnableOption "Catch-all profile for stuff related to software development and etc."; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { nixfiles.modules = { common.nix.allowedUnfreePackages = [ "terraform" # source-available diff --git a/modules/profiles/dev/sql.nix b/modules/profiles/dev/sql.nix index c2d4894..cbab14a 100644 --- a/modules/profiles/dev/sql.nix +++ b/modules/profiles/dev/sql.nix @@ -4,18 +4,17 @@ pkgs, ... }: -with lib; let cfg = config.nixfiles.modules.profiles.dev.sql; in { options.nixfiles.modules.profiles.dev.sql.enable = - mkEnableOption "SQL stuff and database management tools" + lib.mkEnableOption "SQL stuff and database management tools" // { default = config.nixfiles.modules.profiles.dev.enable; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { hm = { home.packages = with pkgs; [ pgcli @@ -63,15 +62,15 @@ in { name, custom }: { "${name}/config" = { - text = generators.toINI { } { + text = lib.generators.toINI { } { main = mainSection // custom; - colors = mapAttrs (_: v: "'${v}'") colorsSection; + colors = lib.mapAttrs (_: v: "'${v}'") colorsSection; }; }; }; in { - configFile = mkMerge ( + configFile = lib.mkMerge ( map mkCliConfig [ { name = "pgcli"; diff --git a/modules/profiles/email.nix b/modules/profiles/email.nix index 4c8d6eb..5f142dc 100644 --- a/modules/profiles/email.nix +++ b/modules/profiles/email.nix @@ -5,16 +5,15 @@ this, ... }: -with lib; let cfg = config.nixfiles.modules.profiles.email; in { - options.nixfiles.modules.profiles.email.enable = mkEnableOption "Local Email management" // { + options.nixfiles.modules.profiles.email.enable = lib.mkEnableOption "Local Email management" // { default = this.isHeadful; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { nixfiles.modules.gnupg.enable = true; hm = { @@ -25,7 +24,7 @@ in let mkAccount = attrs: - mkMerge [ + lib.mkMerge [ { mbsync = { enable = true; @@ -52,15 +51,15 @@ in line ? 0, }: assert (builtins.isInt line); - concatStringsSep " " ( + lib.concatStringsSep " " ( [ - (getExe config.hm.programs.password-store.package) + (lib.getExe config.hm.programs.password-store.package) "show" path ] - ++ optionals (line > 0) [ + ++ lib.optionals (line > 0) [ "|" - (getExe pkgs.gnused) + (lib.getExe pkgs.gnused) "-e" "'${toString line}!d'" ] @@ -68,22 +67,23 @@ in in { shire = mkAccount rec { - address = my.email; + address = lib.my.email; aliases = [ address "frodo@rohan.net" "azahi@shire.net" ]; - realName = my.fullname; + realName = lib.my.fullname; signature = { showSignature = "append"; text = '' - Please consider using plain text when replying! - ~ https://useplaintext.email/#etiquette ~ + Firstname Lastname | Азат Багавиев + frodo@gondor.net | frodo@rohan.net + https://azahi.cc/ ''; }; gpg = { - inherit (my.pgp) key; + inherit (lib.my.pgp) key; signByDefault = false; encryptByDefault = false; }; diff --git a/modules/profiles/headful.nix b/modules/profiles/headful.nix index e328691..62a036c 100644 --- a/modules/profiles/headful.nix +++ b/modules/profiles/headful.nix @@ -6,31 +6,29 @@ this, ... }: -with lib; let cfg = config.nixfiles.modules.profiles.headful; in { - options.nixfiles.modules.profiles.headful.enable = mkEnableOption "headful profile" // { + options.nixfiles.modules.profiles.headful.enable = lib.mkEnableOption "headful profile" // { default = this.isHeadful; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { nixfiles.modules = { common.xdg.defaultApplications."org.telegram.desktop" = [ "x-scheme-handler/tg" ]; profiles.dev.enable = true; - alacritty.enable = mkDefault true; + alacritty.enable = true; aria2.enable = true; bat.enable = true; chromium.enable = true; - dwm.enable = mkDefault false; emacs.enable = true; eza.enable = true; firefox.enable = true; - foot.enable = mkDefault true; - kde.enable = mkDefault true; + foot.enable = true; + kde.enable = true; mpv.enable = true; nullmailer.enable = true; openssh.client.enable = true; @@ -38,8 +36,8 @@ in sound.enable = true; thunderbird.enable = true; vscode.enable = true; - wayland.enable = mkDefault true; - x11.enable = mkDefault true; + wayland.enable = true; + x11.enable = true; zathura.enable = true; }; @@ -57,6 +55,8 @@ in anki audacity ayugram-desktop + bitwarden-cli + bitwarden-desktop byedpi eaglemode easyeffects @@ -87,7 +87,7 @@ in }; boot = { - kernelPackages = mkDefault ( + kernelPackages = lib.mkDefault ( if config.boot.zfs.enabled then pkgs.linuxKernel.packages |> lib.filterAttrs ( @@ -175,8 +175,8 @@ in system.extraDependencies = let collectFlakeInputs = - input: [ input ] ++ concatMap collectFlakeInputs (attrValues (input.inputs or { })); + input: [ input ] ++ (lib.attrValues (input.inputs or { }) |> lib.concatMap collectFlakeInputs); in - concatMap collectFlakeInputs (attrValues inputs); + lib.concatMap collectFlakeInputs (lib.attrValues inputs); }; } |