Skip to content

Commit

Permalink
refactor: Still working on massive update [WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
Lehmanator committed Mar 12, 2024
1 parent 3beebad commit 5a914f4
Show file tree
Hide file tree
Showing 50 changed files with 861 additions and 408 deletions.
14 changes: 7 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
};
};
flake = {
homeConfigurations."sam@minimal" = home.lib.homeManagerConfiguration {
pkgs = nixpkgs;
modules = [
#./users/sam
];
extraSpecialArgs = { inherit inputs; };
};
#homeConfigurations."sam@minimal" = home.lib.homeManagerConfiguration {
# pkgs = nixpkgs;
# modules = [
# #./users/sam
# ];
# extraSpecialArgs = { inherit inputs; };
#};
nixosConfigurations =
let user = "sam";
in {
Expand Down
1 change: 1 addition & 0 deletions nix/android/packages/activitywatch-android.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ androidenv, activitywatch, aw-server-rust, lib, stdenv, fetchFromGitHub, }:
androidenv.buildApp rec {
name = "activitywatch-android";
pname = "activitywatch-android";
version = "0.12.1";

Expand Down
8 changes: 6 additions & 2 deletions nix/android/pops.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{inputs, cell}@commonArgs:
{ inputs, cell, }@commonArgs:
inputs.omnibusStd.mkBlocks.pops commonArgs {
packages = {src = ./packages; };
#configs = {src = ./configs; };
#devshellProfiles = {src = ./devshellProfiles; };
#nixosProfiles = {src = ./nixosProfiles; };
packages = { src = ./packages; };
#shells = {src = ./shells; };
}
1 change: 1 addition & 0 deletions nix/hive/devshellSuites.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{inputs,cell}: cell.pops.devshellSuites.exports.default
6 changes: 6 additions & 0 deletions nix/hive/devshellSuites/test.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{ inputs, config, lib, pkgs, ... }: {
imports = [
inputs.cell.devshellProfiles.benchmarking
inputs.cell.devshellProfiles.normalize
];
}
1 change: 1 addition & 0 deletions nix/hive/diskoSuites.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ inputs, cell, }@commonArgs: cell.pops.diskoSuites.exports.default
6 changes: 6 additions & 0 deletions nix/hive/diskoSuites/test.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{ inputs, config, lib, pkgs, ... }: {
imports = [
inputs.cell.diskoProfiles.btrfs-luks.nix
inputs.cell.diskoProfiles.tmpfs-root
];
}
1 change: 1 addition & 0 deletions nix/hive/hardwareProfiles.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{inputs,cell}: cell.pops.hardwareProfiles.exports.default
1 change: 1 addition & 0 deletions nix/hive/hardwareSuites.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ inputs, cell, }@commonArgs: cell.pops.hardwareSuites.exports.default
3 changes: 3 additions & 0 deletions nix/hive/hardwareSuites/test.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{ inputs, config, lib, pkgs, ... }: {
imports = [ inputs.cell.hardwareProfiles.disk-nvme ];
}
11 changes: 1 addition & 10 deletions nix/hive/homeConfigurations.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
{ inputs, cell, }@commonArgs:
cell.pops.homeConfigurations.exports.default
#let
# inherit (inputs.haumea.lib) load loaders matchers transformers;
#in
# load {
# src = ./homeConfigurations;
# loader = loaders.verbatim;
# transformer = transformers.liftDefaults;
# }
{inputs,cell}@commonArgs: cell.pops.homeConfigurations.exports.default
24 changes: 24 additions & 0 deletions nix/hive/homeConfigurations/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,27 @@ homeConfigurations = {
};
};
```

File: `../homeConfigurations.nix`

- Old:

```(nix)
{ inputs, cell, }@commonArgs:
#let
# inherit (inputs.haumea.lib) load loaders matchers transformers;
#in
# load {
# src = ./homeConfigurations;
# loader = loaders.verbatim;
# transformer = transformers.liftDefaults;
# }
```
- New:
```(nix)
{inputs,cell}: cell.pops.homeConfigurations.exports.default
```
13 changes: 13 additions & 0 deletions nix/hive/homeConfigurations/sam/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{ inputs, cell, }@commonArgs:
let
inherit (inputs.home-manager.lib) homeManagerConfiguration;
user = builtins.toString ./.;
in
homeManagerConfiguration {
pkgs = inputs.nixpkgs;
modules = [
inputs.cells.hive.homeSuites.developer-default
(inputs.self + /users/${user})
];
extraSpecialArgs = { inherit inputs cell user; };
}
10 changes: 1 addition & 9 deletions nix/hive/homeModules.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
{ inputs, cell, }: cell.pops.homeModules.exports.default
#let
# inherit (inputs.haumea.lib) load loaders matchers transformers;
#in
# load {
# src = ./homeModules;
# loader = loaders.verbatim;
# transformer = transformers.liftDefaults;
# }
{ inputs, cell, }@commonArgs: cell.pops.homeModules.exports.default
22 changes: 22 additions & 0 deletions nix/hive/homeModules/debug.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ config, lib, pkgs, ... }@args:
let
inherit (args) config lib;
inherit (lib) concatStringsSep mkEnableOption mkIf;
cfg = config.debug;
in
{
imports = [ ];

options.debug = { enable = mkEnableOption "NixOS Debugging"; };

config = mkIf cfg.enable {
xdg.configFile = {
# TODO: Figure out how to pretty-print tree of attrs.
# TODO: Figure out how to restrict attrset depth.
"nix/debug/module-args.txt".text =
concatStringsSep "\n" (builtins.attrNames args);
"nix/debug/flake-inputs.txt".text =
concatStringsSep "\n" (builtins.attrNames args.inputs);
};
};
}
11 changes: 1 addition & 10 deletions nix/hive/homeProfiles/git/diff.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
{ inputs
, config
, lib
, pkgs
, ...
}:
{ inputs , config , lib , pkgs , ... }:
{
imports = [
];

programs.git.delta = {
enable = true;
#options = {
Expand All @@ -20,5 +12,4 @@
# whitespace-error-style = "22 reverse";
#};
};

}
14 changes: 6 additions & 8 deletions nix/hive/homeProfiles/role-developer.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{ inputs
, config
, lib
, pkgs
, ...
}:
{
imports = [ ../../git ];
{ inputs, cell, config, lib, pkgs, ... }: {
imports = [
#cell.homeProfiles.
#../../git
#../../../users/sam/git
];
home.packages = [
#pkgs.nur.repos.federicoschonborn.devtoolbox # Multiple developer tools in one GTK4 app (Broken 9/23: pkgs.python310.daltonlens (v0.1.5) miss setuptools_git)
#pkgs.nur.repos.federicoschonborn.atoms # Easily manage Linux chroots & containers
Expand Down
139 changes: 77 additions & 62 deletions nix/hive/homeProfiles/rust-utils.nix
Original file line number Diff line number Diff line change
@@ -1,79 +1,94 @@
{config, lib, pkgs, prefix ? false, ...}:
{ config, lib, pkgs, prefix ? false, ... }:
#
# https://github.com/TaKO8Ki/awesome-alternatives-in-rust
# https://gist.github.com/sts10/daadbc2f403bdffad1b6d33aff016c0a
# https://lib.rs/command-line-utilities
#
let
swap-util = gu: ru: { home.shellAliases = {
${gu} = lib.getExe pkgs.${ru}); # Unprefixed set to rust version
rs-${gu} = lib.getExe pkgs.${ru}; # Prefixed alias of rust util
gnu-${gu} = lib.getExe' pkgs.coreutils-prefixed gu; # Prefixes old coreutil
}; };
util-swap = gu: ru: let inherit (lib.attrsets) nameValuePair; in [
(nameValuePair gu (lib.getExe ru))
(nameValuePair "gnu-${gu}" (lib.getExe' pkgs.coreutils-prefixed gu))
(nameValuePair "rs-${gu}" (lib.getExe ru))
];

swap-util = gu: ru: {
home.shellAliases = {
"${gu}" = lib.getExe pkgs.${ru}; # Unprefixed set to rust version
"rs-${gu}" = lib.getExe pkgs.${ru}; # Prefixed alias of rust util
"gnu-${gu}" =
lib.getExe' pkgs.coreutils-prefixed gu; # Prefixes old coreutil
};
};
util-swap = gu: ru:
let inherit (lib.attrsets) nameValuePair;
in [
(nameValuePair gu (lib.getExe ru))
(nameValuePair "gnu-${gu}" (lib.getExe' pkgs.coreutils-prefixed gu))
(nameValuePair "rs-${gu}" (lib.getExe ru))
];
in
{
home = {
packages = [
pkgs.dog # DNS client
pkgs.fselect # SQL-like queries for files.
pkgs.dog # DNS client
pkgs.fselect # SQL-like queries for files.
pkgs.git-cliff # Changelog generator following Conventional Commit spec
pkgs.gsv # CSV tool
pkgs.hexyl # Hex viewer
pkgs.htmlq # jq for HTML
pkgs.gsv # CSV tool
pkgs.hexyl # Hex viewer
pkgs.htmlq # jq for HTML
pkgs.miniserve # Webserver
pkgs.monolith # Webpage saver to single HTML file
pkgs.pastel # Gen, analyze, convert, & manip colors
pkgs.pipr # Interactive pipe viewer
pkgs.skim # Fuzzy finder
pkgs.topgrade # Update everything
pkgs.xh # HTTP request util
] ++ lib.optional !prefix pkgs.coreutils-prefixed # Prefix GNU coreutils if uutils w/ no prefix
++ lib.optional !prefix pkgs.uutils-coreutils-noprefix # No prefix uutils
++ lib.optional prefix pkgs.uutils-coreutils # Prefixed uutils
pkgs.monolith # Webpage saver to single HTML file
pkgs.pastel # Gen, analyze, convert, & manip colors
pkgs.pipr # Interactive pipe viewer
pkgs.skim # Fuzzy finder
pkgs.topgrade # Update everything
pkgs.xh # HTTP request util
] ++ (if prefix then
[ pkgs.uutils-coreutils ]
else [
pkgs.uutils-coreutils-noprefix
pkgs.coreutils-prefixed
])
#++ lib.optional !prefix pkgs.coreutils-prefixed # Prefix GNU coreutils if uutils w/ no prefix
#++ lib.optional !prefix pkgs.uutils-coreutils-noprefix # No prefix uutils
#++ lib.optional prefix pkgs.uutils-coreutils # Prefixed uutils
;
shellAliases = with lib.attrsets; mapAttrs' (n: v: nameValuePair "rs-${n}" (b v)) {
awk = pkgs.frawk;
bot = pkgs.bottom;
cp = pkgs.xcp; #cp = uutil "cp" "--progress";
cut = pkgs.hck;
df = pkgs.lfs;
delt = pkgs.delta; # Really nice diff util
diff = pkgs.difftastic; # Also really nice diff util
ducttape = pkgs.dt; # Duct tape for your unix pipelines # TODO: Make aliases w this
du = pkgs.du-dust; gnu-du#pkgs.du-tree;
dupes = pkgs.fclones; #pkgs.fclones-gui;
http = pkgs.xh;
ps = pkgs.procs;
refact = pkgs.fastmod;
rm = [ pkgs.rip "--graveyard ${config.xdg.dataHome}/Trash" ];
rn = pkgs.rnr;
sed = pkgs.sad; #pkgs.sd;
sysctl = pkgs.systeroid; # More powerful sysctl tool
system-info = pkgs.macchina; # Like neofetch but in Rust
time = pkgs.hyperfine; # Benchmark util
top = pkgs.bottom;
uniq = pkgs.huniq;
watche = pkgs.watchexec;
xargs = pkgs.rargs;
#tmux = pkgs.zellij;
shellAliases = with lib.attrsets;
mapAttrs' (n: v: nameValuePair "rs-${n}" (b v))
{
awk = pkgs.frawk;
bot = pkgs.bottom;
cp = pkgs.xcp; # cp = uutil "cp" "--progress";
cut = pkgs.hck;
df = pkgs.lfs;
delt = pkgs.delta; # Really nice diff util
diff = pkgs.difftastic; # Also really nice diff util
ducttape =
pkgs.dt; # Duct tape for your unix pipelines # TODO: Make aliases w this
du = pkgs.du-dust;
#gnu-du = #pkgs.du-tree;
dupes = pkgs.fclones; # pkgs.fclones-gui;
http = pkgs.xh;
ps = pkgs.procs;
refact = pkgs.fastmod;
rm = [ pkgs.rip "--graveyard ${config.xdg.dataHome}/Trash" ];
rn = pkgs.rnr;
sed = pkgs.sad; # pkgs.sd;
sysctl = pkgs.systeroid; # More powerful sysctl tool
system-info = pkgs.macchina; # Like neofetch but in Rust
time = pkgs.hyperfine; # Benchmark util
top = pkgs.bottom;
uniq = pkgs.huniq;
watche = pkgs.watchexec;
xargs = pkgs.rargs;
#tmux = pkgs.zellij;

# Count lines of code & show stats
loc = pkgs.tokei;
} // {
# Count lines of code & show stats
loc = pkgs.tokei;
} // {
# Move in Rust w/ progress bar
mv = (lib.getExe' pkgs.uutils-coreutils "mv") "--progress";

# Move in Rust w/ progress bar
mv = (lib.getExe' pkgs.uutils-coreutils "mv") "--progress";

# skim - Interactive Grep
# https://github.com/lotabout/skim
# TODO: Move skim to separate config
rgi = "${lib.getExe pkgs.skim} --ansi -i -c '${lib.getExe config.programs.ripgrep.package} --color=always --line-number {}'";
};
# skim - Interactive Grep
# https://github.com/lotabout/skim
# TODO: Move skim to separate config
rgi = "${lib.getExe pkgs.skim} --ansi -i -c '${
lib.getExe config.programs.ripgrep.package
} --color=always --line-number {}'";
};
};
}
38 changes: 19 additions & 19 deletions nix/hive/homeProfiles/shell-base.nix
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{ inputs, config, lib, pkgs, ... }: {
{ inputs, cell, config, lib, pkgs, ... }: {
imports = [
#inputs.home-extra-xhmm.homeManagerModules.console.program-variables
#inputs.home-extra-xhmm.homeManagerModules.console.fish
inputs.self.homeProfiles.abook
inputs.self.homeProfiles.bat
inputs.self.homeProfiles.direnv
inputs.self.homeProfiles.documentation
inputs.self.homeProfiles.fetchers
inputs.self.homeProfiles.fzf
inputs.self.homeProfiles.ls
inputs.self.homeProfiles.navi
inputs.self.homeProfiles.nushell
inputs.self.homeProfiles.ripgrep
inputs.self.homeProfiles.starship
inputs.self.homeProfiles.shell-aliases
inputs.self.homeProfiles.tmux
inputs.self.homeProfiles.zsh
cell.homeProfiles.abook
cell.homeProfiles.bat
cell.homeProfiles.direnv
cell.homeProfiles.documentation
cell.homeProfiles.fetchers
cell.homeProfiles.fzf
cell.homeProfiles.ls
cell.homeProfiles.navi
cell.homeProfiles.nushell
cell.homeProfiles.ripgrep
cell.homeProfiles.starship
cell.homeProfiles.shell-aliases
cell.homeProfiles.tmux
cell.homeProfiles.zsh

#inputs.self.homeProfiles.bash
#inputs.self.homeProfiles.fish
#inputs.self.homeProfiles.readline
#inputs.self.homeProfiles.shell-colors
#cell.homeProfiles.bash
#cell.homeProfiles.fish
#cell.homeProfiles.readline
#cell.homeProfiles.shell-colors
];

programs.bash = {
Expand Down
Loading

0 comments on commit 5a914f4

Please sign in to comment.