mirror of
https://github.com/oqyude/nixos.git
synced 2026-06-11 04:30:41 +03:00
Init
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./packages.nix
|
||||
./services.nix
|
||||
./settings.nix
|
||||
# ./systemd-routine.nix
|
||||
./shell.nix
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
master = import inputs.nixpkgs-master {
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
in
|
||||
{
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
# Minimal
|
||||
btop
|
||||
broot
|
||||
bottom
|
||||
fastfetchMinimal
|
||||
|
||||
# Encrypt
|
||||
age
|
||||
sops
|
||||
ssh-to-age
|
||||
|
||||
# Nix
|
||||
nix-diff
|
||||
nix-tree
|
||||
nixfmt-tree
|
||||
nvd
|
||||
nix-du
|
||||
nix-prefetch-scripts
|
||||
deploy-rs
|
||||
|
||||
# Lazy
|
||||
lazycli
|
||||
lazysql
|
||||
lazyjournal
|
||||
systemctl-tui
|
||||
|
||||
# Base
|
||||
curl
|
||||
# efibootmgr
|
||||
fd
|
||||
fdupes
|
||||
fzf
|
||||
gdu
|
||||
lsof
|
||||
mc
|
||||
pciutils
|
||||
usbutils
|
||||
rsync
|
||||
wget
|
||||
tree
|
||||
dust
|
||||
flow-control
|
||||
|
||||
# Net Diagnostic
|
||||
mtr
|
||||
dnsutils
|
||||
inetutils
|
||||
|
||||
# Android tools
|
||||
android-tools
|
||||
|
||||
# Monitoring
|
||||
smartmontools
|
||||
|
||||
# Disk
|
||||
parted
|
||||
ntfs3g
|
||||
exfatprogs # for gparted exfat support
|
||||
|
||||
# Archivers
|
||||
# rar
|
||||
unzip
|
||||
zstd
|
||||
zip
|
||||
#xarchiver
|
||||
|
||||
# Net
|
||||
ipset
|
||||
iptables
|
||||
nftables
|
||||
openssl
|
||||
|
||||
# To save
|
||||
tuios
|
||||
fresh-editor
|
||||
|
||||
# Test
|
||||
jocalsend
|
||||
lazydocker
|
||||
dtop
|
||||
tlrc
|
||||
lazyssh
|
||||
mcat
|
||||
framework-tool-tui
|
||||
bluetui
|
||||
snitch
|
||||
devenv
|
||||
whosthere
|
||||
];
|
||||
};
|
||||
environment.variables.EDITOR = "fresh";
|
||||
programs = {
|
||||
# nix-ld.enable = true;
|
||||
nano = {
|
||||
enable = true;
|
||||
nanorc = ''
|
||||
set nowrap
|
||||
set tabstospaces
|
||||
set tabsize 2
|
||||
'';
|
||||
syntaxHighlight = true;
|
||||
};
|
||||
yazi = {
|
||||
enable = false;
|
||||
plugins = {
|
||||
inherit (pkgs.yaziPlugins)
|
||||
gitui
|
||||
git
|
||||
sudo
|
||||
ouch
|
||||
rsync
|
||||
diff
|
||||
mount
|
||||
chmod
|
||||
dupes
|
||||
lazygit
|
||||
toggle-pane
|
||||
rich-preview
|
||||
smart-filter
|
||||
full-border
|
||||
recycle-bin
|
||||
;
|
||||
};
|
||||
flavors = {
|
||||
nord = pkgs.yaziPlugins.nord;
|
||||
};
|
||||
settings = {
|
||||
yazi = {
|
||||
mgr.ratio = [
|
||||
1
|
||||
1
|
||||
4
|
||||
];
|
||||
};
|
||||
keymap = {
|
||||
mgr.prepend_keymap = [
|
||||
{
|
||||
on = [
|
||||
"g"
|
||||
"i"
|
||||
];
|
||||
run = "plugin lazygit";
|
||||
desc = "run lazygit";
|
||||
}
|
||||
{
|
||||
run = "plugin ouch --args=zip";
|
||||
on = [
|
||||
"g"
|
||||
"C"
|
||||
];
|
||||
desc = "Compress with ouch";
|
||||
}
|
||||
];
|
||||
};
|
||||
theme = {
|
||||
flavor = {
|
||||
light = "nord";
|
||||
dark = "nord";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
git = {
|
||||
enable = true;
|
||||
config = {
|
||||
user = {
|
||||
name = "oqyude";
|
||||
email = "oqyude@gmail.com";
|
||||
};
|
||||
};
|
||||
};
|
||||
lazygit.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,76 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
# new things https://git.voronind.com/voronind/nix/src/commit/c4a70068a474e9f30b8e367b69520c563e02fbd9/system/nix.nix
|
||||
system.nixos.label = "default";
|
||||
|
||||
nix = {
|
||||
package = pkgs.lixPackageSets.stable.lix;
|
||||
channel.enable = false;
|
||||
nixPath = [ "nixpkgs=flake:nixpkgs" ];
|
||||
settings = {
|
||||
require-sigs = false;
|
||||
substituters = [
|
||||
"https://cache.nixos.org"
|
||||
"https://nix-community.cachix.org"
|
||||
"https://mirror.yandex.ru/nixos"
|
||||
"https://cache.nixos.kz"
|
||||
# "https://cache.xd0.zip"
|
||||
"https://nixos-cache-proxy.cofob.dev"
|
||||
# "https://nixos-cache-proxy.sweetdogs.ru"
|
||||
# "https://nixos-cache-proxy.elxreno.com"
|
||||
# "https://nixos.snix.store" # https://nixos.snix.store/
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
stalled-download-timeout = 4;
|
||||
connect-timeout = 4;
|
||||
auto-optimise-store = true;
|
||||
fallback = true;
|
||||
allow-import-from-derivation = false;
|
||||
keep-derivations = false;
|
||||
keep-outputs = false;
|
||||
experimental-features = [
|
||||
"flakes"
|
||||
"nix-command"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
flake = {
|
||||
setFlakeRegistry = false;
|
||||
setNixPath = false;
|
||||
};
|
||||
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 = [
|
||||
"en_US.UTF-8/UTF-8"
|
||||
"ru_RU.UTF-8/UTF-8"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
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 = ''
|
||||
beet-n() {
|
||||
echo "$*" | aichat -cer beets
|
||||
}
|
||||
beet-p() {
|
||||
beet mod path:. playlist="$*"
|
||||
}
|
||||
beet-ims() {
|
||||
beet im ./ -S $*
|
||||
}
|
||||
'';
|
||||
shellAliases = {
|
||||
# shell
|
||||
ff = "clear && fastfetch";
|
||||
l = "ls -l";
|
||||
lg = "lazygit";
|
||||
lc = "lazycli";
|
||||
st = "systemctl-tui";
|
||||
gp = "git pull";
|
||||
ns = "nh os switch";
|
||||
gp-ns = "gp && ns";
|
||||
y = "yazi";
|
||||
nix-shellp = "nix-shell --run $SHELL -p";
|
||||
z-proxy = "export ALL_PROXY=socks5://localhost:10808";
|
||||
|
||||
# beets
|
||||
beet-ima = "beet im ./ -A";
|
||||
|
||||
# ssh
|
||||
z-s = "ssh sapphira";
|
||||
z-st = "ssh sapphira-tailscale";
|
||||
z-o = "ssh otreca";
|
||||
z-ot = "ssh otreca-tailscale";
|
||||
z-l = "ssh lamet";
|
||||
z-lt = "ssh lamet-tailscale";
|
||||
z-p-1 = "ssh pubray-1";
|
||||
z-map-local-proxy = "ssh -R 10808:localhost:10808";
|
||||
|
||||
# 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user