mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-10 23:00:39 +02:00
feat: restructure user common files, allow selecting "minimal" set of options for vms
This commit is contained in:
parent
d842d25eb9
commit
e2ba02234a
16 changed files with 87 additions and 74 deletions
2
flake.lock
generated
2
flake.lock
generated
|
@ -258,7 +258,7 @@
|
|||
},
|
||||
"locked": {
|
||||
"lastModified": 1682972682,
|
||||
"narHash": "sha256-+XyTwr4jZuDlT5l/0LynDVtvdWj8WmAwDEP/2rZ+1hk=",
|
||||
"narHash": "sha256-QuwwK2R4dAXTnM/MLwufUZOip8//H8G7i4ivS7YsP08=",
|
||||
"type": "git",
|
||||
"url": "file:///root/projects/microvm.nix"
|
||||
},
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
../../../../users/root
|
||||
];
|
||||
|
||||
home-manager.users.root.home.minimal = true;
|
||||
|
||||
systemd.network.networks = {
|
||||
"10-wan" = {
|
||||
# TODO
|
||||
|
|
|
@ -1,70 +1,14 @@
|
|||
{pkgs, ...}: {
|
||||
imports = [
|
||||
./modules/uid.nix
|
||||
./modules/minimal.nix
|
||||
|
||||
#./btop.nix
|
||||
#./fish.nix
|
||||
./git.nix
|
||||
./htop.nix
|
||||
./neovim
|
||||
./nushell.nix
|
||||
#./ssh.nix
|
||||
./starship.nix
|
||||
#./tmux.nix
|
||||
#./xdg.nix
|
||||
./zsh
|
||||
./shell
|
||||
./utils.nix
|
||||
];
|
||||
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
bandwhich
|
||||
btop
|
||||
fd
|
||||
file
|
||||
neofetch
|
||||
rclone
|
||||
ripgrep
|
||||
rnr
|
||||
rsync
|
||||
sd
|
||||
tree
|
||||
rage
|
||||
];
|
||||
|
||||
shellAliases = {
|
||||
l = "ls -lahF --group-directories-first --show-control-chars --quoting-style=escape --color=auto";
|
||||
t = "tree -F --dirsfirst -L 2";
|
||||
tt = "tree -F --dirsfirst -L 3 --filelimit 16";
|
||||
cpr = "rsync -axHAWXS --numeric-ids --info=progress2";
|
||||
|
||||
md = "mkdir";
|
||||
rmd = "rm --one-file-system -d";
|
||||
cp = "cp -vi";
|
||||
mv = "mv -vi";
|
||||
rm = "rm --one-file-system -I";
|
||||
chmod = "chmod -c --preserve-root";
|
||||
chown = "chown -c --preserve-root";
|
||||
|
||||
ip = "ip --color";
|
||||
tmux = "tmux -2";
|
||||
rg = "rg -S";
|
||||
|
||||
zf = "zathura --fork";
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
atuin = {
|
||||
enable = true;
|
||||
settings.auto_sync = false;
|
||||
};
|
||||
bat = {
|
||||
enable = true;
|
||||
config.theme = "base16";
|
||||
};
|
||||
fzf.enable = true;
|
||||
gpg.enable = true;
|
||||
};
|
||||
|
||||
xdg.configFile."nixpkgs/config.nix".text = "{ allowUnfree = true; }";
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
{lib, ...}: {
|
||||
# TODO use git-fuzzy.
|
||||
# TODO integrate git-fuzzy and difft
|
||||
programs.gitui.enable = true;
|
||||
programs.git = {
|
||||
enable = true;
|
||||
|
|
5
users/common/modules/minimal.nix
Normal file
5
users/common/modules/minimal.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{lib, ...}: {
|
||||
options = {
|
||||
home.minimal = lib.mkEnableOption "minimal setup only (e.g. for virtual machines)";
|
||||
};
|
||||
}
|
|
@ -1,21 +1,22 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
programs = {
|
||||
neovim = {
|
||||
enable = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
vimdiffAlias = true;
|
||||
withPython3 = true;
|
||||
extraPython3Packages = pyPkgs: with pyPkgs; [openai];
|
||||
withNodeJs = true;
|
||||
defaultEditor = true;
|
||||
};
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
vimdiffAlias = true;
|
||||
withPython3 = true;
|
||||
extraPython3Packages = pyPkgs: with pyPkgs; [openai];
|
||||
withNodeJs = true;
|
||||
defaultEditor = true;
|
||||
};
|
||||
xdg.configFile = lib.mkIf (!config.home.minimal) {
|
||||
"nvim/lua".source = ./lua;
|
||||
"nvim/init.lua".source = ./init.lua;
|
||||
};
|
||||
xdg.configFile."nvim/lua".source = ./lua;
|
||||
xdg.configFile."nvim/init.lua".source = ./init.lua;
|
||||
home.packages = with pkgs; [gcc shellcheck stylua];
|
||||
}
|
||||
|
|
31
users/common/shell/default.nix
Normal file
31
users/common/shell/default.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{pkgs, ...}: {
|
||||
imports = [
|
||||
./nushell.nix
|
||||
./starship.nix
|
||||
./zsh
|
||||
];
|
||||
|
||||
home.shellAliases = {
|
||||
l = "ls -lahF --group-directories-first --show-control-chars --quoting-style=escape --color=auto";
|
||||
t = "tree -F --dirsfirst -L 2";
|
||||
tt = "tree -F --dirsfirst -L 3 --filelimit 16";
|
||||
cpr = "rsync -axHAWXS --numeric-ids --info=progress2";
|
||||
|
||||
md = "mkdir";
|
||||
rmd = "rm --one-file-system -d";
|
||||
cp = "cp -vi";
|
||||
mv = "mv -vi";
|
||||
rm = "rm --one-file-system -I";
|
||||
chmod = "chmod -c --preserve-root";
|
||||
chown = "chown -c --preserve-root";
|
||||
|
||||
ip = "ip --color";
|
||||
tmux = "tmux -2";
|
||||
rg = "rg -S";
|
||||
};
|
||||
|
||||
programs.atuin = {
|
||||
enable = true;
|
||||
settings.auto_sync = false;
|
||||
};
|
||||
}
|
27
users/common/utils.nix
Normal file
27
users/common/utils.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{pkgs, ...}: {
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
bandwhich
|
||||
btop
|
||||
fd
|
||||
file
|
||||
neofetch
|
||||
rclone
|
||||
ripgrep
|
||||
rnr
|
||||
rsync
|
||||
sd
|
||||
tree
|
||||
rage
|
||||
];
|
||||
};
|
||||
|
||||
programs = {
|
||||
bat = {
|
||||
enable = true;
|
||||
config.theme = "base16";
|
||||
};
|
||||
fzf.enable = true;
|
||||
gpg.enable = true;
|
||||
};
|
||||
}
|
|
@ -24,7 +24,7 @@ in {
|
|||
home-manager.users.${myuser} = {
|
||||
imports = [
|
||||
#impermanence.home-manager.impermanence
|
||||
../common
|
||||
../common/core
|
||||
./dev.nix
|
||||
./gpg.nix
|
||||
./ssh.nix
|
||||
|
@ -36,6 +36,7 @@ in {
|
|||
username = config.users.users.${myuser}.name;
|
||||
shellAliases = {
|
||||
p = "cd ~/projects";
|
||||
zf = "zathura --fork";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue