1
1
Fork 1
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:
oddlama 2023-05-08 18:03:29 +02:00
parent d842d25eb9
commit e2ba02234a
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
16 changed files with 87 additions and 74 deletions

2
flake.lock generated
View file

@ -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"
},

View file

@ -13,6 +13,8 @@
../../../../users/root
];
home-manager.users.root.home.minimal = true;
systemd.network.networks = {
"10-wan" = {
# TODO

View file

@ -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; }";
}

View file

@ -1,4 +1,6 @@
{lib, ...}: {
# TODO use git-fuzzy.
# TODO integrate git-fuzzy and difft
programs.gitui.enable = true;
programs.git = {
enable = true;

View file

@ -0,0 +1,5 @@
{lib, ...}: {
options = {
home.minimal = lib.mkEnableOption "minimal setup only (e.g. for virtual machines)";
};
}

View file

@ -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];
}

View 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
View 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;
};
}

View file

@ -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";
};
};
};