Skip to content

Commit

Permalink
home-manager/cli: add enableGnu option
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Nov 28, 2023
1 parent c1206dc commit 71c9904
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
(mkHomeConfig {
hostname = "steamdeck";
username = "deck";
extraModules = [{ home-manager.editor.emacs.enable = true; }];
extraModules = [{ home-manager.cli.enableGnu = false; }];
})
(mkHomeConfig {
hostname = "home-macos";
Expand Down
34 changes: 21 additions & 13 deletions home-manager/cli/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{ config, pkgs, lib, ... }:

let
cfg = config.home-manager.cli;
in
{
imports = [
./git.nix
Expand All @@ -12,35 +15,31 @@
./zsh.nix
];

options.home-manager.cli.enable = lib.mkDefaultOption "CLI config";
options.home-manager.cli = {
enable = lib.mkDefaultOption "CLI config";
enableGnu = lib.mkEnableOption "GNU utils config" // {
default = !pkgs.stdenv.isDarwin;
};
};

config = lib.mkIf config.home-manager.cli.enable {
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
_7zz
aria2
bc
bind.dnsutils
coreutils
curl
curlie
dialog
diffutils
dos2unix
dua
each
file
findutils
gawk
gnugrep
gnumake
gnused
inetutils
ix
jq
less
lsof
mediainfo
netcat-gnu
ouch
page
procps
Expand All @@ -52,8 +51,17 @@
tig
tokei
wget
] ++ lib.optionals (!pkgs.stdenv.isDarwin) [
] ++ lib.optionals cfg.enableGnu [
coreutils
diffutils
findutils
gawk
gcal
gnugrep
gnumake
gnused
inetutils
netcat-gnu
];

programs = {
Expand All @@ -66,7 +74,7 @@
archive = "${pkgs.ouch}/bin/ouch compress";
unarchive = "${pkgs.ouch}/bin/ouch decompress";
lsarchive = "${pkgs.ouch}/bin/ouch list";
cal = lib.mkIf (!pkgs.stdenv.isDarwin) "${pkgs.gcal}/bin/gcal";
cal = lib.mkIf cfg.enableGnu "${pkgs.gcal}/bin/gcal";
http = "${pkgs.curlie}/bin/curlie";
ncdu = "${pkgs.dua}/bin/dua interactive";
sloccount = "${pkgs.tokei}/bin/tokei";
Expand Down

0 comments on commit 71c9904

Please sign in to comment.