This commit is contained in:
2025-08-07 01:46:58 +03:00
parent 185d6e22b4
commit de44801150
62 changed files with 5 additions and 43 deletions
+12
View File
@@ -0,0 +1,12 @@
{
config,
...
}:
{
imports = [
./packages.nix
./services.nix
./settings.nix
./tty.nix
];
}
+93
View File
@@ -0,0 +1,93 @@
{
config,
pkgs,
...
}:
{
environment = {
systemPackages = with pkgs; [
# yazi
yaziPlugins.gitui
# Encrypt
age
sops
ssh-to-age
# Nix
nix-diff
nix-tree
nixfmt-tree
nvd
nix-du
nix-prefetch-scripts
# Lazy
lazycli
lazysql
lazyjournal
# Base
curl
# efibootmgr
fd
fdupes
fzf
gdu
lsof
mc
pciutils
usbutils
rsync
wget
tree
# Monitoring
smartmontools
# Disk
parted
ntfs3g
exfatprogs # for gparted exfat support
# Archivers
rar
unzip
zstd
zip
#xarchiver
# Net
ipset
iptables
nftables
];
};
programs = {
git = {
enable = true;
config = {
user = {
name = "oqyude";
email = "oqyude@gmail.com";
};
};
};
lazygit.enable = true;
yazi = {
enable = true;
};
bat.enable = true;
command-not-found.enable = false;
nix-index.enable = true;
nh = {
enable = true;
flake = "/etc/nixos";
clean = {
enable = true;
extraArgs = "--keep 3 --keep-since 2d";
dates = "daily";
};
};
};
}
+38
View File
@@ -0,0 +1,38 @@
{
config,
lib,
pkgs,
...
}:
{
services = {
tailscale.enable = config.xlib.device.type != "wsl"; # true, if not wsl
};
systemd = {
services.rsync-archive = lib.mkIf (config.xlib.device.type == "server") {
description = "Backup data using rsync";
#after = [ ];
requisite = [ "mnt-archive.mount" ]; # hard-code
serviceConfig = {
Type = "oneshot";
User = "root";
Group = "root";
ExecStart = ''
${pkgs.rsync}/bin/rsync -rtv --delete ${config.xlib.dirs.immich-folder}/ ${config.xlib.dirs.archive-drive}/Services/immich/
${pkgs.rsync}/bin/rsync -rtv --delete ${config.xlib.dirs.nextcloud-folder}/ ${config.xlib.dirs.archive-drive}/Services/nextcloud/
'';
Nice = 19;
IOSchedulingClass = "idle";
};
};
timers.rsync-archive = lib.mkIf (config.xlib.device.type == "server") {
description = "Run rsync backup weekly";
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "weekly";
Persistent = true;
Unit = "rsync-archive.service";
};
};
};
}
+52
View File
@@ -0,0 +1,52 @@
{
config,
...
}:
{
system.nixos.label = "default";
nix = {
settings = {
substituters = [
"https://nixos-cache-proxy.cofob.dev" # https://gist.github.com/cofob/9b1fd205e6d961a45c225ae9f0af1394
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
auto-optimise-store = true;
experimental-features = [
"nix-command"
"flakes"
];
};
};
nixpkgs.config.allowUnfree = true;
security = {
sudo.wheelNeedsPassword = false;
polkit = {
enable = true;
extraConfig = ''
polkit.addRule(function(action, subject) {
if (subject.isInGroup("wheel")){ // for sudo
return polkit.Result.YES;
}
});
'';
};
};
systemd.network.wait-online.enable = false;
time.timeZone = "Europe/Moscow";
i18n = {
defaultLocale = "en_US.UTF-8";
supportedLocales = [
#"C.UTF-8/UTF-8"
"en_US.UTF-8/UTF-8"
"ru_RU.UTF-8/UTF-8"
];
};
}
+42
View File
@@ -0,0 +1,42 @@
{
config,
pkgs,
...
}:
{
system.userActivationScripts.zshrc = "touch .zshrc";
users.defaultUserShell = pkgs.zsh;
programs.zsh = {
enable = true;
enableCompletion = true;
enableBashCompletion = true;
syntaxHighlighting.enable = true;
zsh-autoenv.enable = true;
histSize = 10000;
loginShellInit = "cd /etc/nixos && clear && fastfetch";
ohMyZsh = {
enable = true;
theme = "robbyrussell";
};
shellAliases = {
# shell
ff = "clear && fastfetch";
l = "ls -l";
# ssh
s-1 = "ssh sapphira-1";
s-1t = "ssh sapphira-1t";
o-0 = "ssh otreca-0";
o-0t = "ssh otreca-0t";
# Somethings
reboot-bios = "sudo systemctl reboot --firmware-setup";
# Extras
plasma-manager = "nix run github:nix-community/plasma-manager";
pip2nix = "nix run github:nix-community/pip2nix --"; # https://github.com/nix-community/pip2nix
pip2nix-g = "nix run github:nix-community/pip2nix -- generate -r";
json2nix = "nix run github:sempruijs/json2nix";
};
};
}