mirror of
https://github.com/oqyude/nixos.git
synced 2026-06-15 06:30:10 +03:00
some clean
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./packages.nix
|
||||
./services.nix
|
||||
./settings.nix
|
||||
# ./systemd-routine.nix
|
||||
./tty.nix
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
# Minimal
|
||||
btop
|
||||
broot
|
||||
bottom
|
||||
fastfetchMinimal
|
||||
|
||||
# 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
|
||||
systemctl-tui
|
||||
|
||||
# Base
|
||||
curl
|
||||
# efibootmgr
|
||||
fd
|
||||
fdupes
|
||||
fzf
|
||||
gdu
|
||||
lsof
|
||||
mc
|
||||
pciutils
|
||||
usbutils
|
||||
rsync
|
||||
wget
|
||||
tree
|
||||
|
||||
# Net Diagnostic
|
||||
mtr
|
||||
dnsutils
|
||||
|
||||
# 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services = {
|
||||
tailscale.enable = xlib.device.type != "wsl"; # true, if not wsl
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
system.nixos.label = "default";
|
||||
|
||||
nix = {
|
||||
channel = {
|
||||
enable = true;
|
||||
};
|
||||
settings = {
|
||||
substituters = [
|
||||
"https://cache.nixos.org"
|
||||
"https://nix-community.cachix.org"
|
||||
"https://nixos-cache-proxy.cofob.dev" # https://gist.github.com/cofob/9b1fd205e6d961a45c225ae9f0af1394
|
||||
#"https://nixos.snix.store" # https://nixos.snix.store/
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
auto-optimise-store = true;
|
||||
experimental-features = [
|
||||
"flakes"
|
||||
"nix-command"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
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"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
config,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
systemd = {
|
||||
services.nixos-auto-rebuild = {
|
||||
description = "Auto rebuild NixOS config";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "${xlib.device.username}";
|
||||
WorkingDirectory = "/etc/nixos";
|
||||
ExecStart = "gp-ns";
|
||||
};
|
||||
};
|
||||
timers.nixos-auto-rebuild = {
|
||||
description = "Run NixOS auto rebuild at 4am daily";
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "*-*-* 04:00:00";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
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";
|
||||
};
|
||||
shellInit = ''
|
||||
beetn() {
|
||||
echo "$*" | aichat -cer beets
|
||||
}
|
||||
'';
|
||||
shellAliases = {
|
||||
# shell
|
||||
ff = "clear && fastfetch";
|
||||
l = "ls -l";
|
||||
lg = "lazygit";
|
||||
st = "systemctl-tui";
|
||||
gp = "git pull";
|
||||
ns = "nh os switch";
|
||||
gp-ns = "gp && ns";
|
||||
|
||||
# ssh
|
||||
z-s = "ssh sapphira";
|
||||
z-st = "ssh sapphira-tailscale";
|
||||
z-o = "ssh otreca";
|
||||
z-ot = "ssh otreca-tailscale";
|
||||
z-p-1 = "ssh pubray-1";
|
||||
|
||||
# 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user