mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-11 07:10: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": {
|
"locked": {
|
||||||
"lastModified": 1682972682,
|
"lastModified": 1682972682,
|
||||||
"narHash": "sha256-+XyTwr4jZuDlT5l/0LynDVtvdWj8WmAwDEP/2rZ+1hk=",
|
"narHash": "sha256-QuwwK2R4dAXTnM/MLwufUZOip8//H8G7i4ivS7YsP08=",
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "file:///root/projects/microvm.nix"
|
"url": "file:///root/projects/microvm.nix"
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
../../../../users/root
|
../../../../users/root
|
||||||
];
|
];
|
||||||
|
|
||||||
|
home-manager.users.root.home.minimal = true;
|
||||||
|
|
||||||
systemd.network.networks = {
|
systemd.network.networks = {
|
||||||
"10-wan" = {
|
"10-wan" = {
|
||||||
# TODO
|
# TODO
|
||||||
|
|
|
@ -1,70 +1,14 @@
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
imports = [
|
imports = [
|
||||||
./modules/uid.nix
|
./modules/uid.nix
|
||||||
|
./modules/minimal.nix
|
||||||
|
|
||||||
#./btop.nix
|
|
||||||
#./fish.nix
|
|
||||||
./git.nix
|
./git.nix
|
||||||
./htop.nix
|
./htop.nix
|
||||||
./neovim
|
./neovim
|
||||||
./nushell.nix
|
./shell
|
||||||
#./ssh.nix
|
./utils.nix
|
||||||
./starship.nix
|
|
||||||
#./tmux.nix
|
|
||||||
#./xdg.nix
|
|
||||||
./zsh
|
|
||||||
];
|
];
|
||||||
|
|
||||||
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; }";
|
xdg.configFile."nixpkgs/config.nix".text = "{ allowUnfree = true; }";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{lib, ...}: {
|
{lib, ...}: {
|
||||||
|
# TODO use git-fuzzy.
|
||||||
|
# TODO integrate git-fuzzy and difft
|
||||||
programs.gitui.enable = true;
|
programs.gitui.enable = true;
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
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,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
programs = {
|
programs.neovim = {
|
||||||
neovim = {
|
enable = true;
|
||||||
enable = true;
|
viAlias = true;
|
||||||
viAlias = true;
|
vimAlias = true;
|
||||||
vimAlias = true;
|
vimdiffAlias = true;
|
||||||
vimdiffAlias = true;
|
withPython3 = true;
|
||||||
withPython3 = true;
|
extraPython3Packages = pyPkgs: with pyPkgs; [openai];
|
||||||
extraPython3Packages = pyPkgs: with pyPkgs; [openai];
|
withNodeJs = true;
|
||||||
withNodeJs = true;
|
defaultEditor = 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];
|
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} = {
|
home-manager.users.${myuser} = {
|
||||||
imports = [
|
imports = [
|
||||||
#impermanence.home-manager.impermanence
|
#impermanence.home-manager.impermanence
|
||||||
../common
|
../common/core
|
||||||
./dev.nix
|
./dev.nix
|
||||||
./gpg.nix
|
./gpg.nix
|
||||||
./ssh.nix
|
./ssh.nix
|
||||||
|
@ -36,6 +36,7 @@ in {
|
||||||
username = config.users.users.${myuser}.name;
|
username = config.users.users.${myuser}.name;
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
p = "cd ~/projects";
|
p = "cd ~/projects";
|
||||||
|
zf = "zathura --fork";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue