Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
appaquet committed Sep 27, 2024
1 parent ed212be commit 3abbf1b
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "secrets"]
path = secrets
url = ./secrets
url = [email protected]:appaquet/dotfiles-secrets.git
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 12 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
inherit pkgs;
modules = [ ./home-manager/deskapp.nix ] ++ commonHomeModules;
extraSpecialArgs = {
inherit inputs unstablePkgs secrets;
inherit inputs unstablePkgs;
secrets = secrets.init "deskapp";
cfg = cfg // {
isNixos = true;
};
Expand All @@ -113,7 +114,8 @@
inherit pkgs;
modules = [ ./home-manager/nixapp.nix ] ++ commonHomeModules;
extraSpecialArgs = {
inherit inputs unstablePkgs secrets;
inherit inputs unstablePkgs;
secrets = secrets.init "nixapp";
cfg = cfg // {
isNixos = true;
};
Expand All @@ -124,15 +126,17 @@
inherit pkgs;
modules = [ ./home-manager/servapp.nix ] ++ commonHomeModules;
extraSpecialArgs = {
inherit inputs unstablePkgs cfg secrets;
inherit inputs unstablePkgs cfg;
secrets = secrets.init "servapp";
};
};

"appaquet@mbpapp" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ./home-manager/mbpapp.nix ] ++ commonHomeModules;
extraSpecialArgs = {
inherit inputs unstablePkgs cfg secrets;
inherit inputs unstablePkgs cfg;
secrets = secrets.init "mbapp";
};
};
};
Expand Down Expand Up @@ -166,7 +170,8 @@
nixapp = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit (self) common;
inherit inputs secrets;
inherit inputs;
secrets = secrets.init "nixapp";
};
modules = [
nixosOverlaysModule
Expand All @@ -177,7 +182,8 @@
deskapp = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit (self) common;
inherit inputs secrets;
inherit inputs;
secrets = secrets.init "deskapp";
};
modules = [
nixosOverlaysModule
Expand Down
13 changes: 8 additions & 5 deletions home-manager/modules/base.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;

home.packages = with pkgs; [
home.packages = (with pkgs; [
manix # nix doc cli searcher
nix-output-monitor # better nix build output (nom)
nixpkgs-fmt
Expand Down Expand Up @@ -64,14 +64,17 @@

curl
wget
socat

tealdeer # rust version of tldr
unstablePkgs.aichat # cli llm tool

rsync
rclone
]
++ lib.optionals stdenv.isLinux [
libtree # recursive ldd
])
++ (with unstablePkgs; [
aichat # cli llm tool
])
++ lib.optionals pkgs.stdenv.isLinux [
pkgs.libtree # recursive ldd
];
}
6 changes: 3 additions & 3 deletions home-manager/modules/dev.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ in
secrets.homeManager.dev
];

home.packages = with pkgs; [
home.packages = (with pkgs; [
tokei

dive # docker container explorer
Expand All @@ -28,8 +28,8 @@ in

gnumake
bintools # ld, objdump, etc.
] ++ lib.optionals pkgs.stdenv.isLinux [
mold-wrapped
]) ++ lib.optionals pkgs.stdenv.isLinux [
pkgs.mold-wrapped
];

home.file.".cargo/config.toml".text = cargoConfig;
Expand Down
24 changes: 10 additions & 14 deletions home-manager/modules/fish.nix
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,17 @@
llt = "ll -t"; # sort by time
lls = "ll -S"; # sort by size

nr = "nix run nixpkgs#(fzf-nix)";
ns = "nix shell nixpkgs#(fzf-nix)";
nr = {
expansion = "nix run nixpkgs#%";
setCursor = true;
};
ns = {
expansion = "nix shell nixpkgs#%";
setCursor = true;
};
nrf = "nix run nixpkgs#(fzf-nix)";
nsf = "nix shell nixpkgs#(fzf-nix)";

# TODO: Fix it with cursor since need quotes most of the time. See https://github.com/fish-shell/fish-shell/pull/9313
# https://github.com/nix-community/home-manager/blob/master/modules/programs/fish.nix#L170
ai = {
expansion = "aichat \"%\"";
setCursor = true;
Expand All @@ -93,16 +99,6 @@
};

functions = {
# Reload fish with latest paths from nix.
# If not working, make sure that fish_user_paths are correctly set as explained in the README.
reload = ''
set CLEAR (which clear)
set -e PATH
set -e __HM_SESS_VARS_SOURCED
$CLEAR
~/.nix-profile/bin/fish
'';

# ripgrep & open files in vim
vimrg = ''
vim -c "Rg $argv"
Expand Down
2 changes: 1 addition & 1 deletion home-manager/modules/git/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
gca = "git commit --amend";
gr = "git rev-parse --short=7 @";
grc = "GIT_EDITOR=true git rebase --continue";
gri = "git rebase -i --committer-date-is-author-date";
gri = "git rebase -i --committer-date-is-author-date --autostash";
grs = "git restore --staged";
grsw = "git restore --staged --worktree";
grws = "git restore --staged --worktree";
Expand Down
2 changes: 1 addition & 1 deletion home-manager/modules/tmux/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ pkgs, ... }:

let
# See https://stackoverflow.com/questions/53658303/fetchfromgithub-filter-down-and-use-as-environment-etc-file-source
Expand Down
1 change: 0 additions & 1 deletion nixos/deskapp/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
interface = "eno1";
lanIp = "192.168.0.30";
};

networking.hosts = {
"100.109.193.77" = [ "localhost.humanfirst.ai" ];
};
Expand Down
2 changes: 1 addition & 1 deletion nixos/deskapp/virt/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ inputs, config, pkgs, ... }:
{ inputs, ... }:

{
imports = [
Expand Down
3 changes: 2 additions & 1 deletion nixos/dev.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
inputs.vscode-server.nixosModule
];

environment.systemPackages = with pkgs; [
environment.systemPackages = (with pkgs; [
distrobox
]) ++ [
config.boot.kernelPackages.perf # perf, aligned with current kernel version
];

Expand Down
1 change: 0 additions & 1 deletion nixos/network_bridge.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,4 @@ in
networking.defaultGateway = cfg.lanGateway;
networking.nameservers = cfg.lanNameservers;
};

}
2 changes: 1 addition & 1 deletion secrets
3 changes: 2 additions & 1 deletion shells/backend/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@

nodejs
yarn
jemalloc

python3
(poetry.override { python3 = python310; })
Expand All @@ -67,7 +68,7 @@
# https://github.com/NixOS/nixpkgs/issues/18995
hardeningDisable = [ "fortify" ];

NIX_LD_LIBRARY_PATH = with pkgs; pkgs.lib.makeLibraryPath [
NIX_LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [
stdenv.cc.cc
clang
llvmPackages.libclang
Expand Down
2 changes: 1 addition & 1 deletion shells/exomind/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
openssl
];

NIX_LD_LIBRARY_PATH = with pkgs; pkgs.lib.makeLibraryPath [
NIX_LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [
stdenv.cc.cc
clang
llvmPackages.libclang
Expand Down

0 comments on commit 3abbf1b

Please sign in to comment.