Update
@ -3,10 +3,10 @@ let variable = import ../variables.nix;
|
||||
in {
|
||||
|
||||
imports = [
|
||||
./themes/laptop.nix
|
||||
./system/laptop.nix
|
||||
./scripts/laptop.nix
|
||||
./apps/laptop.nix
|
||||
./themes/nixy.nix
|
||||
];
|
||||
|
||||
home = {
|
||||
@ -44,6 +44,7 @@ in {
|
||||
curl
|
||||
neovide
|
||||
wf-recorder
|
||||
glow
|
||||
|
||||
# Just cool
|
||||
peaclock
|
||||
|
39
home/scripts/heaven/default.nix
Normal file
@ -0,0 +1,39 @@
|
||||
{ pkgs, config, ... }:
|
||||
|
||||
let
|
||||
homedir = config.home.homeDirectory;
|
||||
|
||||
heaven-rebuild = pkgs.writeShellScriptBin "heaven-rebuild" ''
|
||||
sudo nixos-rebuild switch --flake ${homedir}/.config/nixos#heaven
|
||||
'';
|
||||
|
||||
heaven-upgrade = pkgs.writeShellScriptBin "heaven-upgrade" ''
|
||||
sudo nixos-rebuild switch --upgrade --flake ${homedir}/.config/nixos#heaven
|
||||
'';
|
||||
|
||||
heaven-update = pkgs.writeShellScriptBin "heaven-update" ''
|
||||
cd ${homedir}/.config/nixos && sudo nix flake update
|
||||
'';
|
||||
|
||||
heaven-gc = pkgs.writeShellScriptBin "heaven-gc" ''
|
||||
cd ${homedir}/.config/nixos && sudo nix-collect-garbage -d
|
||||
'';
|
||||
|
||||
heaven-cb = pkgs.writeShellScriptBin "heaven-cb" ''
|
||||
sudo /run/current-system/bin/switch-to-configuration boot
|
||||
'';
|
||||
|
||||
remote-rebuild = pkgs.writeShellScriptBin "remote-rebuild" ''
|
||||
ssh -t heaven "cd ~/.config/nixos && git pull && heaven-rebuild"
|
||||
'';
|
||||
|
||||
in {
|
||||
home.packages = with pkgs; [
|
||||
heaven-rebuild
|
||||
heaven-upgrade
|
||||
heaven-update
|
||||
heaven-gc
|
||||
heaven-cb
|
||||
remote-rebuild
|
||||
];
|
||||
}
|
@ -11,7 +11,6 @@
|
||||
./nerdfont_fzf
|
||||
./system
|
||||
./compress
|
||||
|
||||
./misc.nix
|
||||
./misc
|
||||
];
|
||||
}
|
||||
|
@ -26,31 +26,6 @@ let
|
||||
nixy-push = pkgs.writeShellScriptBin "nixy-push" ''
|
||||
cd ~/.config/nixos && git add . && git commit -m ''${1:-Update} && git push
|
||||
'';
|
||||
|
||||
heaven-rebuild = pkgs.writeShellScriptBin "heaven-rebuild" ''
|
||||
sudo nixos-rebuild switch --flake ${homedir}/.config/nixos#heaven
|
||||
'';
|
||||
|
||||
heaven-upgrade = pkgs.writeShellScriptBin "heaven-upgrade" ''
|
||||
sudo nixos-rebuild switch --upgrade --flake ${homedir}/.config/nixos#heaven
|
||||
'';
|
||||
|
||||
heaven-update = pkgs.writeShellScriptBin "heaven-update" ''
|
||||
cd ${homedir}/.config/nixos && sudo nix flake update
|
||||
'';
|
||||
|
||||
heaven-gc = pkgs.writeShellScriptBin "heaven-gc" ''
|
||||
cd ${homedir}/.config/nixos && sudo nix-collect-garbage -d
|
||||
'';
|
||||
|
||||
heaven-cb = pkgs.writeShellScriptBin "heaven-cb" ''
|
||||
sudo /run/current-system/bin/switch-to-configuration boot
|
||||
'';
|
||||
|
||||
remote-rebuild = pkgs.writeShellScriptBin "remote-rebuild" ''
|
||||
ssh -t heaven "cd ~/.config/nixos && git pull && heaven-rebuild"
|
||||
'';
|
||||
|
||||
in {
|
||||
home.packages = with pkgs; [
|
||||
nixy-rebuild
|
||||
@ -59,11 +34,5 @@ in {
|
||||
nixy-gc
|
||||
nixy-cb
|
||||
nixy-push
|
||||
heaven-rebuild
|
||||
heaven-upgrade
|
||||
heaven-update
|
||||
heaven-gc
|
||||
heaven-cb
|
||||
remote-rebuild
|
||||
];
|
||||
}
|
||||
|
@ -3,10 +3,10 @@ let variable = import ../variables.nix;
|
||||
in {
|
||||
|
||||
imports = [
|
||||
./themes/server.nix
|
||||
./system/server.nix
|
||||
./scripts/server.nix
|
||||
./apps/server.nix
|
||||
./themes/wip.nix
|
||||
];
|
||||
|
||||
home = {
|
||||
|
@ -4,9 +4,48 @@ in {
|
||||
enable = true;
|
||||
userName = variable.git.username;
|
||||
userEmail = variable.git.email;
|
||||
ignores = [
|
||||
".cache/"
|
||||
".DS_Store"
|
||||
".idea/"
|
||||
"*.swp"
|
||||
"*.elc"
|
||||
"auto-save-list"
|
||||
".direnv/"
|
||||
"node_modules"
|
||||
"result"
|
||||
"result-*"
|
||||
];
|
||||
extraConfig = {
|
||||
init.defaultBranch = "main";
|
||||
push.autoSetupRemote = true;
|
||||
};
|
||||
aliases = {
|
||||
essa = "push --force";
|
||||
co = "checkout";
|
||||
fuck = "commit --amend -m";
|
||||
c = "commit -m";
|
||||
ca = "commit -am";
|
||||
forgor = "commit --amend --no-edit";
|
||||
graph = "log --all --decorate --graph --oneline";
|
||||
oops = "checkout --";
|
||||
l = "log";
|
||||
r = "rebase";
|
||||
s = "status --short";
|
||||
ss = "status";
|
||||
d = "diff";
|
||||
ps = "!git push origin $(git rev-parse --abbrev-ref HEAD)";
|
||||
pl = "!git pull origin $(git rev-parse --abbrev-ref HEAD)";
|
||||
af = "!git add $(git ls-files -m -o --exclude-standard | sk -m)";
|
||||
st = "status";
|
||||
br = "branch";
|
||||
df = "!git hist | peco | awk '{print $2}' | xargs -I {} git diff {}^ {}";
|
||||
hist = ''
|
||||
log --pretty=format:"%Cgreen%h %Creset%cd %Cblue[%cn] %Creset%s%C(yellow)%d%C(reset)" --graph --date=relative --decorate --all'';
|
||||
llog = ''
|
||||
log --graph --name-status --pretty=format:"%C(red)%h %C(reset)(%cd) %C(green)%an %Creset%s %C(yellow)%d%Creset" --date=relative'';
|
||||
edit-unmerged =
|
||||
"!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; hx `f`";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
64
home/themes/heaven.nix
Normal file
@ -0,0 +1,64 @@
|
||||
{
|
||||
imports = [ ./config/template.nix ./config/load_colors.nix ];
|
||||
|
||||
theme = {
|
||||
wallpaper = "default.png";
|
||||
|
||||
font-mono = "FiraCode Nerd Font Mono";
|
||||
font = "SFProDisplay Nerd Font";
|
||||
|
||||
rounding = 12;
|
||||
gaps-in = 10;
|
||||
gaps-out = 20;
|
||||
border-size = 3;
|
||||
|
||||
neofetch = "nerdfetch";
|
||||
|
||||
waybar = {
|
||||
transparent = true;
|
||||
float = true;
|
||||
};
|
||||
|
||||
colors = {
|
||||
bg = "040409";
|
||||
fg = "FCFCFC";
|
||||
alt-bg = "101012";
|
||||
alt-fg = "ECECEC";
|
||||
|
||||
primary-ansi-16 = "red";
|
||||
primary-bg = "a158ff";
|
||||
primary-fg = "000000";
|
||||
|
||||
secondary-bg = "4928B8";
|
||||
secondary-fg = "000000";
|
||||
|
||||
# Black
|
||||
color0 = "000000";
|
||||
# Red
|
||||
color1 = "f7768e";
|
||||
# Green
|
||||
color2 = "73daca";
|
||||
# Yellow
|
||||
color3 = "e0af68";
|
||||
# Blue
|
||||
color4 = "7aa2f7";
|
||||
# Magenta
|
||||
color5 = "a158ff";
|
||||
# Cyan
|
||||
color6 = "7dcfff";
|
||||
# White
|
||||
color7 = "E4E5E7";
|
||||
|
||||
# Bright
|
||||
color8 = "515878";
|
||||
color9 = "f7869e";
|
||||
color10 = "83eada";
|
||||
color11 = "f0bf78";
|
||||
color12 = "8ab2f7";
|
||||
color13 = "A988F8";
|
||||
color14 = "8ddfff";
|
||||
color15 = "f4f5f7";
|
||||
};
|
||||
};
|
||||
|
||||
}
|
@ -1 +0,0 @@
|
||||
{ ... }: { imports = [ ./nixy.nix ./wallpapers ./config/load_colors.nix ]; }
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
imports = [ ./config/template.nix ];
|
||||
imports = [ ./config/template.nix ./config/load_colors.nix ];
|
||||
|
||||
theme = {
|
||||
wallpaper = "default.png";
|
||||
|
@ -1 +0,0 @@
|
||||
{ ... }: { imports = [ ./wip.nix ./config/load_colors.nix ]; }
|
Before Width: | Height: | Size: 3.7 MiB After Width: | Height: | Size: 3.7 MiB |
Before Width: | Height: | Size: 7.1 MiB After Width: | Height: | Size: 7.1 MiB |
Before Width: | Height: | Size: 3.6 MiB After Width: | Height: | Size: 3.6 MiB |
Before Width: | Height: | Size: 13 MiB After Width: | Height: | Size: 13 MiB |
Before Width: | Height: | Size: 826 KiB After Width: | Height: | Size: 826 KiB |
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 12 MiB After Width: | Height: | Size: 12 MiB |
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
Before Width: | Height: | Size: 378 KiB After Width: | Height: | Size: 378 KiB |
Before Width: | Height: | Size: 288 KiB After Width: | Height: | Size: 288 KiB |
Before Width: | Height: | Size: 641 KiB After Width: | Height: | Size: 641 KiB |
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 8.6 MiB After Width: | Height: | Size: 8.6 MiB |
@ -1,5 +1,5 @@
|
||||
{
|
||||
imports = [ ./config/template.nix ];
|
||||
imports = [ ./config/template.nix ./config/load_colors.nix ];
|
||||
|
||||
theme = {
|
||||
wallpaper = "Fuji-Light.png";
|
||||
|
@ -1,16 +1,17 @@
|
||||
{ pkgs, config, ... }:
|
||||
let
|
||||
variable = import ../../variables.nix;
|
||||
imports = [ ./hardware-configuration.nix ];
|
||||
# Weird variable name to avoid conflict with the `imports` variable...
|
||||
secondImports =
|
||||
if variable.enableNvidia then imports ++ [ ./nvidia.nix ] else imports;
|
||||
thirdImports = if variable.enablePrime then
|
||||
secondImports ++ [ ./prime.nix ]
|
||||
else
|
||||
secondImports;
|
||||
baseImports = [ ./hardware-configuration.nix ];
|
||||
|
||||
extraImports = [
|
||||
(if variable.enableNvidia then ./nvidia.nix else null)
|
||||
(if variable.enablePrime then ./prime.nix else null)
|
||||
];
|
||||
|
||||
filteredImports = builtins.filter (x: x != null) extraImports;
|
||||
|
||||
in {
|
||||
imports = thirdImports;
|
||||
imports = baseImports ++ filteredImports;
|
||||
|
||||
# Bootloader.
|
||||
boot = {
|
||||
@ -59,6 +60,20 @@ in {
|
||||
programs.zsh.enable = true;
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
|
||||
loginShellInit = ''
|
||||
dbus-update-activation-environment --systemd DISPLAY
|
||||
eval $(gnome-keyring-daemon --start --components=ssh,secrets)
|
||||
eval $(ssh-agent)
|
||||
'';
|
||||
|
||||
# faster rebuilding
|
||||
documentation = {
|
||||
enable = true;
|
||||
doc.enable = false;
|
||||
man.enable = true;
|
||||
dev.enable = false;
|
||||
};
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
|
@ -1,5 +1,11 @@
|
||||
{
|
||||
|
||||
services.fail2ban = {
|
||||
enable = true;
|
||||
maxretry = 3;
|
||||
ignoreIP = [ "127.0.0.0/8" "10.0.0.0/8" "192.168.0.0/16" ];
|
||||
};
|
||||
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [ 22 ];
|
||||
|
1
hosts/server/ntfy.nix
Normal file
@ -0,0 +1 @@
|
||||
{ services.ntfy = { enable = true; }; }
|
21
hosts/server/vaultwarden.nix
Normal file
@ -0,0 +1,21 @@
|
||||
let
|
||||
port = 8222;
|
||||
signup = false;
|
||||
in {
|
||||
services.vaultwarden = {
|
||||
enable = true;
|
||||
config = {
|
||||
DOMAIN = "https://bw.anotherhadi.com";
|
||||
SIGNUPS_ALLOWED = signup;
|
||||
ROCKET_ADDRESS = "127.0.0.1";
|
||||
ROCKET_PORT = port;
|
||||
ROCKET_LOG = "critical";
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."bw.anotherhadi.com" = {
|
||||
locations."/" = { proxyPass = "http://127.0.0.1:${toString port}"; };
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ port ];
|
||||
}
|