rust pobeda

This commit is contained in:
Aleksandr 2025-06-08 23:40:41 +00:00
parent 1bc03bdb14
commit 5cd0ded292
59 changed files with 1185 additions and 1389 deletions

79
dotfiles/doom/config.el Normal file
View file

@ -0,0 +1,79 @@
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets. It is optional.
;; (setq user-full-name "John Doe"
;; user-mail-address "john@doe.com")
;; Doom exposes five (optional) variables for controlling fonts in Doom:
;;
;; - `doom-font' -- the primary font to use
;; - `doom-variable-pitch-font' -- a non-monospace font (where applicable)
;; - `doom-big-font' -- used for `doom-big-font-mode'; use this for
;; presentations or streaming.
;; - `doom-symbol-font' -- for symbols
;; - `doom-serif-font' -- for the `fixed-pitch-serif' face
;;
;; See 'C-h v doom-font' for documentation and more examples of what they
;; accept. For example:
;;
;;(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'semi-light)
;; doom-variable-pitch-font (font-spec :family "Fira Sans" :size 13))
;;
;; If you or Emacs can't find your font, use 'M-x describe-font' to look them
;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to
;; refresh your font settings. If Emacs still can't find your font, it likely
;; wasn't installed correctly. Font issues are rarely Doom issues!
(setq doom-theme 'doom-palenight)
(setq doom-font (font-spec :family "JetBrains Mono Nerd Font" :size 15)
doom-variable-pitch-font (font-spec :family "JetBrains Mono Nerd Font" :size 28))
;; There are two ways to load a theme. Both assume the theme is installed and
;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default:
(setq doom-theme 'doom-one)
;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'.
(setq display-line-numbers-type t)
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory "~/org/")
(setq confirm-kill-emacs nil)
;; Whenever you reconfigure a package, make sure to wrap your config in an
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
;;
;; (after! PACKAGE
;; (setq x y))
;;
;; The exceptions to this rule:
;;
;; - Setting file/directory variables (like `org-directory')
;; - Setting variables which explicitly tell you to set them before their
;; package is loaded (see 'C-h v VARIABLE' to look up their documentation).
;; - Setting doom variables (which start with 'doom-' or '+').
;;
;; Here are some additional functions/macros that will help you configure Doom.
;;
;; - `load!' for loading external *.el files relative to this one
;; - `use-package!' for configuring packages
;; - `after!' for running code after a package has loaded
;; - `add-load-path!' for adding directories to the `load-path', relative to
;; this file. Emacs searches the `load-path' when you load packages with
;; `require' or `use-package'.
;; - `map!' for binding new keys
;;
;; To get information about any of these functions/macros, move the cursor over
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
;; This will open documentation for it, including demos of how they are used.
;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces,
;; etc).
;;
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented.

12
dotfiles/doom/custom.el Normal file
View file

@ -0,0 +1,12 @@
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(auth-source-save-behavior nil))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

193
dotfiles/doom/init.el Normal file
View file

@ -0,0 +1,193 @@
;;; init.el -*- lexical-binding: t; -*-
;; This file controls what Doom modules are enabled and what order they load
;; in. Remember to run 'doom sync' after modifying it!
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
;; documentation. There you'll find a link to Doom's Module Index where all
;; of our modules are listed, including what flags they support.
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
;; 'C-c c k' for non-vim users) to view its documentation. This works on
;; flags as well (those symbols that start with a plus).
;;
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
;; directory (for easy access to its source code).
(doom! :input
;;bidi ; (tfel ot) thgir etirw uoy gnipleh
;;chinese
;;japanese
;;layout ; auie,ctsrnm is the superior home row
:completion
;;company ; the ultimate code completion backend
(corfu +orderless) ; complete with cap(f), cape and a flying feather!
;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
;;ivy ; a search engine for love and life
vertico ; the search engine of the future
:ui
;;deft ; notational velocity for Emacs
doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs
;;doom-quit ; DOOM quit-message prompts when you quit Emacs
;;(emoji +unicode) ; 🙂
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;indent-guides ; highlighted indent columns
ligatures ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API
;;nav-flash ; blink cursor line after big motions
;;neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on
(popup +defaults) ; tame sudden yet inevitable temporary windows
;;tabs ; a tab bar for Emacs
treemacs ; a project drawer, like neotree but cooler
unicode ; extended unicode support for various languages
(vc-gutter +pretty) ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB
;;window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces
;;zen ; distraction-free coding or writing
:editor
(evil +everywhere); come to the dark side, we have cookies
file-templates ; auto-snippets for empty files
fold ; (nigh) universal code folding
;;(format +onsave) ; automated prettiness
;;god ; run Emacs commands without modifier keys
;;lispy ; vim for lisp, for people who don't like vim
;;multiple-cursors ; editing in many places at once
;;objed ; text object editing for the innocent
;;parinfer ; turn lisp into python, sort of
;;rotate-text ; cycle region at point between text candidates
snippets ; my elves. They type so I don't have to
;;word-wrap ; soft wrapping with language-aware indent
:emacs
dired ; making dired pretty [functional]
electric ; smarter, keyword-based electric-indent
;;eww ; the internet is gross
;;ibuffer ; interactive buffer management
undo ; persistent, smarter undo for your inevitable mistakes
vc ; version-control and Emacs, sitting in a tree
:term
eshell ; the elisp shell that works everywhere
;;shell ; simple shell REPL for Emacs
;;term ; basic terminal emulator for Emacs
vterm ; the best terminal emulation in Emacs
:checkers
syntax ; tasing you for every semicolon you forget
(spell +flyspell) ; tasing you for misspelling mispelling
grammar ; tasing grammar mistake every you make
:tools
;;ansible
;;biblio ; Writes a PhD for you (citation needed)
;;collab ; buffers with friends
;;debugger ; FIXME stepping through code, to help you add bugs
direnv
;;docker
editorconfig ; let someone else argue about tabs vs spaces
;;ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls)
lookup ; navigate your code and its documentation
lsp ; M-x vscode
magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs
;;pass ; password manager for nerds
;;pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders
;;terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux
tree-sitter ; syntax and parsing, sitting in a tree...
;;upload ; map local to remote projects via ssh/ftp
:os
(:if (featurep :system 'macos) macos) ; improve compatibility with macOS
;;tty ; improve the terminal Emacs experience
:lang
agda ; types of types of types of types...
;;beancount ; mind the GAAP
;;(cc +lsp) ; C > C++ == 1
clojure ; java with a lisp
common-lisp ; if you've seen one lisp, you've seen them all
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
;;data ; config/data formats
(dart +flutter) ; paint ui and not much else
;;dhall
;;elixir ; erlang done right
;;elm ; care for a cup of TEA?
emacs-lisp ; drown in parentheses
;;erlang ; an elegant language for a more civilized age
;;ess ; emacs speaks statistics
;;factor
;;faust ; dsp, but you get to keep your soul
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
;;fsharp ; ML stands for Microsoft's Language
;;fstar ; (dependent) types and (monadic) effects and Z3
;;gdscript ; the language you waited for
;;(go +lsp) ; the hipster dialect
;;(graphql +lsp) ; Give queries a REST
(haskell +lsp) ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python
idris ; a language you can depend on
json ; At least it ain't XML
;;(java +lsp) ; the poster child for carpal tunnel syndrome
;;javascript ; all(hope(abandon(ye(who(enter(here))))))
;;julia ; a better, faster MATLAB
;;kotlin ; a better, slicker Java(Script)
;;latex ; writing papers in Emacs has never been so fun
;;lean ; for folks with too much to prove
;;ledger ; be audit you can be
;;lua ; one-based indices? one-based indices
(markdown +grip) ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c
nix ; I hereby declare "nix geht mehr!"
ocaml ; an objective camel
org ; organize your plain life in plain text
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;graphviz ; diagrams for confusing yourself even more
purescript ; javascript, but functional
python ; beautiful is better than ugly
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
;;raku ; the artist formerly known as perl6
;;rest ; Emacs as a REST client
;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good
(scheme +guile) ; a fully conniving family of lisps
sh ; she sells {ba,z,fi}sh shells on the C xor
;;sml
;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance.
;;web ; the tubes
yaml ; JSON, but readable
zig ; C, but simpler
:email
;;(mu4e +org +gmail)
;;notmuch
;;(wanderlust +gmail)
:app
;;calendar
;;emms
;;everywhere ; *leave* Emacs!? You must be joking
;;irc ; how neckbeards socialize
;;(rss +org) ; emacs as an RSS reader
:config
;;literate
(default +bindings +smartparens))

51
dotfiles/doom/packages.el Normal file
View file

@ -0,0 +1,51 @@
;; -*- no-byte-compile: t; -*-
;;; $DOOMDIR/packages.el
;; To install a package with Doom you must declare them here and run 'doom sync'
;; on the command line, then restart Emacs for the changes to take effect -- or
;; use 'M-x doom/reload'.
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
;; (package! some-package)
;; To install a package directly from a remote git repo, you must specify a
;; `:recipe'. You'll find documentation on what `:recipe' accepts here:
;; https://github.com/radian-software/straight.el#the-recipe-format
;; (package! another-package
;; :recipe (:host github :repo "username/repo"))
;; If the package you are trying to install does not contain a PACKAGENAME.el
;; file, or is located in a subdirectory of the repo, you'll need to specify
;; `:files' in the `:recipe':
;; (package! this-package
;; :recipe (:host github :repo "username/repo"
;; :files ("some-file.el" "src/lisp/*.el")))
;; If you'd like to disable a package included with Doom, you can do so here
;; with the `:disable' property:
;; (package! builtin-package :disable t)
;; You can override the recipe of a built in package without having to specify
;; all the properties for `:recipe'. These will inherit the rest of its recipe
;; from Doom or MELPA/ELPA/Emacsmirror:
;; (package! builtin-package :recipe (:nonrecursive t))
;; (package! builtin-package-2 :recipe (:repo "myfork/package"))
;; Specify a `:branch' to install a package from a particular branch or tag.
;; This is required for some packages whose default branch isn't 'master' (which
;; our package manager can't deal with; see radian-software/straight.el#279)
;; (package! builtin-package :recipe (:branch "develop"))
;; Use `:pin' to specify a particular commit to install.
;; (package! builtin-package :pin "1a2b3c4d5e")
;; Doom's packages are pinned to a specific commit and updated from release to
;; release. The `unpin!' macro allows you to unpin single packages...
;; (unpin! pinned-package)
;; ...or multiple packages
;; (unpin! pinned-package another-pinned-package)
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
;; (unpin! t)

39
dotfiles/niri/default.nix Normal file
View file

@ -0,0 +1,39 @@
{ config, lib, pkgs, ... }:
{
environment = {
"NIXOS_OZONE_WL" = "1";
};
workspaces."01-dev" = {};
workspaces."02-social" = {};
workspaces."03-web" = {};
workspaces."04-games" = {};
outputs."eDP-1" = {
scale = 1.9;
};
input = {
keyboard.xkb = {
layout = "us,ru";
options = "grp:caps_toggle";
};
};
binds = with config.lib.niri.actions; {
"Mod+A".action = spawn "fuzzel";
"Mod+Q".action = spawn "wezterm";
"Mod+1".action = focus-workspace 1;
"Mod+2".action = focus-workspace 2;
"Mod+3".action = focus-workspace 3;
"Mod+4".action = focus-workspace 4;
"Mod+5".action = focus-workspace 5;
"Mod+Left".action = focus-column-left;
"Mod+Right".action = focus-column-right;
"Mod+Shift+Left".action = set-column-width "-5%";
"Mod+Shift+Right".action = set-column-width "+5%";
"Mod+Shift+H".action = move-column-left;
"Mod+Shift+L".action = move-column-right;
"Mod+F".action = fullscreen-window;
"Mod+Shift+E".action = quit { skip-confirmation = true; };
"Mod+C".action = close-window;
"Mod+Shift+R".action = screenshot { write-to-disk = false; };
};
}

868
flake.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,54 +1,49 @@
{
description = "Nero";
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=release-24.11";
vnj = {
url = "git+https://git.viende.su/VienDesu/vnj.git";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
fenix.url = "github:nix-community/fenix";
flake-parts.url = "github:hercules-ci/flake-parts";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
fenix.url = "github:nix-community/fenix";
hyprland = {
url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
niri-flake = {
url = "github:sodiboo/niri-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
wezterm = {
url = "github:wez/wezterm?dir=nix";
zen-browser = {
url = "github:0xc000022070/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-doom-emacs-unstraightened = {
url = "github:marienz/nix-doom-emacs-unstraightened";
inputs.nixpkgs.follows = "nixpkgs";
};
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
nixpkgs,
sops-nix,
home-manager,
...
}@inputs: {
nixosConfigurations.lil-maid = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager
./m
./lil-maid
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } (_: {
imports = [
./hosts
];
systems = [
"x86_64-linux"
];
specialArgs = {
inherit inputs;
perSystem = { config, pkgs, ... }: {
devShells.default = pkgs.mkShell {
packages = with pkgs; [ sops ];
};
};
};
};
});
}

26
hosts/default.nix Normal file
View file

@ -0,0 +1,26 @@
{ lib, inputs, ... }:
let
mkSystem = { config, system ? "x86_64-linux" }: (inputs.nixpkgs.lib.nixosSystem {
inherit system;
modules = [
../modules
config
{
}
];
specialArgs = {
inherit inputs;
dotfiles = ../dotfiles;
};
});
in
{
options = {};
config = {
flake.nixosConfigurations = {
eva = mkSystem { config = ./eva; };
lil-maid = mkSystem { config = ./lil-maid; };
};
};
}

6
hosts/eva/default.nix Normal file
View file

@ -0,0 +1,6 @@
{ nixpkgs, inputs, ... }:
{
imports = [];
system.stateVersion = "25.11";
}

View file

@ -0,0 +1,17 @@
{ nixpkgs, lib, ... }:
{
imports = [
./hw.nix
./dev.nix
./sw.nix
./fs.nix
./niri.nix
./home
];
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"slack"
];
system.stateVersion = "25.11";
}

9
hosts/lil-maid/dev.nix Normal file
View file

@ -0,0 +1,9 @@
{ config, lib, pkgs, ... }:
{
fonts.packages = with pkgs; [
nerd-fonts.fira-code
nerd-fonts.jetbrains-mono
];
fonts.fontDir.enable = true;
}

View file

@ -1,4 +1,8 @@
{
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
fileSystems = {
"/" =
{ device = "/dev/disk/by-label/nixos";
@ -9,14 +13,5 @@
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
"/secrets" =
{ device = "/dev/disk/by-label/secrets";
fsType = "btrfs";
options = [ "nofail" ];
};
};
swapDevices =
[ { device = "/dev/disk/by-label/swap"; }
];
}

BIN
hosts/lil-maid/home/cat.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

View file

@ -0,0 +1,14 @@
{ inputs, dotfiles, ... }:
{
imports = [
./nero.nix
];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs dotfiles; };
};
users.mutableUsers = false;
}

View file

@ -0,0 +1,83 @@
{ config, lib, pkgs, ... }:
{
sops.secrets."users/nero/passwordHash" = {
neededForUsers = true;
sopsFile = ../../../secrets/users.yaml;
};
users.users.nero = {
isNormalUser = true;
uid = 1000;
hashedPasswordFile = config.sops.secrets."users/nero/passwordHash".path;
extraGroups = [ "networkmanager" "wheel" "adbuser" ];
};
home-manager.users.nero = args@{ config, lib, inputs, pkgs, dotfiles, ... }: {
home.stateVersion = "25.11";
imports = [
inputs.zen-browser.homeModules.beta
inputs.niri-flake.homeModules.niri
inputs.nix-doom-emacs-unstraightened.homeModule
];
stylix = {
enable = true;
autoEnable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/ayu-mirage.yaml";
polarity = "dark";
fonts = {
monospace = {
package = pkgs.nerd-fonts.jetbrains-mono;
name = "JetBrains Mono";
};
};
};
services.mako = {
enable = true;
};
programs.zen-browser = {
enable = true;
policies = {
DisableAppUpdate = true;
DisableTelemetry = true;
};
};
programs.bash = {
enable = true;
bashrcExtra = ''
eval "$(direnv hook bash)"
'';
};
programs.direnv = {
enable = true;
enableBashIntegration = true;
nix-direnv.enable = true;
};
programs.doom-emacs = {
enable = true;
emacs = pkgs.emacs-pgtk;
doomDir = dotfiles + "/doom";
};
programs.waybar.settings.mainBar.layer = "top";
programs.wezterm = {
enable = true;
enableBashIntegration = true;
extraConfig = ''
return {
enable_wayland = true
}
'';
};
programs.git = {
enable = true;
lfs.enable = true;
userName = "Aleksandr";
userEmail = "nerodono0@gmail.com";
};
programs.niri.settings = import (dotfiles + "/niri") args;
};
}

View file

@ -1,27 +1,17 @@
{ pkgs, config, lib, modulesPath, ... }:
{
environment.systemPackages = with pkgs; [
# Brightness control for display.
brightnessctl
];
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
systemd.tmpfiles.settings = {
"10-secrets" = {
"/secrets".v = {
user = "nero";
mode = "0760";
};
};
};
services.blueman.enable = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelModules = [ "btusb" "kvm-amd" ];
boot.kernelModules = [
# Without this, bluetooth doesn't work.
"btusb"
"kvm-amd"
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ "amdgpu" ];
@ -32,13 +22,6 @@
hardware.graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [
amdvlk
];
extraPackages32 = with pkgs; [
driversi686Linux.amdvlk
];
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";

20
hosts/lil-maid/niri.nix Normal file
View file

@ -0,0 +1,20 @@
{ config, lib, pkgs, inputs, ... }:
{
imports = [
inputs.stylix.nixosModules.stylix
];
programs.waybar = {
enable = true;
systemd.target = "graphical-session.target";
};
programs.niri.enable = true;
services.displayManager.sddm = {
enable = true;
wayland.enable = true;
enableHidpi = true;
};
environment.systemPackages = with pkgs; [
fuzzel
];
}

11
hosts/lil-maid/sw.nix Normal file
View file

@ -0,0 +1,11 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
# Nuh uh society.
ayugram-desktop
vesktop
slack
signal-desktop
];
}

View file

@ -1,57 +0,0 @@
{
maid = {
sys = {
enable = true;
hostname = "lil-maid";
bluetooth.enable = true;
};
masters.nero.enable = true;
sops = {
enable = true;
viendesu.enable = true;
work.enable = true;
};
sddm.enable = true;
hm.enable = true;
hypr.enable = true;
# kde.enable = true;
rust.enable = true;
firefox.enable = true;
proxies = {
yor.enable = true;
};
vpn = {
hft.enable = true;
};
unfree = [
"obsidian"
"slack"
"discord"
"terraform"
"yandex-cloud"
"steam"
"steam-original"
"steam-unwrapped"
"steam-run"
"xow_dongle-firmware"
];
};
imports = [
./modules
./hw.nix
./fs.nix
];
system.stateVersion = "24.05";
}

View file

@ -1,4 +0,0 @@
{
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
}

View file

@ -1,17 +0,0 @@
{
services.xserver.windowManager.qtile = {
enable = true;
};
imports = [
./net.nix
./firewall.nix
./boot.nix
./steam.nix
./fonts.nix
./social.nix
./stash.nix
./net.nix
./devenv.nix
];
}

View file

@ -1,37 +0,0 @@
{ config, lib, pkgs, ... }:
{
# TODO: dotfiles for DOOM emacs.
environment.systemPackages = with pkgs; [
# BTW I use it for real.
emacs29-pgtk
# Spellcheck
ispell
languagetool
proselint
# VCS
git
jujutsu
# Markdown
pandoc
python312Packages.grip
# NixOS Devops
# Binary cache
attic-client
# Deployment
colmena
nixos-anywhere
# Other useful tools.
fd
hyperfine
ripgrep
p7zip
];
}

View file

@ -1,5 +0,0 @@
{
networking.firewall = {
enable = false;
};
}

View file

@ -1,6 +0,0 @@
{ pkgs, ... }:
{
fonts.packages = with pkgs; [
nerdfonts
];
}

View file

@ -1,15 +0,0 @@
{
networking.networkmanager.enable = true;
networking.nameservers = [
"1.1.1.1"
"8.8.8.8"
];
# services.mullvad-vpn.enable = true;
# services.resolved = {
# enable = true;
# dnssec = "true";
# domains = [ "~." ];
# dnsovertls = "true";
# };
}

View file

@ -1,16 +0,0 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
# Slack
slack
# Telegram
telegram-desktop
# # Discord
# (discord.override {
# withOpenASAR = true;
# withVencord = true;
# })
];
}

View file

@ -1,52 +0,0 @@
# Temporary location for modules and other code. Stacked here until
# there's no similarties which useful to take out.
{ pkgs, inputs, ... }:
{
imports = [ inputs.vnj.nixosModules.x86_64-linux.default ];
programs.adb.enable = true;
services.vnj =
let
mkCfg = port: {
app = {
secret = "1337";
log_level = "debug";
journal = "/home/nero/vnj";
};
http.listen = "0.0.0.0:${builtins.toString port}";
};
in
{
enable = true;
user = "nero";
instances = {
ru = mkCfg 1337;
};
};
virtualisation.docker.enable = true;
environment.systemPackages = with pkgs; [
obsidian
sioyek
cmake
gcc
clang
gnumake
signal-desktop
pavucontrol
vlc
wine
winetricks
yandex-cloud
qbittorrent
element-desktop
xfce.thunar
];
fonts.packages = with pkgs; [
fira-code
fira-code-symbols
];
}

View file

@ -1,20 +0,0 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
protontricks
];
programs = {
gamescope = {
enable = true;
capSysNice = true;
};
steam = {
enable = true;
gamescopeSession.enable = true;
};
};
hardware.xone.enable = true;
}

View file

@ -1,16 +0,0 @@
{
imports = [
./sddm.nix
./sops.nix
./hypr.nix
./kde.nix
./sys.nix
./unfree.nix
./firefox.nix
./home
./vpn
./rust.nix
./masters
];
}

View file

@ -1,13 +0,0 @@
{ config, lib, ... }:
let
firefox = config.maid.firefox;
in
{
options.maid.firefox = {
enable = lib.mkEnableOption "firefox";
};
config.programs.firefox = lib.mkIf firefox.enable {
enable = true;
};
}

View file

@ -1,18 +0,0 @@
{ inputs, config, lib, ... }:
let
hm = config.maid.hm;
masters = config.maid.masters;
in
{
options.maid.hm = {
enable = lib.mkEnableOption "home-manager";
};
config.home-manager = lib.mkIf hm.enable {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs; };
users.nero = lib.mkIf masters.nero.enable (import ./nero);
};
}

View file

@ -1,28 +0,0 @@
{ pkgs, ... }:
let
sonokai = import themes/sonokai;
langs = (import ./langs) pkgs;
in
{
programs.helix = {
enable = true;
settings = {
theme = "sonokai-andromeda";
editor.cursor-shape = {
normal = "block";
insert = "bar";
select = "underline";
};
};
languages = {
language-server.rust-analyzer.config = {
rust.analyzerTargetDir = true;
};
};
themes = {
sonokai-andromeda = sonokai "andromeda";
};
};
}

View file

@ -1,15 +0,0 @@
{ pkgs, ... }:
rec {
use = name: (import ./${"${name}.nix"}) pkgs;
combine = lhs: rhs: {
lsp = (lhs.lsp or {}) // (rhs.lsp or {});
entries = (lhs.entries or []) ++ (rhs.entries or []);
};
intoHelixFormat = cfg: {
language-server = cfg.lsp;
language = cfg.entries;
};
useMany = langs: builtins.foldl' combine {} (map use langs);
}

View file

@ -1,15 +0,0 @@
{ pkgs, ... }:
{
lsp.nixd = {
command = "${pkgs.nixd}/bin/nixd";
};
entries = [{
name = "Nix";
scope = "source.nix";
injection-regex = "nix";
file-types = ["nix"];
comment-tokens = "#";
indent = { tab-width = 2; unit = " "; };
language-servers = [ "nixd" ];
}];
}

View file

@ -1,2 +0,0 @@
[a]
b = 10

View file

@ -1,179 +0,0 @@
palette:
{
"attribute" = "purple";
"comment" = "grey";
"constant" = "purple";
"constant.character.escape" = "orange";
"constant.numeric" = "purple";
"constructor" = "blue";
"diagnostic" = { "underlined" = { "style" = "line"; }; };
"diagnostic.error" = {
"underline" = {
"color" = "red";
"style" = "curl";
};
};
"diagnostic.hint" = {
"underline" = {
"color" = "blue";
"style" = "dotted";
};
};
"diagnostic.info" = {
"underline" = {
"color" = "green";
"style" = "dotted";
};
};
"diagnostic.warning" = {
"underline" = {
"color" = "yellow";
"style" = "curl";
};
};
"diff.delta" = "orange";
"diff.minus" = "red";
"diff.plus" = "green";
"error" = "red";
"function" = "green";
"function.builtin" = "blue";
"function.macro" = "purple";
"hint" = "blue";
"info" = "green";
"keyword" = "red";
"keyword.directive" = "purple";
"label" = "orange";
"markup.bold" = { "modifiers" = [ "bold" ]; };
"markup.heading.1" = {
"fg" = "red";
"modifiers" = [ "bold" ];
};
"markup.heading.2" = {
"fg" = "orange";
"modifiers" = [ "bold" ];
};
"markup.heading.3" = {
"fg" = "yellow";
"modifiers" = [ "bold" ];
};
"markup.heading.4" = {
"fg" = "green";
"modifiers" = [ "bold" ];
};
"markup.heading.5" = {
"fg" = "blue";
"modifiers" = [ "bold" ];
};
"markup.heading.6" = {
"fg" = "fg";
"modifiers" = [ "bold" ];
};
"markup.heading.marker" = "grey";
"markup.italic" = { "modifiers" = [ "italic" ]; };
"markup.link.text" = "purple";
"markup.link.url" = {
"fg" = "blue";
"modifiers" = [ "underlined" ];
};
"markup.list" = "red";
"markup.quote" = "grey";
"markup.raw" = "green";
"module" = "blue";
"namespace" = "blue";
"operator" = "orange";
"punctuation" = "grey";
"punctuation.bracket" = "fg";
"punctuation.delimiter" = "grey";
"special" = "orange";
"string" = "yellow";
"string.regexp" = "orange";
"tag" = "yellow";
"type" = "blue";
"ui.background" = { "bg" = "bg0"; };
"ui.background.separator" = "grey";
"ui.bufferline" = {
"bg" = "bg1";
"fg" = "grey";
};
"ui.bufferline.active" = {
"bg" = "bg4";
"fg" = "fg";
"modifiers" = [ "bold" ];
};
"ui.cursor" = {
"bg" = "fg";
"fg" = "bg0";
};
"ui.cursor.insert" = {
"bg" = "grey";
"fg" = "black";
};
"ui.cursor.match" = {
"bg" = "diff_yellow";
"fg" = "orange";
};
"ui.cursor.select" = {
"bg" = "blue";
"fg" = "bg0";
};
"ui.cursorline.primary" = { "bg" = "bg1"; };
"ui.cursorline.secondary" = { "bg" = "bg1"; };
"ui.help" = {
"bg" = "bg2";
"fg" = "fg";
};
"ui.linenr" = "grey";
"ui.linenr.selected" = "fg";
"ui.menu" = {
"bg" = "bg3";
"fg" = "fg";
};
"ui.menu.selected" = {
"bg" = "green";
"fg" = "bg0";
};
"ui.popup" = {
"bg" = "bg2";
"fg" = "grey";
};
"ui.selection" = { "bg" = "bg4"; };
"ui.statusline" = {
"bg" = "bg3";
"fg" = "fg";
};
"ui.statusline.inactive" = {
"bg" = "bg1";
"fg" = "grey";
};
"ui.statusline.insert" = {
"bg" = "yellow";
"fg" = "bg0";
"modifiers" = [ "bold" ];
};
"ui.statusline.normal" = {
"bg" = "fg";
"fg" = "bg0";
"modifiers" = [ "bold" ];
};
"ui.statusline.select" = {
"bg" = "blue";
"fg" = "bg0";
"modifiers" = [ "bold" ];
};
"ui.text" = "fg";
"ui.text.focus" = "green";
"ui.virtual.indent-guide" = { "fg" = "bg4"; };
"ui.virtual.ruler" = { "bg" = "bg2"; };
"ui.virtual.whitespace" = { "fg" = "bg4"; };
"ui.window" = {
"bg" = "bg0";
"fg" = "grey";
};
"variable" = "fg";
"variable.builtin" = "orange";
"variable.other.member" = "fg";
"variable.parameter" = "fg";
"warning" = "yellow";
palette = import (./. + "/palettes/${palette}.nix");
}

View file

@ -1,25 +0,0 @@
{
black = "#181a1c";
bg0 = "#2b2d3a";
bg1 = "#333648";
bg2 = "#363a4e";
bg3 = "#393e53";
bg4 = "#3f445b";
bg_red = "#ff6188";
diff_red = "#55393d";
bg_green = "#a9dc76";
diff_green = "#394634";
bg_blue = "#77d5f0";
diff_blue = "#354157";
diff_yellow = "#4e432f";
fg = "#e1e3e4";
red = "#fb617e";
orange = "#f89860";
yellow = "#edc763";
green = "#9ed06c";
cyan = "#ef9062"; # added for compatibility with `edge` scheme
blue = "#6dcae8";
purple = "#bb97ee";
grey = "#7e8294";
grey_dim = "#5a5e7a";
}

View file

@ -1,81 +0,0 @@
{ config, inputs, pkgs, ... }:
{
programs.direnv = {
enable = true;
enableBashIntegration = true;
nix-direnv.enable = true;
};
programs.bash = {
enable = true;
bashrcExtra = ''
eval "$(direnv hook bash)"
'';
};
programs.wezterm = {
package = inputs.wezterm.packages.${pkgs.system}.default;
enable = true;
enableBashIntegration = true;
extraConfig = ''
return {
enable_wayland = true
}
'';
};
home.username = "nero";
home.homeDirectory = "/home/nero";
home.stateVersion = "25.05";
home.file = {
".terraformrc".text = ''
provider_installation {
network_mirror {
url = "https://terraform-mirror.yandexcloud.net/"
include = ["registry.terraform.io/*/*"]
}
direct {
exclude = ["registry.terraform.io/*/*"]
}
}
'';
".cargo/config.toml" = {
text = ''
[net]
git-fetch-with-cli = true
[target.x86_64-unknown-linux-gnu]
linker = "${pkgs.clang}/bin/clang"
rustflags = ["-C", "link-arg=--ld-path=${pkgs.mold}/bin/mold"]
'';
};
};
dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
gtk-theme = "Adwaita-dark";
};
};
gtk = {
enable = true;
theme = {
name = "Adwaita-dark";
package = pkgs.gnome-themes-extra;
};
};
xdg.portal = {
enable = true;
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
configPackages = with pkgs; [ xdg-desktop-portal-gtk ];
};
qt = {
enable = true;
platformTheme.name = "Adwaita-dark";
style = {
name = "Adwaita-dark";
package = pkgs.adwaita-qt;
};
};
}

View file

@ -1,38 +0,0 @@
{ lib, config, inputs, pkgs, ... }:
let
hypr = config.maid.hypr;
in
{
options.maid.hypr = {
enable = lib.mkEnableOption "hyprland";
};
config = lib.mkIf hypr.enable {
programs.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
};
programs.hyprlock = {
enable = true;
};
environment.systemPackages = with pkgs; [
dunst
waybar
wofi
hyprshot
];
environment.sessionVariables.NIXOS_OZONE_WL = "1";
fonts.packages = with pkgs; [
font-awesome_5
];
qt = {
enable = true;
platformTheme = "gnome";
style = "adwaita-dark";
};
};
}

View file

@ -1,18 +0,0 @@
{ config, lib, pkgs, ... }:
let
kde = config.maid.kde;
in
{
options.maid.kde = {
enable = lib.mkEnableOption "KDE6";
};
config = lib.mkIf kde.enable {
services.desktopManager.plasma6.enable = true;
environment.plasma6.excludePackages = with pkgs.kdePackages; [
plasma-browser-integration
konsole
oxygen
];
};
}

View file

@ -1,7 +0,0 @@
{
imports = [
./nero.nix
];
users.mutableUsers = false;
}

View file

@ -1,37 +0,0 @@
{ lib, pkgs, config, ... }:
let
types = lib.types;
masters = config.maid.masters;
hm = config.maid.hm;
mkUser = name: {
enable = lib.mkEnableOption name;
override = lib.mkOption {
type = types.attrs;
default = {};
};
};
in
{
options.maid.masters = {
nero = mkUser "nero";
};
config = lib.mkIf masters.nero.enable {
sops.secrets."users/nero/passwordHash" = {
neededForUsers = true;
sopsFile = ../../secrets/users.yaml;
};
users.users.nero = {
isNormalUser = true;
uid = 1000;
hashedPasswordFile = config.sops.secrets."users/nero/passwordHash".path;
extraGroups = [ "networkmanager" "docker" "wheel" "adbuser" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBaWnT7mpLERhm3zIWglNy094a7F7d7cpEImLZYwwWoS nero@lil-maid"
];
} // masters.nero.override;
};
}

View file

@ -1,27 +0,0 @@
{ pkgs, config, inputs, lib, ... }:
let
rust = config.maid.rust;
in
{
options.maid.rust = {
enable = lib.mkEnableOption "rust toolchain";
};
config = lib.mkIf rust.enable {
nixpkgs.overlays = [ inputs.fenix.overlays.default ];
environment.systemPackages = with pkgs; [
(fenix.complete.withComponents [
"rustc"
"cargo"
"rustfmt"
"rust-src"
"rust-analyzer"
"clippy"
"miri"
])
sccache
cargo-edit
];
};
}

View file

@ -1,17 +0,0 @@
{ config, lib, ... }:
let
sddm = config.maid.sddm;
in
{
options.maid.sddm = {
enable = lib.mkEnableOption "sddm";
};
config.services.displayManager.sddm = lib.mkIf sddm.enable {
enable = true;
enableHidpi = true;
wayland = {
enable = true;
};
};
}

View file

@ -1,3 +0,0 @@
{
}

View file

@ -1,27 +0,0 @@
{ lib, config, ... }:
let
sops = config.maid.sops;
in
{
options.maid.sops = {
enable = lib.mkEnableOption "sops";
work.enable = lib.mkEnableOption "work secrets";
viendesu.enable = lib.mkEnableOption "VienDesu!";
};
config.sops = lib.mkIf sops.enable {
age.keyFile = "/var/lib/sops-nix/key.txt";
secrets = lib.mkMerge [
(lib.mkIf sops.viendesu.enable {
"viendesu/shadowsocks/gneg".sopsFile = ../secrets/viendesu.yaml;
"viendesu/shadowsocks/yor".sopsFile = ../secrets/viendesu.yaml;
})
(lib.mkIf sops.work.enable {
"work/ovpn".sopsFile = ../secrets/work.yaml;
"work/password".sopsFile = ../secrets/work.yaml;
})
];
};
}

View file

@ -1,59 +0,0 @@
{ pkgs, lib, config, inputs, ... }:
let
types = lib.types;
sys = config.maid.sys;
in
{
options.maid.sys = {
enable = lib.mkEnableOption "whole maid system";
tz = lib.mkOption {
type = types.str;
default = "Europe/Moscow";
};
hostname = lib.mkOption {
type = types.str;
};
bluetooth = {
enable = lib.mkEnableOption "bluetooth";
powerOnBoot = lib.mkOption {
type = types.bool;
default = true;
description = "whether to power on bluetooth on system startup";
};
};
};
config = lib.mkIf sys.enable {
time.timeZone = sys.tz;
networking.hostName = sys.hostname;
services.gvfs.enable = true;
nix.settings = {
substituters = [
"https://hyprland.cachix.org"
"https://wezterm.cachix.org"
];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"wezterm.cachix.org-1:kAbhjYUC9qvblTE+s7S+kl5XM1zVa4skO+E/1IDWdH0="
];
experimental-features = [ "nix-command" "flakes" ];
};
environment.systemPackages = with pkgs; [
ifuse
libimobiledevice
usbutils
glib
];
services.usbmuxd.enable = true;
hardware.bluetooth = lib.mkIf sys.bluetooth.enable {
enable = true;
powerOnBoot = sys.bluetooth.powerOnBoot;
};
};
}

View file

@ -1,14 +0,0 @@
{ config, lib, ... }:
let
unfree = config.maid.unfree;
types = lib.types;
in
{
options.maid.unfree = lib.mkOption {
type = types.listOf types.str;
description = "unfree software list";
default = [];
};
config.nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.maid.unfree;
}

View file

@ -1,38 +0,0 @@
{ pkgs, lib, config, ... }:
let
types = lib.types;
hft = config.maid.vpn.hft;
proxies = config.maid.proxies;
in
{
options.maid.vpn.hft = {
enable = lib.mkEnableOption "OpenVPN HFT";
autoStart = lib.mkOption {
type = types.bool;
default = false;
description = "Whether to start VPN on system start";
};
};
config = lib.mkIf hft.enable {
assertions = [
{ assertion = proxies.yor.enable;
message = "HFT OpenVPN requires shadowsocks server to bypass DPI";
}
];
services.openvpn.servers.hft = {
autoStart = hft.autoStart;
updateResolvConf = true;
config = ''
config ${config.sops.secrets."work/ovpn".path}
askpass ${config.sops.secrets."work/password".path}
'';
};
systemd.services.openvpn-hft.requires = [
"yor-proxy.service"
];
};
}

View file

@ -1,23 +0,0 @@
{ config, lib, pkgs, ... }:
let
cfg = config.maid.proxies;
in
{
options.maid.proxies = {
yor = {
enable = lib.mkEnableOption "Yor shadowsocks proxy";
};
};
config = lib.mkIf cfg.yor.enable {
systemd.services.yor-proxy = {
after = [ "network.target" ];
description = "`Yor` proxy server";
serviceConfig = {
Type = "simple";
ExecStart = ''${pkgs.shadowsocks-rust}/bin/sslocal --config ${config.sops.secrets."viendesu/shadowsocks/yor".path}'';
};
};
};
}

15
modules/default.nix Normal file
View file

@ -0,0 +1,15 @@
{ inputs, ... }:
{
imports = [
inputs.sops-nix.nixosModules.sops
inputs.home-manager.nixosModules.home-manager
./vpn
./net.nix
./sops.nix
./sound.nix
./rust.nix
./haskell.nix
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
}

9
modules/haskell.nix Normal file
View file

@ -0,0 +1,9 @@
{ config, lib, pkgs, ... }:
{
#environment.systemPackages = with pkgs; [
# haskell.compiler.ghc983
# haskellPackages.cabal-install
# haskellPackages.haskell-language-server
#];
}

5
modules/net.nix Normal file
View file

@ -0,0 +1,5 @@
{ config, lib, pkgs, ... }:
{
networking.networkmanager.enable = true;
}

18
modules/rust.nix Normal file
View file

@ -0,0 +1,18 @@
{ config, lib, pkgs, inputs, ... }:
{
nixpkgs.overlays = [ inputs.fenix.overlays.default ];
environment.systemPackages = with pkgs; [
(fenix.complete.withComponents [
"rustc"
"cargo"
"rustfmt"
"rust-src"
"rust-analyzer"
"clippy"
"miri"
])
sccache
cargo-edit
];
}

5
modules/sops.nix Normal file
View file

@ -0,0 +1,5 @@
{ config, lib, pkgs, ... }:
{
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
}

15
modules/sound.nix Normal file
View file

@ -0,0 +1,15 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
pavucontrol
];
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
}

View file

@ -1,3 +1,5 @@
{ config, lib, pkgs, ... }:
{
imports = [
./hft.nix

19
modules/vpn/hft.nix Normal file
View file

@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:
let
secrets = config.sops.secrets;
in
{
sops.secrets."work/ovpn".sopsFile = ../../secrets/work.yaml;
sops.secrets."work/password".sopsFile = ../../secrets/work.yaml;
services.openvpn.servers.hft = {
autoStart = false;
updateResolvConf = true;
config = ''
config ${secrets."work/ovpn".path}
askpass ${secrets."work/password".path}
'';
};
systemd.services.openvpn-hft.requires = ["yor-proxy.service"];
}

View file

@ -0,0 +1,20 @@
{ config, lib, pkgs, ... }:
let
secrets = config.sops.secrets;
yorCfg = secrets."viendesu/shadowsocks/yor".path;
in
{
sops.secrets = {
"viendesu/shadowsocks/gneg".sopsFile = ../../secrets/viendesu.yaml;
"viendesu/shadowsocks/yor".sopsFile = ../../secrets/viendesu.yaml;
};
systemd.services.yor-proxy = {
after = [ "network.target" ];
description = "`Yor` shadowsocks";
serviceConfig = {
Type = "simple";
ExecStart = ''${pkgs.shadowsocks-rust}/bin/sslocal --config ${yorCfg}'';
};
};
}