Compare commits

...

84 Commits

Author SHA1 Message Date
b86cc94d23 hosts/suwako: prevent spam on gitea
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-11-11 22:40:48 +05:30
95825c6ff1 hosts/suwako: use 2 filehost services :wowo:
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-11-11 22:35:36 +05:30
3e7e404d4c home: emacs:use lsp-deferred on progmode 2025-10-26 02:54:40 +05:30
bb4c77208d even more changes
add isearch count support to evil
add highlight-indent-guides-mode

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-10-22 13:30:05 +05:30
1f53cd2efb home: emacs: delete unused conf
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-10-22 13:29:09 +05:30
d9f8c16011 home: emacs: add olivetti and nyan-mode
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-10-18 22:34:35 +05:30
4335805701 home: emacs some more changes
- Fix benchmark-deactivate on init
- defer loading aidermacs and gptel
- also set evil-want-keybinding to nil: https://github.com/emacs-evil/evil-collection/issues/6
2025-10-18 18:08:07 +05:30
Amneesh Singh
4a18ae77fc home: emacs: update config
remove auto flexpair and use electric mode instead
add gptel
add aidermacs

Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-10-17 17:41:56 +05:30
Amneesh Singh
5ebf3c9c5e home: amneesh: pkgs: add libreoffice and git-repo
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-10-17 11:55:12 +05:30
Amneesh Singh
f4e5628238 home: amneesh: use overlay for standalone home-manager
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-10-17 11:54:45 +05:30
Amneesh Singh
bf00621b02 home: amneesh: add screen config
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-10-17 11:53:28 +05:30
Amneesh Singh
ec8d9fafdd home: common: fix zsh GREP_COLORS
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-10-17 11:52:29 +05:30
539b46393e home/natto: emacs: some changes
add savehist
add blamer
tweak lsp to not format at RET

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-16 02:27:44 +05:30
Amneesh Singh
e686aef94e home: amneesh: wrap hypridle with nixGL
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-09-11 12:22:57 +05:30
54c45411fe home/natto: hyprlock: use pixels instead of percentages
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-10 18:58:50 +05:30
Amneesh Singh
23d6f855ee home: amneesh: update home.packages
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-09-10 18:57:54 +05:30
Amneesh Singh
346c304427 home: amneesh: add hypridle, hyprlock and hyprpaper
override pam for unix_chkpwd

Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-09-10 18:54:55 +05:30
0bab44bf04 home/natto: add hyprlock,hypridle and hyprpaper
also move hyprland.conf -> hyprland.nix

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-10 16:40:42 +05:30
5579bf49c3 hosts/okina: cleanup
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-04 17:42:34 +05:30
11a8dfebff hosts/suwako: move gitea from marisa to suwako
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-04 16:35:31 +05:30
c2a1654be8 hosts/suwako: move filehost from marisa to suwako
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-04 15:32:44 +05:30
6d431bdf9d hosts/remilia: networking: add suwako public wg key
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-04 13:12:39 +05:30
5dc4e6d3c0 hosts/remilia: mailserver: dovecot2 directory migration
changed stateVersion to 3

More: https://nixos-mailserver.readthedocs.io/en/latest/migrations.html#dovecot-mail-directory-migration

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-04 13:11:46 +05:30
5c1c326baf hosts/suwako: mailserver: dovecot2 directory migration
changed stateVersion to 3

More: https://nixos-mailserver.readthedocs.io/en/latest/migrations.html#dovecot-mail-directory-migration

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-04 12:16:55 +05:30
4e5b555498 hosts/security: fix cert path
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-04 11:48:32 +05:30
895a495b3f hosts/suwako: split service files
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-09-04 11:48:29 +05:30
7e4a6ac8fe hosts: housekeeping
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-08-31 19:34:44 +05:30
cd52be2620 home: natto: add me@amneesh.com to neomutt
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-08-30 20:05:25 +05:30
34b2c4d015 hosts/suwako: add mailserver for amneesh.com
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-08-30 16:46:44 +05:30
Amneesh Singh
943956f119 home: amneesh: add wayvnc and more pkgs
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-08-29 13:20:00 +05:30
Amneesh Singh
27f3b76ab7 home: natto: restart ags 10s after failure
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-08-28 18:49:02 +05:30
Amneesh Singh
4decf54e13 home: amneesh: wrap hyprland in nixGL
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-08-25 18:16:18 +05:30
Amneesh Singh
abd567a8a5 home: amneesh: move ubuntu->arch and use existing config
Signed-off-by: Amneesh Singh <amneesh@ti.com>
2025-08-25 18:04:40 +05:30
5785832cbe home: emacs: use vertico+consult instead of selectrum
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-07-02 22:31:00 +05:30
0eacdcdc27 home: emacs: move config files
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-07-02 21:42:25 +05:30
0890c49887 hosts/remilia: mailserver: change certificateScheme
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-07-02 00:37:22 +05:30
fb94547fa2 hosts/hina: change rootfs disk path to by-label
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-07-02 00:31:54 +05:30
c10e121604 hosts/remilia: change rootfs disk path to by-label
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-07-02 00:31:09 +05:30
8a87dc6c93 hosts/remilia: add stateVersion in mailserver
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-07-02 00:30:57 +05:30
5db9d23792 hosts/suwako: add pufferpanel (minecraft paper)
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 20:49:40 +05:30
1651bb9356 home: move amneesh to its own directory
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 19:51:33 +05:30
a9d4f6de5a treewide: format files
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 19:49:39 +05:30
404f35c0b9 home/natto: delete unused
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 19:44:41 +05:30
9baf54ef33 home/natto: split wayland.nix
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 19:40:28 +05:30
5a9ff77a29 home/natto: split programs.nix
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 19:34:12 +05:30
87a6c1a862 home: refactor common files
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 19:23:07 +05:30
43660ff173 home: ags: use v1
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 18:57:27 +05:30
fe6d79edb5 pkgs: remove tlauncher
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 18:56:41 +05:30
da4309e2e0 hosts: make security settings common
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 18:49:58 +05:30
e1e72965f9 hosts: move pipewire to services/
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 18:31:53 +05:30
0979956f16 hosts: enable dconf on desktop
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 18:27:59 +05:30
28c9799f60 hosts: move wayland portal to home
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 18:18:27 +05:30
f9e29ce77f hosts: move xserver to services/
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 18:05:23 +05:30
f4a8493dce hosts: delete minimal.nix
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:55:35 +05:30
e097c9d25f hosts: move neovim to programs/
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:54:17 +05:30
58ab2f07a7 hosts: move nix settings to its own file
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:50:50 +05:30
e1faa10e24 hosts: move doas to its own module
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:45:10 +05:30
f9ed56123d hosts: move git to its own module
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:45:08 +05:30
30934f006c hosts: rename modules -> programs
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:33:24 +05:30
31bec468c8 hosts: move gnupg into a module
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:31:33 +05:30
6c1400e295 hosts: move adb into a module
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:28:47 +05:30
8d3bbe9d75 hosts: move fonts to home-manager
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:28:04 +05:30
4f96bcda1d hosts: split zsh into a module
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-29 17:27:55 +05:30
0ecd267fa8 home: zsh: fix prezto config
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-14 17:24:32 +05:30
c590fb01dc home: natto: rename deprecated stuff
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-14 17:24:32 +05:30
d9a9d110de home: natto: edit hyprland config
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-14 17:24:32 +05:30
09f2e19683 hosts: satori: rename opengl -> graphics
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-14 17:24:32 +05:30
8b12178bfc hosts: okina: update disk configuration
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-14 17:24:32 +05:30
4f0f6021e5 hosts: rename font
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-14 17:24:32 +05:30
00ead02ff1 flake: update
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2025-06-14 17:24:32 +05:30
5e54dfded8 hosts/suwako: init
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-10-20 15:59:58 +05:30
Amneesh Singh
eac8c77797 home/amneesh: update
Signed-off-by: Amneesh Singh <a-singh21@ti.com>
2024-07-12 09:51:21 +05:30
Amneesh Singh
3aab004b55 home/amneesh: init 2024-07-08 17:49:02 +05:30
270d7c2fe4 hosts/okina: add wireguard config
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-28 20:22:50 +05:30
4c87e635ab hosts/remilia: update wireguard keys
Signed-off-by: natto1784 <natto@weirdnatto.in>
2024-06-28 20:22:21 +05:30
129fa4973f conf: add okina
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-28 18:49:19 +05:30
075ee51920 hosts: minor change
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-28 18:29:26 +05:30
aeb370f299 satori: im taking this HDD with me for some time
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-28 18:29:04 +05:30
edf8d639b3 emacs: minor fix
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-28 17:41:48 +05:30
090c069a11 hosts/okina: add onevpl
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-12 00:13:48 +05:30
f230a60a73 home/natto/ags: add margin to the right of settings
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-04 19:50:37 +05:30
ca1ea8f701 hosts/okina: add avahi daemon for printer discovery (for now)
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-04 19:30:16 +05:30
570bafce6a home/natto/emacs: remove treemacs magit
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-04 17:11:44 +05:30
8fd337d099 home/natto/emacs: just use defaultInitFile
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2024-06-04 16:58:29 +05:30
111 changed files with 2870 additions and 1697 deletions

View File

@@ -1,6 +1,6 @@
#Catpuccin Mocha
let
colors = rec{
colors = rec {
rosewater = "#F5E0DC";
flamingo = "#F2CDCD";
pink = "#F5C2E7";
@@ -37,5 +37,9 @@ in
rec {
default = with builtins; mapAttrs (_: color: substring 1 6 color) colors; # hex without hash
hex = colors; # hex with hash
argb = { a ? "ff" }: builtins.mapAttrs (_:color: a + color) default; # ARGB
argb =
{
a ? "ff",
}:
builtins.mapAttrs (_: color: a + color) default; # ARGB
}

View File

@@ -9,10 +9,14 @@
marisa = "${ipPrefix}.2";
satori = "${ipPrefix}.3";
hina = "${ipPrefix}.4";
okina = "${ipPrefix}.5";
suwako = "${ipPrefix}.6";
};
};
domain = {
natto = "weirdnatto.in";
amneesh = "amneesh.com";
chutiya = "chutiya.online";
};
};

897
flake.lock generated

File diff suppressed because it is too large Load Diff

113
flake.nix
View File

@@ -1,56 +1,13 @@
{
description = "dotfiles";
inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixpkgs-unstable;
stable.url = github:nixos/nixpkgs/release-24.05;
flake-parts.url = github:hercules-ci/flake-parts;
home-manager = {
url = github:nix-community/home-manager;
inputs.nixpkgs.follows = "nixpkgs";
};
mailserver = {
url = gitlab:simple-nixos-mailserver/nixos-mailserver;
inputs.nixpkgs.follows = "nixpkgs";
};
filehost = {
url = github:natto1784/simpler-filehost;
};
nix-gaming.url = github:fufexan/nix-gaming;
nbfc = {
url = github:nbfc-linux/nbfc-linux;
inputs.nixpkgs.follows = "nixpkgs";
};
emacs-overlay.url = github:nix-community/emacs-overlay;
nvim-overlay.url = github:nix-community/neovim-nightly-overlay;
hyprland = {
type = "git";
url = "https://github.com/hyprwm/Hyprland";
submodules = true;
};
hyprland-contrib = {
url = github:hyprwm/contrib;
};
agenix.url = github:ryantm/agenix;
ags.url = github:Aylur/ags;
};
outputs = inputs@{ self, ... }:
outputs =
inputs@{ self, ... }:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" ];
systems = [
"x86_64-linux"
"aarch64-linux"
];
imports = [
./hosts
@@ -59,10 +16,13 @@
./conf
];
perSystem = { system, pkgs, ... }:
perSystem =
{ system, pkgs, ... }:
rec {
formatter = pkgs.nixpkgs-fmt;
devShells.default = with pkgs; mkShell {
formatter = pkgs.nixfmt-tree;
devShells.default =
with pkgs;
mkShell {
packages = [
nixd
formatter
@@ -73,4 +33,53 @@
};
};
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
stable.url = "github:nixos/nixpkgs/release-24.05";
flake-parts.url = "github:hercules-ci/flake-parts";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
mailserver = {
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
inputs.nixpkgs.follows = "nixpkgs";
};
filehost = {
url = "github:natto1784/yamaf";
};
nix-gaming.url = "github:fufexan/nix-gaming";
nbfc = {
url = "github:nbfc-linux/nbfc-linux";
inputs.nixpkgs.follows = "nixpkgs";
};
emacs-overlay.url = "github:nix-community/emacs-overlay";
nvim-overlay.url = "github:nix-community/neovim-nightly-overlay";
hyprland = {
type = "git";
url = "https://github.com/hyprwm/Hyprland";
submodules = true;
};
hyprland-contrib = {
url = "github:hyprwm/contrib";
};
agenix.url = "github:ryantm/agenix";
ags.url = "github:Aylur/ags/v1";
nixgl.url = "github:nix-community/nixGL";
};
}

8
home/README Normal file
View File

@@ -0,0 +1,8 @@
natto : default user for okina (desktop - NixOS Unstable)
natto-laptop : default user for satori (laptop - NixOS Unstable)
bat : default user for remilia (Oracle VM - NixOS Unstable)
spin : default user for hina (Oracle VM - NixOS Unstable)
spark : default user for marisa (RPi4 - NixOS Unstable)
kero : default user for suwako (ARM OracleVM - NixOS Unstable)
amneesh : default user for nightbug (Workplace PC - Arch Linux)

37
home/amneesh/default.nix Normal file
View File

@@ -0,0 +1,37 @@
{
config,
pkgs,
inputs,
...
}:
{
home = {
homeDirectory = "/home/amneesh";
username = "amneesh";
stateVersion = "24.05";
};
targets.genericLinux.enable = true;
imports = [
./pkgs.nix
./nixgl.nix
./screen.nix
./wayvnc.nix
# From personal
../natto/ags
../natto/emacs.nix
../natto/browser.nix
../natto/dunst.nix
../natto/gtk.nix
../natto/cursor.nix
../natto/wayland.nix
../natto/hypridle.nix
../natto/hyprlock.nix
../natto/hyprpaper.nix
../natto/hyprland.nix
../natto/tofi.nix
../natto/foot.nix
];
}

29
home/amneesh/nixgl.nix Normal file
View File

@@ -0,0 +1,29 @@
{
config,
lib,
pkgs,
inputs,
...
}:
let
inherit (inputs) nixgl;
inherit (inputs.hyprland.packages.${pkgs.system}) hyprland;
inherit (config.lib.nixGL) wrap;
in
{
nixGL = {
packages = nixgl.packages;
defaultWrapper = "mesa";
offloadWrapper = "nvidiaPrime";
installScripts = [
"mesa"
"nvidiaPrime"
];
};
# hyprland
wayland.windowManager.hyprland.package = lib.mkForce (wrap hyprland);
# hypridle
services.hypridle.package = lib.mkForce (wrap pkgs.hypridle);
}

29
home/amneesh/pkgs.nix Normal file
View File

@@ -0,0 +1,29 @@
{
pkgs,
inputs,
...
}:
{
xdg.mime.enable = true;
programs = {
bash.enable = true;
};
home.packages = with pkgs; [
cmake
corkscrew
dtc
file
htop
llvmPackages.clang
(nattovim.override { nvimPackage = inputs.nvim-overlay.packages.${pkgs.system}.neovim; })
meson
ninja
thunderbird
wget
xfce.thunar
libreoffice
git-repo
];
}

12
home/amneesh/screen.nix Normal file
View File

@@ -0,0 +1,12 @@
{ pkgs, ... }:
{
home = {
packages = [ pkgs.screen ];
file = {
".screenrc".text = ''
defscrollback 10000
'';
};
};
}

13
home/amneesh/wayvnc.nix Normal file
View File

@@ -0,0 +1,13 @@
{
...
}:
{
services.wayvnc = rec {
enable = true;
autoStart = enable;
settings = {
address = "0.0.0.0";
port = 5900;
};
};
}

View File

@@ -0,0 +1,4 @@
{ ... }:
{
programs.direnv.enable = true;
}

View File

@@ -0,0 +1,20 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
fira-code
fira-mono
monoid
font-awesome
material-icons
material-design-icons
lohit-fonts.devanagari
lohit-fonts.gurmukhi
office-code-pro
eb-garamond
noto-fonts-cjk-sans
takao
liberation_ttf
];
fonts.fontconfig.enable = true;
}

View File

@@ -1,8 +0,0 @@
{ config, ... }:
{
programs = {
home-manager.enable = true;
password-store.enable = true;
direnv.enable = true;
};
}

View File

@@ -1,4 +1,4 @@
{ ... }:
{ lib, ... }:
{
programs.zsh = {
enable = true;
@@ -16,9 +16,13 @@
prompt.theme = "pure";
autosuggestions.color = "fg=yellow,bold";
utility.safeOps = false;
extraConfig = lib.mkBefore ''
export GREP_COLORS="mt=01;31"
'';
};
initExtra = ''
initContent = lib.mkAfter ''
unsetopt extendedGlob
[[ -f ~/.zsh_custom ]] && source ~/.zsh_custom
'';
};
}

View File

@@ -1,84 +1,122 @@
{ self, inputs, globalArgs, ... }:
{
self,
inputs,
globalArgs,
...
}:
let
common = [
./common/zsh.nix
./common/programs.nix
{ programs.home-manager.enable = true; }
./common/zsh
./common/direnv
./common/laptop.nix
inputs.agenix.homeManagerModules.default
];
mkPkgs = system: import inputs.nixpkgs {
mkPkgs =
system: overlays:
import inputs.nixpkgs {
inherit system;
config = {
allowUnfree = true;
allowBroken = true;
allowInsecure = true;
};
overlays = [ self.overlays.default ];
overlays = overlays ++ [ self.overlays.default ];
};
extraSpecialArgs = globalArgs;
in
{
flake.homeConfigurations =
let
nattoModules = [
./natto
./common/laptop.nix
inputs.agenix.homeManagerModules.default
] ++ common;
in
{
flake.homeConfigurations = {
natto-laptop = inputs.home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs;
modules = nattoModules ++ [
modules = [
./natto
./common/fonts
{ isLaptop = true; }
];
pkgs = mkPkgs "x86_64-linux";
]
++ common;
pkgs = mkPkgs "x86_64-linux" [ ];
};
natto = inputs.home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs;
modules = nattoModules;
pkgs = mkPkgs "x86_64-linux";
modules = [
./natto
./common/fonts
]
++ common;
pkgs = mkPkgs "x86_64-linux" [ ];
};
}
// {
spark = inputs.home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs;
modules = [{
modules = [
{
home = {
homeDirectory = "/home/spark";
username = "spark";
stateVersion = "23.05";
};
}] ++ common;
pkgs = mkPkgs "aarch64-linux";
}
]
++ common;
pkgs = mkPkgs "aarch64-linux" [ ];
};
bat = inputs.home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs;
modules = [{
modules = [
{
home = {
homeDirectory = "/home/bat";
username = "bat";
stateVersion = "23.05";
};
}] ++ common;
pkgs = mkPkgs "x86_64-linux";
}
]
++ common;
pkgs = mkPkgs "x86_64-linux" [ ];
};
spin = inputs.home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs;
modules = [{
modules = [
{
home = {
homeDirectory = "/home/spin";
username = "spin";
stateVersion = "23.05";
};
}] ++ common;
pkgs = mkPkgs "x86_64-linux";
}
]
++ common;
pkgs = mkPkgs "x86_64-linux" [ ];
};
kero = inputs.home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs;
modules = [
{
home = {
homeDirectory = "/home/kero";
username = "kero";
stateVersion = "24.05";
};
}
]
++ common;
pkgs = mkPkgs "aarch64-linux" [ ];
};
amneesh = inputs.home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs;
modules = [
./amneesh
]
++ common;
pkgs = mkPkgs "x86_64-linux" [ (import ./overlays/standalone.nix) ];
};
};
}

View File

@@ -1,8 +1,16 @@
{ pkgs, lib, config, inputs, ... }:
{
pkgs,
lib,
config,
inputs,
...
}:
let
cfg = config.programs.ags;
deps = with pkgs; [
deps =
with pkgs;
[
sass
gawk
bash
@@ -11,12 +19,13 @@ let
imagemagick
systemd
config.wayland.windowManager.hyprland.package
] ++ lib.optional config.isLaptop brightnessctl;
]
++ lib.optional config.isLaptop brightnessctl;
configDir = lib.cleanSourceWith {
src = ./.;
filter = name: _:
filter =
name: _:
let
baseName = baseNameOf (toString name);
in
@@ -28,7 +37,10 @@ in
inputs.ags.homeManagerModules.default
];
programs.ags.enable = true;
programs.ags = {
enable = true;
# package = pkgs.ags_1;
};
xdg.configFile."ags" = {
source = configDir;
@@ -47,6 +59,7 @@ in
Environment = "PATH=${lib.makeBinPath deps}";
ExecStart = "${cfg.package}/bin/ags";
Restart = "on-failure";
RestartSec = 10;
};
Install.WantedBy = [ "graphical-session.target" ];
};

View File

@@ -1,6 +1,7 @@
.settings {
.settings-unwrapped {
margin-top: 10px;
margin-right: 10px;
border: 2px solid $mauve;
border-radius: 4px;
background: $base;

18
home/natto/browser.nix Normal file
View File

@@ -0,0 +1,18 @@
{ pkgs, ... }:
{
programs = {
firefox = {
enable = true;
profiles.natto = {
name = "natto";
};
};
chromium = {
enable = true;
package = pkgs.ungoogled-chromium;
};
};
home.sessionVariables = {
BROWSER = "firefox";
};
}

View File

@@ -1,5 +1,5 @@
#+TITLE: My Emacs Configuration
#+AUTHOR: Amneesh Singh
#+AUTHOR: natto1784
#+PROPERTY: header-args :emacs-lisp :tangle yes
* Settings
@@ -20,12 +20,10 @@
(fringe-mode 0)
(global-display-line-numbers-mode 1)
(xterm-mouse-mode 1)
(electric-pair-mode)
(setq ring-bell-function 'ignore
gc-cons-threshold most-positive-fixnum
initial-major-mode 'fundamental-mode)
(unless (display-graphic-p)
(require 'evil-terminal-cursor-changer)
(evil-terminal-cursor-changer-activate))
#+end_src
** Setting some variables
@@ -36,7 +34,9 @@
scroll-step 1
display-line-numbers-type 'relative
confirm-kill-processes nil
inhibit-startup-screen t)
inhibit-startup-screen t
isearch-lazy-count t
lazy-count-prefix-format "[%s/%s] ")
(setq-default tab-width 2
indent-tabs-mode nil)
#+end_src
@@ -60,8 +60,7 @@
#+begin_src emacs-lisp
(use-package benchmark-init
:config
;; To disable collection of benchmark data after init is done.
:init (benchmark-init/deactivate))
(add-hook 'after-init-hook 'benchmark-init/deactivate) )
#+end_src
** Visual packages
@@ -81,32 +80,55 @@
(dark-theme t))
#+end_src
** Configure Selectrum
Enable selectrum
*** Indent guides
#+begin_src emacs-lisp
(use-package selectrum
:defer t
(use-package highlight-indent-guides
:config
(selectrum-mode +1))
(setq highlight-indent-guides-method 'column)
:hook
(prog-mode . highlight-indent-guides-mode))
#+end_src
Add selectrum-prescient
** Minibuffer
Enable vertico
#+begin_src emacs-lisp
(use-package selectrum-prescient
:config
(selectrum-prescient-mode +1)
(prescient-persist-mode +1))
(use-package vertico
:init
(vertico-mode)
:bind (:map vertico-map
("C-j" . vertico-next)
("C-k" . vertico-previous)))
#+end_src
Save history over restarts
#+begin_src emacs-lisp
(use-package savehist
:init
(savehist-mode))
#+end_src
Marginalia for description
#+begin_src emacs-lisp
(use-package marginalia
:after vertico
:config
(marginalia-mode 1))
#+end_src
Orderless
#+begin_src emacs-lisp
(use-package orderless
:after selectrum
:after vertico
:config
(setq completion-styles '(orderless basic))
(savehist-mode)
(setq orderless-skip-highlighting (lambda () selectrum-is-active)
selectrum-highlight-candidates-function #'orderless-highlight-matches))
(setq completion-styles '(orderless basic)))
#+end_src
Consult
#+begin_src emacs-lisp
(use-package consult
:bind (("M-s M-g" . consult-grep)
("M-s M-f" . consult-find)
("M-s M-b" . consult-buffer)))
#+end_src
** Evil
@@ -127,6 +149,7 @@ Add selectrum-prescient
(use-package evil
:init
(setq-default evil-shift-width 2)
(setq evil-want-keybinding nil)
:config
(evil-set-initial-state 'vterm-mode 'insert)
(evil-set-undo-system 'undo-tree)
@@ -135,6 +158,22 @@ Add selectrum-prescient
(evil-mode 1))
#+end_src
*** Evil related packages
#+begin_src emacs-lisp
(use-package evil-collection
:after evil
:ensure t
:config
(evil-collection-init))
(use-package evil-terminal-cursor-changer
:after evil
:if (not (display-graphic-p))
:config
(evil-terminal-cursor-changer-activate))
(use-package evil-anzu :after evil)
#+end_src
*** Configure undo tree
To undo and redo easily like vi
#+begin_src emacs-lisp
@@ -145,13 +184,6 @@ To undo and redo easily like vi
(global-undo-tree-mode 1))
#+end_src
*** Miscellaneous evil related packages
#+begin_src emacs-lisp
(use-package evil-terminal-cursor-changer)
(use-package evil-anzu
:after evil)
#+end_src
** Treemacs
*** Configure treemacs
#+begin_src emacs-lisp
@@ -161,7 +193,6 @@ To undo and redo easily like vi
(treemacs-project-follow-mode))
(use-package treemacs-evil :after treemacs)
(use-package treemacs-magit :after treemacs)
(use-package treemacs-projectile :after treemacs)
(use-package treemacs-all-the-icons :after treemacs)
#+end_src
@@ -171,7 +202,9 @@ To undo and redo easily like vi
#+begin_src emacs-lisp
(use-package lsp-mode
:defer t
:commands lsp)
:commands lsp
:init (setq lsp-enable-on-type-formatting nil)
:hook (prog-mode . lsp-deferred))
#+end_src
*** Configure lsp-ui
@@ -213,7 +246,6 @@ For autocomplete
(add-to-list 'company-backends 'company-dabbrev)
(setq company-backends (append '(company-files) (remove 'company-files company-backends)))
:hook (after-init . global-company-mode))
#+end_src
*** Configure company-quickhelp
@@ -244,6 +276,8 @@ For autocomplete
** Languages
#+begin_src emacs-lisp
(use-package dts-mode
:mode ("\\.dts\\'" "\\.dtsi\\'" "\\.overlay\\'"))
(use-package lsp-haskell
:mode "\\.hs\\'")
(use-package lsp-latex
@@ -264,11 +298,26 @@ For autocomplete
:mode "\\.go\\'")
#+end_src
** Magit
** Git
magit for git operations
#+begin_src emacs-lisp
(use-package magit :defer t)
#+end_src
blamer for git blame
#+begin_src emacs-lisp
(use-package blamer
:defer 20
:custom
(blamer-idle-time 0.3)
(blamer-min-offset 70)
:config
(global-blamer-mode 1)
:init
(setq blamer-show-avatar-p nil
blamer-max-commit-message-length 72))
#+end_src
** VTerm
*** Configure vterm
#+begin_src emacs-lisp
@@ -319,26 +368,64 @@ Do not use centaur tabs for now
#+end_src
** Misc packages
*** Icons
For installing icons
#+begin_src emacs-lisp
(use-package all-the-icons
:defer t
:if (display-graphic-p))
#+end_src
(use-package elcord :defer t)
*** Projectile
For tracking project root
#+begin_src emacs-lisp
(use-package projectile
:defer t
:config
(define-key projectile-mode-map (kbd "C-x p") 'projectile-command-map)
(projectile-mode +1))
#+end_src
*** Rainbow
For highlighting colors
#+begin_src emacs-lisp
(use-package rainbow-mode :defer t)
#+end_src
*** Rainbow delimiters
To make distinguishing parens easier
#+begin_src emacs-lisp
(use-package rainbow-delimiters
:hook (prog-mode . rainbow-delimiters-mode))
(use-package flex-autopair)
#+end_src
*** Olivetti
When you want write prose or something similar
#+begin_src emacs-lisp
(use-package olivetti
:defer t
:diminish olivetti-mode
:custom
(olivetti-body-width 100)
(olivetti-minimum-body-width 50)
(olivetti-style 'fancy)
(olivetti-recall-visual-line-mode-entry-state t)
:config
(defvar-local my/olivetti--saved-line-numbers nil
"Stores the previous value of `display-line-numbers` before enabling Olivetti.")
(defun my/olivetti-toggle-line-numbers ()
"Hide line numbers when entering Olivetti, restore when exiting."
(if olivetti-mode
(progn
(setq my/olivetti--saved-line-numbers display-line-numbers)
(setq display-line-numbers nil))
(setq display-line-numbers my/olivetti--saved-line-numbers)))
(add-hook 'olivetti-mode-hook #'my/olivetti-toggle-line-numbers))
#+end_src
** Org
** Add org-mode
#+begin_src emacs-lisp
@@ -386,22 +473,31 @@ Do not use centaur tabs for now
(latex . t)))
#+end_src
* Mode specific hooks
#+begin_src emacs-lisp
(add-hook 'c-mode-hook 'lsp)
(add-hook 'c++-mode-hook 'lsp)
(add-hook 'haskell-mode-hook #'lsp)
(add-hook 'haskell-literate-mode-hook #'lsp)
#+end_src
* Random eye candy stuff
* Custom mode line
switched to doom modeline after using my own modeline for a while
* Mode line
** Doom modeline
Switched to doom modeline after using my own modeline for a while
#+begin_src emacs-lisp
(use-package doom-modeline
:init (doom-modeline-mode 1))
#+end_src
Also show columns
#+begin_src emacs-lisp
(column-number-mode 1)
#+end_src
** Nyan Mode
#+begin_src emacs-lisp
(use-package nyan-mode
:ensure t
:init
(when (display-graphic-p)
(nyan-mode 1))
:custom
(nyan-animate-nyancat t)
:config
(nyan-start-animation))
#+end_src
* Pop-up terminal
Stolen from [[https://www.reddit.com/r/emacs/comments/ft84xy/run_shell_command_in_new_vterm/][this]] reddit post
@@ -429,33 +525,35 @@ Stolen from [[https://www.reddit.com/r/emacs/comments/ft84xy/run_shell_command_i
(vterm-send-return)))
#+end_src
Compilation shortcuts for standalone files
* LLMs
** gptel
#+begin_src emacs-lisp
(defun candrun ()
(let ((full buffer-file-name)
(file (file-name-sans-extension buffer-file-name)))
(pcase (file-name-extension full)
("c" (concat "gcc " full " -lm -pthread -o " file " && " file " && rm " file))
("java" (concat "java " full))
("py" (concat "python " full))
("cpp" (concat "g++ " full " -o " file " && " file " && rm " file))
("cc" (concat "g++ " full " -o " file " && " file " && rm " file))
("hs" (concat "runhaskell " full))
("sh" (concat "sh " full))
("js" (concat "node " full))
("ts" (concat "tsc " full " && node " file ".js && rm " file ".js" ))
("rs" (concat "rustc " full " -o " file " && " file " && rm " file)))))
(use-package gptel
:defer t
:config
(setq gptel-model 'claude-sonnet-4-20250514
gptel-backend (gptel-make-anthropic "Claude"
:stream t
:protocol "https"
:key (getenv "ANTHROPIC_API_KEY")
:host (getenv "ANTHROPIC_API_BASE_DOMAIN")))
(setq gptel-default-mode 'org-mode)
:bind (("C-c g" . gptel)))
#+end_src
* Custom Functions
** Aidermacs
#+begin_src emacs-lisp
(defun detach-process ()
"Run processes but detached from the parent"
(interactive)
(let ((command (read-string "Enter command:")))
(call-process-shell-command (concat command " &") nil 0)))
(use-package aidermacs
:defer t
:bind (("C-c a" . aidermacs-transient-menu))
:custom
; See the Configuration section below
(aidermacs-default-chat-mode 'architect)
(aidermacs-default-model "sonnet"))
#+end_src
* Keybinds
** General
*** Colemak translations
@@ -503,7 +601,7 @@ not using this anymore
"M-C-k" 'enlarge-window
"C-q" 'delete-window
"M-C-S-q" 'kill-buffer-and-window
"M-w" 'centaur-tabs--kill-this-buffer-dont-ask
"M-w" (lambda () (interactive) (kill-buffer (current-buffer)))
"M-S-w" 'kill-window)
#+end_src
@@ -516,8 +614,7 @@ not using this anymore
"<f4>" (lambda () (interactive) (vterm t))
"C-S-t" 'vterm-toggle-cd
"C-t" 'vterm-toggle
"<f1>" 'vterm-toggle
"<f5>" (lambda () (interactive) (run-in-vterm (candrun))))
"<f1>" 'vterm-toggle)
(general-define-key
:keymaps 'vterm-mode-map
"<f3>" 'vterm-toggle-forward

View File

@@ -1,173 +0,0 @@
monitor=, highrr, auto, 1, bitdepth, 10
input {
kb_layout = us
kb_variant = colemak_dh
kb_model =
kb_options =
kb_rules =
follow_mouse = 1
touchpad {
natural_scroll = yes
scroll_factor = 0.4
}
repeat_delay = 300
accel_profile = flat
}
general {
gaps_in = 5
gaps_out = 10
border_size = 2
# home-manager is going to override these
col.active_border = rgba(b4befeee) rgba(f5c2e7ff) 135deg
col.inactive_border = rgba(595959ff)
layout = dwindle
}
decoration {
rounding = 1
inactive_opacity = 0.8
drop_shadow = true
blur {
enabled = true
size = 8
new_optimizations = true
xray = true
}
}
animations {
enabled = yes
bezier =overshot,0.01, 0.9, 0.1, 1.05
bezier =easeoutexpo,0.16, 1, 0.3, 1
animation = windows, 1, 7, overshot, popin 50%
animation = windowsOut, 1, 7, easeoutexpo, popin 50%
animation = border, 1, 10, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, overshot
}
dwindle {
pseudotile = yes
preserve_split = yes
}
master {
new_is_master = false
}
gestures {
workspace_swipe = off
}
misc {
no_direct_scanout = true
disable_hyprland_logo = true
}
windowrule=float, ^.*(iwgtk)$
$mainMod=SUPER
binde=$mainMod, RETURN, exec, foot
bindr=SUPER, D, exec, pkill tofi || tofi-drun | xargs hyprctl dispatch exec --
bindr=SUPER SHIFT, D, exec, pkill tofi || tofi-run --require-match=false | xargs hyprctl dispatch exec --
$playerctl=playerctl -p 'playerctld,%any'
bind=$mainMod, P, exec, $playerctl play-pause
bind=, XF86AudioPlay, exec, $playerctl play-pause
bind=, XF86AudioNext, exec, $playerctl position 5+
bind=, XF86AudioPrev, exec, $playerctl position 5-
bind=$mainMod, XF86AudioNext, exec, $playerctl next
bind=$mainMod, XF86AudioPrev, exec, $playerctl previous
binde=, XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
binde=, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bind=, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
binde=, XF86MonBrightnessUp, exec, light -A 5
binde=, XF86MonBrightnessDown, exec, light -U 5
bind=$mainMod SHIFT, F1, exec, setxkbmap us colemak_dh
bind=$mainMod SHIFT, F2, exec, setxkbmap us basic
bind=$mainMod SHIFT, F3, exec, setxkbmap in deva
bind=$mainMod SHIFT, F4, exec, setxkbmap in guru
bind=$mainMod SHIFT, F5, exec, setxkbmap colemak dhz
bind=, PRINT, exec, grimblast --notify copysave screen
bind=SHIFT, PRINT, exec, grimblast --notify copysave area
binde=$mainMod SHIFT, Q, killactive,
bind=$mainMod ALT, f, exit,
bind=$mainMod SHIFT, t, pseudo,
bind=$mainMod, f, fullscreen,
bind=$mainMod, t, togglefloating,
bindm=SUPER, mouse:272, movewindow
bindm=SUPER, mouse:273, resizewindow
bind=$mainMod, left, movefocus, l
bind=$mainMod, h, movefocus, l
bind=$mainMod, right, movefocus, r
bind=$mainMod, l, movefocus, r
bind=$mainMod, up, movefocus, u
bind=$mainMod, k, movefocus, u
bind=$mainMod, down, movefocus, d
bind=$mainMod, j, movefocus, d
binde=$mainMod SHIFT, left, movewindow, l
binde=$mainMod SHIFT, h, movewindow, l
binde=$mainMod SHIFT, right, movewindow, r
binde=$mainMod SHIFT, l, movewindow, r
binde=$mainMod SHIFT, up, movewindow, u
binde=$mainMod SHIFT, k, movewindow, u
binde=$mainMod SHIFT, down, movewindow, d
binde=$mainMod SHIFT, j, movewindow, d
binde=SHIFT ALT, left, resizeactive, -10 0
binde=SHIFT ALT, h, resizeactive, -10 0
binde=SHIFT ALT, right, resizeactive, 10 0
binde=SHIFT ALT, l, resizeactive, 10 0
binde=SHIFT ALT, up, resizeactive, 0 -10
binde=SHIFT ALT, k, resizeactive, 0 -10
binde=SHIFT ALT, down, resizeactive, 0 10
binde=SHIFT ALT, j, resizeactive, 0 10
bind=$mainMod, 1, workspace, 1
bind=$mainMod, 2, workspace, 2
bind=$mainMod, 3, workspace, 3
bind=$mainMod, 4, workspace, 4
bind=$mainMod, 5, workspace, 5
bind=$mainMod, 6, workspace, 6
bind=$mainMod, 7, workspace, 7
bind=$mainMod, 8, workspace, 8
bind=$mainMod, 9, workspace, 9
bind=$mainMod, 0, workspace, 10
bind=$mainMod SHIFT, 1, movetoworkspacesilent, 1
bind=$mainMod SHIFT, 2, movetoworkspacesilent, 2
bind=$mainMod SHIFT, 3, movetoworkspacesilent, 3
bind=$mainMod SHIFT, 4, movetoworkspacesilent, 4
bind=$mainMod SHIFT, 5, movetoworkspacesilent, 5
bind=$mainMod SHIFT, 6, movetoworkspacesilent, 6
bind=$mainMod SHIFT, 7, movetoworkspacesilent, 7
bind=$mainMod SHIFT, 8, movetoworkspacesilent, 8
bind=$mainMod SHIFT, 9, movetoworkspacesilent, 9
bind=$mainMod SHIFT, 0, movetoworkspacesilent, 10
bind=$mainMod SHIFT, comma, focusmonitor, -1
bind=$mainMod SHIFT, period, focusmonitor, +1
bind=CTRL ALT, r, pass, ^(com\.obsproject\.Studio)$
exec-once=eww open bar
exec-once=swaybg -i ~/Wallpapers/current.*

13
home/natto/cursor.nix Normal file
View File

@@ -0,0 +1,13 @@
{ pkgs, ... }:
{
home.pointerCursor = {
package = pkgs.catppuccin-cursors.mochaFlamingo;
name = "catppuccin-mocha-flamingo-cursors";
size = 32;
x11 = {
enable = true;
defaultCursor = "crosshair";
};
gtk.enable = true;
};
}

View File

@@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }:
{ ... }:
{
home = {
homeDirectory = "/home/natto";
@@ -8,17 +8,32 @@
imports = [
./email.nix
./programs.nix
# ./xsession.nix
./wayland.nix
./pass.nix
./browser.nix
./pdf.nix
./mpv.nix
./pkgs.nix
./stuff.nix
./emacs.nix
./gtk.nix
./dunst.nix
./git.nix
./music.nix
./zsh.nix
./games.nix
./cursor.nix
./emacs.nix
# when xserver
# ./xsession.nix
# when wayland
./wayland.nix
./hyprpaper.nix
./hyprlock.nix
./hypridle.nix
./hyprland.nix
./foot.nix
./tofi.nix
./ags
];
}

View File

@@ -3,7 +3,9 @@
services = {
dunst = {
enable = true;
iconTheme = with config.gtk.iconTheme; { inherit name package; };
iconTheme = with config.gtk.iconTheme; {
inherit name package;
};
settings = with conf.colors.hex; {
global = {
mouse_left_click = "close_current";

View File

@@ -1,6 +1,6 @@
{ config, pkgs, inputs, lib, ... }:
{ pkgs, inputs, ... }:
let
emacs = pkgs.emacs-pgtk;
emacs = pkgs.emacs-git-pgtk;
configFile = ./config/emacs/config.org;
enable = true;
in
@@ -8,16 +8,6 @@ in
nixpkgs.overlays = [ inputs.emacs-overlay.overlays.default ];
home = {
file = {
"init.el" = {
source = pkgs.runCommandLocal "tangle-emacs" { } ''
${pkgs.coreutils}/bin/ln -s ${configFile} ./config.org
${emacs}/bin/emacs -Q --batch ./config.org -f org-babel-tangle
cp ./config.el $out
'';
target = "${config.home.homeDirectory}/.emacs.d/init.el";
};
};
shellAliases = rec {
e = "emacs";
enw = e + " -nw";
@@ -33,10 +23,22 @@ in
package = emacs;
alwaysEnsure = true;
alwaysTangle = true;
defaultInitFile = true;
extraEmacsPackages = epkgs: with epkgs; [
use-package
(tree-sitter-langs.withPlugins (_: tree-sitter-langs.plugins))
];
override = final: prev: {
evil = prev.melpaPackages.evil.overrideAttrs(_: {
src = pkgs.fetchFromGitHub {
owner = "natto1784";
repo = "evil";
rev = "isearch-lazy-count";
sha256 = "sha256-YqXoqPqOWRvszzktb0MYHMe590mzTQxCMgBloy3MHkQ=";
};
});
};
};
};
services.emacs = {

View File

@@ -1,19 +1,29 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
inputs,
conf,
...
}:
let
key = "53EC089EF230E47A83BA8F8195949BD4B853F559";
host = "mail.weirdnatto.in";
realName = "Amneesh Singh";
address = "natto@weirdnatto.in";
in
{
accounts.email = {
accounts = {
natto = rec {
inherit address realName;
natto =
let
domain = conf.network.addresses.domain.natto;
address = "natto@${domain}";
host = "mail.${domain}";
in
{
inherit realName address;
primary = true;
userName = address;
gpg = {
inherit key;
key = "3C4BDBE7BBF45B52C14EA193007257B05FCC86A8";
signByDefault = true;
};
imap = {
@@ -40,6 +50,45 @@ in
];
};
};
amneesh =
let
domain = conf.network.addresses.domain.amneesh;
address = "me@${domain}";
host = "mail.${domain}";
in
{
inherit address realName;
userName = address;
gpg = {
key = "0C2FDA374F2D48D9F9F0F7788EAAB36980C424C2";
signByDefault = true;
};
imap = {
inherit host;
tls.enable = true;
};
imapnotify.enable = true;
smtp = {
inherit host;
tls.enable = true;
};
mbsync = {
enable = true;
create = "both";
};
passwordCommand = "pass show email/${address}";
neomutt = {
enable = true;
extraMailboxes = [
"Sent"
"Drafts"
"Junk"
];
};
};
};
};
services = {
@@ -51,18 +100,17 @@ in
enable = true;
package = pkgs.neomutt;
sort = "reverse-date";
extraConfig =
lib.concatMapStringsSep
"\n"
builtins.readFile
[
extraConfig = lib.concatMapStringsSep "\n" builtins.readFile [
./config/neomutt/neomuttrc
./config/neomutt/theme
];
};
};
home = {
packages = with pkgs; [ mailcap w3m ];
packages = with pkgs; [
mailcap
w3m
];
file = {
mailcap = {
source = ./config/mailcap;

View File

@@ -1,11 +1,17 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
programs.eww = {
enable = true;
package = pkgs.eww;
configDir = lib.cleanSourceWith {
src = ./.;
filter = name: _:
filter =
name: _:
let
baseName = baseNameOf (toString name);
in
@@ -22,9 +28,8 @@
let
deps = [
config.programs.eww.package
] ++ lib.optional
config.wayland.windowManager.hyprland.enable
config.wayland.windowManager.hyprland.package
]
++ lib.optional config.wayland.windowManager.hyprland.enable config.wayland.windowManager.hyprland.package
++ (with pkgs; [
coreutils
bash
@@ -48,4 +53,3 @@
Install.WantedBy = [ "graphical-session.target" ];
};
}

34
home/natto/foot.nix Normal file
View File

@@ -0,0 +1,34 @@
{ conf, ... }:
{
programs = {
foot = {
enable = true;
settings = {
main = {
font = "Fira Mono:style=Regular:pixelsize=18";
font-bold = "Fira Mono:style=Bold:pixelsize=18";
};
scrollback.lines = 10000;
colors = with conf.colors.default; {
inherit foreground background;
regular0 = surface1;
regular1 = red;
regular2 = green;
regular3 = yellow;
regular4 = blue;
regular5 = pink;
regular6 = teal;
regular7 = subtext1;
bright0 = surface2;
bright1 = red;
bright2 = green;
bright3 = yellow;
bright4 = blue;
bright5 = pink;
bright6 = teal;
bright7 = subtext0;
};
};
};
};
}

View File

@@ -11,4 +11,3 @@
programs.mangohud.enable = true;
}

View File

@@ -3,7 +3,7 @@
gtk = {
enable = true;
theme = {
name = "Catppuccin-Mocha-Standard-Teal-Dark";
name = "catppuccin-mocha-teal-standard";
package = pkgs.catppuccin-gtk.override {
accents = [ "teal" ];
variant = "mocha";

29
home/natto/hypridle.nix Normal file
View File

@@ -0,0 +1,29 @@
{
pkgs,
config,
...
}:
let
lock = "${pkgs.systemd}/bin/loginctl lock-session";
timeout = 300;
in
{
# screen idle
services.hypridle = {
enable = true;
settings = {
general = {
before_sleep_cmd = lock;
lock_cmd = "pgrep hyprlock || ${config.programs.hyprlock.package}/bin/hyprlock";
};
listener = [
{
timeout = timeout;
on-timeout = lock;
}
];
};
};
}

207
home/natto/hyprland.nix Normal file
View File

@@ -0,0 +1,207 @@
{
pkgs,
inputs,
config,
lib,
conf,
...
}:
{
wayland = {
windowManager = {
hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland;
xwayland = {
enable = true;
};
settings = {
monitor = ", highrr, auto, 1";
input = {
kb_layout = "us,us";
kb_variant = "colemak_dh";
kb_model = "";
kb_options = "grp:rctrl_toggle";
kb_rules = "";
repeat_delay = 300;
accel_profile = "flat";
follow_mouse = true;
touchpad = {
natural_scroll = true;
scroll_factor = 0.4;
};
};
general = with conf.colors.argb { a = "ee"; }; {
gaps_in = 5;
gaps_out = 10;
border_size = 2;
layout = "dwindle";
"col.active_border" = "0x${mauve} 0x${flamingo} 135deg";
"col.inactive_border" = "0x${surface0}";
};
decoration = {
rounding = 1;
inactive_opacity = 0.8;
shadow = {
enabled = true;
};
blur = {
enabled = true;
size = 8;
new_optimizations = true;
xray = true;
};
};
animations = {
enabled = true;
bezier = [
"overshot,0.01,0.9,0.1,1.05"
"easeoutexpo,0.16,1,0.3,1"
];
animation = [
"windows,1,7,overshot,popin 50%"
"windowsOut,1,7,easeoutexpo,popin 50%"
"border,1,10,default"
"fade,1,7,default"
"workspaces,1,6,overshot"
];
};
cursor = {
no_hardware_cursors = true;
};
dwindle = {
pseudotile = true;
preserve_split = true;
};
misc = {
disable_hyprland_logo = true;
};
"$mod" = "SUPER";
bind =
let
playerctl = "playerctl -p 'playerctld,%any'";
in
[
# Hyprland operations
"$mod ALT, f, exit,"
"$mod SHIFT, t, pseudo,"
"$mod, f, fullscreen,"
"$mod, t, togglefloating,"
"$mod, left, movefocus, l"
"$mod, h, movefocus, l"
"$mod, right, movefocus, r"
"$mod, l, movefocus, r"
"$mod, up, movefocus, u"
"$mod, k, movefocus, u"
"$mod, down, movefocus, d"
"$mod, j, movefocus, d"
"$mod, 1, workspace, 1"
"$mod, 2, workspace, 2"
"$mod, 3, workspace, 3"
"$mod, 4, workspace, 4"
"$mod, 5, workspace, 5"
"$mod, 6, workspace, 6"
"$mod, 7, workspace, 7"
"$mod, 8, workspace, 8"
"$mod, 9, workspace, 9"
"$mod, 0, workspace, 10"
"$mod SHIFT, 1, movetoworkspacesilent, 1"
"$mod SHIFT, 2, movetoworkspacesilent, 2"
"$mod SHIFT, 3, movetoworkspacesilent, 3"
"$mod SHIFT, 4, movetoworkspacesilent, 4"
"$mod SHIFT, 5, movetoworkspacesilent, 5"
"$mod SHIFT, 6, movetoworkspacesilent, 6"
"$mod SHIFT, 7, movetoworkspacesilent, 7"
"$mod SHIFT, 8, movetoworkspacesilent, 8"
"$mod SHIFT, 9, movetoworkspacesilent, 9"
"$mod SHIFT, 0, movetoworkspacesilent, 10"
"$mod SHIFT, comma, focusmonitor, -1"
"$mod SHIFT, period, focusmonitor, +1"
# Launchers
"$mod, RETURN, exec, foot"
"$mod, D, exec, pkill tofi || tofi-drun | xargs hyprctl dispatch exec --"
"$mod SHIFT, D, exec, pkill tofi || tofi-run --require-match=false | xargs hyprctl dispatch exec --"
# Media
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
# Backlight
", XF86MonBrightnessUp, exec, light -A 5"
", XF86MonBrightnessDown, exec, light -U 5"
# XWayland Keymaps
"$mod SHIFT, F1, exec, setxkbmap us colemak_dh"
"$mod SHIFT, F2, exec, setxkbmap us basic"
# Screenshot
", PRINT, exec, grimblast --notify copysave screen"
"SHIFT, PRINT, exec, grimblast --notify copysave area"
# Playerctl
"$mod, P, exec, ${playerctl} play-pause"
", XF86AudioPlay, exec, ${playerctl} play-pause"
", XF86AudioNext, exec, ${playerctl} position 5+"
", XF86AudioPrev, exec, ${playerctl} position 5-"
"$mod, XF86AudioNext, exec, ${playerctl} next"
"$mod, XF86AudioPrev, exec, ${playerctl} previous"
];
binde = [
# Hyprland operations
"$mod SHIFT, Q, killactive,"
"$mod SHIFT, left, movewindow, l"
"$mod SHIFT, h, movewindow, l"
"$mod SHIFT, right, movewindow, r"
"$mod SHIFT, l, movewindow, r"
"$mod SHIFT, up, movewindow, u"
"$mod SHIFT, k, movewindow, u"
"$mod SHIFT, down, movewindow, d"
"$mod SHIFT, j, movewindow, d"
"SHIFT ALT, left, resizeactive, -10 0"
"SHIFT ALT, h, resizeactive, -10 0"
"SHIFT ALT, right, resizeactive, 10 0"
"SHIFT ALT, l, resizeactive, 10 0"
"SHIFT ALT, up, resizeactive, 0 -10"
"SHIFT ALT, k, resizeactive, 0 -10"
"SHIFT ALT, down, resizeactive, 0 10"
"SHIFT ALT, j, resizeactive, 0 10"
];
bindm = [
# Mouse
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
"$mod ALT, mouse:272, resizewindow"
];
exec-once = [
(with config.home.pointerCursor; "hyprctl setcursor ${name} ${toString size} ")
]
++ (with config.programs; lib.optional eww.enable "${eww.package}/bin/eww open bar");
};
};
};
};
}

80
home/natto/hyprlock.nix Normal file
View File

@@ -0,0 +1,80 @@
{
config,
pkgs,
conf,
...
}:
{
programs.hyprlock = {
enable = true;
settings = with conf.colors.argb { a = "ee"; }; {
general = {
hide_cursor = false;
};
background = [
{
monitor = "";
path = "screenshot";
blur_passes = 2;
}
];
input-field = [
{
monitor = "";
size = "300, 60";
outline_thickness = 4;
valign = "center";
halign = "center";
font_color = "0x${text}";
outer_color = "0x${mauve}";
inner_color = "0x${surface0}";
check_color = "0x${blue}";
fail_color = "0x${red}";
capslock_color = "0x${yellow}";
fade_on_empty = false;
hide_input = false;
placeholder_text = "Logged in as <b>$USER</b>";
fail_text = "Fail! <b>($ATTEMPTS)</b>";
dots_spacing = 0.2;
dots_center = true;
}
];
label = [
{
monitor = "";
text = "Layout: $LAYOUT";
font_size = 25;
color = "0x${text}";
position = "30, -30";
valign = "top";
halign = "left";
}
{
monitor = "";
text = "$TIME";
font_size = 90;
color = "0x${text}";
position = "-30, 0";
valign = "top";
halign = "right";
}
{
monitor = "";
text = "cmd[update:3600000] date +\"%A, %d %B %Y\"";
font_size = 25;
color = "0x${text}";
position = "-30, -150";
valign = "top";
halign = "right";
}
];
};
};
}

18
home/natto/hyprpaper.nix Normal file
View File

@@ -0,0 +1,18 @@
{
config,
...
}:
{
services.hyprpaper = {
enable = true;
settings =
let
wallpaper = "${config.home.homeDirectory}/wallpaper.png";
in
{
preload = [ "${wallpaper}" ];
wallpaper = [ ", ${wallpaper}" ];
};
};
}

13
home/natto/mpv.nix Normal file
View File

@@ -0,0 +1,13 @@
{ ... }:
{
programs = {
mpv = {
enable = true;
config = {
force-window = true;
keep-open = true;
save-position-on-quit = true;
};
};
};
}

View File

@@ -18,8 +18,7 @@ in
};
mpd-discord-rpc = {
# inherit (mpd) enable;
enable = false;
inherit (mpd) enable;
settings = {
id = 1039532008424099850; # dont really care
format = {
@@ -67,7 +66,7 @@ in
home = {
packages = with pkgs; [
playerctl
spotify
mpc_cli
(ncmpcpp.override {
visualizerSupport = true;
@@ -82,16 +81,13 @@ in
source = ./config/ncmpcpp/config;
target = "${config.xdg.configHome}/ncmpcpp/config";
};
sessionVariables = {
# LV2_PATH = lib.makeSearchPath "lib/lv2" (with pkgs; [ calf ]);
};
};
age.secrets.mpdasrc = {
file = ./secrets/mpdasrc.age;
path = "${home}/.config/mpdasrc";
symlink = false;
};
services.playerctld.enable = true;
}

6
home/natto/pass.nix Normal file
View File

@@ -0,0 +1,6 @@
{ ... }:
{
programs = {
password-store.enable = true;
};
}

18
home/natto/pdf.nix Normal file
View File

@@ -0,0 +1,18 @@
{ ... }:
{
programs = {
zathura = {
enable = true;
extraConfig = builtins.readFile ./config/zathura/zathurarc;
options = {
recolor = true;
recolor-lightcolor = "rgba(0,0,0,0)";
default-bg = "rgba(0,0,0,0.8)";
};
};
sioyek = {
enable = true;
};
};
}

View File

@@ -1,12 +1,18 @@
{ flake, pkgs, config, ... }:
{
home.packages = with pkgs; [
flake,
pkgs,
config,
...
}:
{
home.packages =
with pkgs;
[
# A/V, codec and media stuff
ffmpeg-full
wireplumber
pulseaudio
pavucontrol
spotify
imagemagick
# Utils
@@ -21,9 +27,8 @@
cachix
steam-run
# GUI utils
slack
webcord
# GUI
vesktop
(xfce.thunar.override {
thunarPlugins = with xfce; [
thunar-media-tags-plugin
@@ -36,39 +41,13 @@
qbittorrent
hexchat
dunst
gnome.zenity
# Programming and dev stuff
(texlive.combine {
inherit (texlive)
scheme-small
babel
lm
graphics-def
url
mhchem
wrapfig
capt-of
minted
fvextra
xstring
catchfile
framed
upquote
pdfsync
tocloft
enumitem
multirow
tcolorbox;
})
python3Packages.pygments
zenity
# Misc
anki
tor-browser-bundle-bin
mailcap
libsForQt5.qtstyleplugins
] ++ lib.optionals config.isLaptop [
]
++ lib.optionals config.isLaptop [
powertop
undervolt
];

View File

@@ -1,70 +0,0 @@
{ pkgs, config, conf, ... }:
{
programs = {
firefox = {
enable = true;
profiles.natto = {
name = "natto";
};
};
chromium = {
enable = true;
package = pkgs.ungoogled-chromium;
};
zathura = {
enable = true;
extraConfig = builtins.readFile ./config/zathura/zathurarc;
options = {
recolor = true;
recolor-lightcolor = "rgba(0,0,0,0)";
default-bg = "rgba(0,0,0,0.8)";
};
};
sioyek = {
enable = true;
};
go.enable = true;
foot = {
enable = true;
settings = {
main = {
font = "Fira Mono:style=Regular:pixelsize=18";
font-bold = "Fira Mono:style=Bold:pixelsize=18";
};
scrollback.lines = 4000;
colors = with conf.colors.default; {
inherit foreground background;
regular0 = surface1;
regular1 = red;
regular2 = green;
regular3 = yellow;
regular4 = blue;
regular5 = pink;
regular6 = teal;
regular7 = subtext1;
bright0 = surface2;
bright1 = red;
bright2 = green;
bright3 = yellow;
bright4 = blue;
bright5 = pink;
bright6 = teal;
bright7 = subtext0;
};
};
};
mpv = {
enable = true;
config = {
force-window = true;
keep-open = true;
save-position-on-quit = true;
};
};
};
home.sessionVariables = {
BROWSER = "firefox";
};
}

View File

@@ -1,4 +1,10 @@
{ config, lib, pkgs, ... }: {
{
config,
lib,
pkgs,
...
}:
{
xdg = {
enable = true;
userDirs.enable = true;
@@ -7,28 +13,20 @@
age.identityPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
home = {
pointerCursor = {
package = pkgs.catppuccin-cursors.mochaFlamingo;
name = "Catppuccin-Mocha-Flamingo-Cursors";
size = 32;
x11 = {
enable = true;
defaultCursor = "crosshair";
};
gtk.enable = true;
};
sessionVariables = {
QT_X11_NO_MITSHM = "1";
HM_CONF_DIR = "/etc/nixos";
QT_QPA_PLATFORMTHEME = "gtk2";
};
};
i18n = {
inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [ fcitx5-m17n fcitx5-mozc ];
enable = true;
type = "fcitx5";
fcitx5.addons = with pkgs; [
fcitx5-m17n
fcitx5-mozc
];
};
};
}

37
home/natto/tofi.nix Normal file
View File

@@ -0,0 +1,37 @@
{
conf,
pkgs,
config,
...
}:
{
home.file.tofi = {
source = pkgs.writeText "tofi-config" (
pkgs.lib.generators.toKeyValue { } (
with conf.colors.default;
{
# https://github.com/philj56/tofi/blob/master/themes/fullscreen
width = "100%";
height = "100%";
border-width = 0;
outline-width = 0;
padding-left = "35%";
padding-top = "35%";
result-spacing = 25;
num-results = 5;
font = "Fira Mono";
font-size = 15;
text-color = foreground;
selection-color = rosewater;
selection-match-color = red;
background-color = "#000A";
}
)
);
target = "${config.xdg.configHome}/tofi/config";
};
home.packages = with pkgs; [
tofi
];
}

View File

@@ -1,64 +1,11 @@
{ pkgs, config, conf, inputs, ... }:
{ pkgs, inputs, ... }:
{
imports = [
inputs.hyprland.homeManagerModules.default
./ags
# ./eww
];
wayland = {
windowManager = {
sway = {
enable = true;
};
hyprland = {
enable = true;
xwayland = {
enable = true;
};
extraConfig = (builtins.readFile ./config/hypr/hyprland.conf)
+ (with config.home.pointerCursor; ''
exec-once=hyprctl setcursor ${name} ${toString size}
'')
+ (with conf.colors.argb { a = "ee"; };''
general {
col.active_border = 0x${mauve} 0x${flamingo} 135deg
col.inactive_border = 0x${surface0}
}
'');
};
};
};
home.file.tofi = {
source = pkgs.writeText "tofi-config" (pkgs.lib.generators.toKeyValue { } (with conf.colors.default; {
# https://github.com/philj56/tofi/blob/master/themes/fullscreen
width = "100%";
height = "100%";
border-width = 0;
outline-width = 0;
padding-left = "35%";
padding-top = "35%";
result-spacing = 25;
num-results = 5;
font = "Fira Mono";
font-size = 15;
text-color = foreground;
selection-color = rosewater;
selection-match-color = red;
background-color = "#000A";
}));
target = "${config.xdg.configHome}/tofi/config";
};
home.packages = with pkgs; [
tofi
imv
grim
slurp
inputs.hyprland-contrib.packages.${pkgs.system}.grimblast
wl-clipboard
swayimg
swaybg
];
}

View File

@@ -1,4 +1,9 @@
{ pkgs, config, flake, ... }:
{
pkgs,
config,
flake,
...
}:
{
xsession = {
enable = true;

View File

@@ -3,9 +3,8 @@ let
secretPath = "${config.home.homeDirectory}/.zshenv_secret";
in
{
programs.zsh.initExtra = lib.mkForce ''
programs.zsh.initContent = lib.mkAfter ''
. ${secretPath};
unsetopt extendedGlob
'';
age.secrets.zshenv_secret = {

View File

@@ -0,0 +1,13 @@
final: prev:
let
pam = prev.pam.overrideAttrs (oa: {
postPatch = ''
substituteInPlace modules/module-meson.build \
--replace "sbindir / 'unix_chkpwd'" "'/usr/bin/unix_chkpwd'"
'';
});
in
{
hyprlock = prev.hyprlock.override { inherit pam; };
swaylock = prev.swaylock.override { inherit pam; };
}

View File

@@ -3,3 +3,4 @@
+ marisa is my Raspberry Pi 4 (B)
+ remilia is my cloud VM
+ hina is another cloud VM I use for ZNC
+ suwako is an ARM cloud VM

View File

@@ -0,0 +1,4 @@
{ ... }:
{
programs.adb.enable = true;
}

View File

@@ -0,0 +1,4 @@
{ ... }:
{
programs.dconf.enable = true;
}

View File

@@ -0,0 +1,16 @@
{ ... }:
{
security = {
doas = {
enable = true;
extraRules = [
{
groups = [ "wheel" ];
keepEnv = true;
persist = true;
setEnv = [ "PATH" ];
}
];
};
};
}

View File

@@ -0,0 +1,4 @@
{ ... }:
{
programs.git.enable = true;
}

View File

@@ -0,0 +1,9 @@
{ ... }:
{
programs.gnupg = {
agent = {
enableSSHSupport = true;
enable = true;
};
};
}

View File

@@ -3,6 +3,7 @@
nixpkgs = {
config = {
allowBroken = true;
allowUnfree = true;
};
overlays = [
self.overlays.default
@@ -15,14 +16,15 @@
'';
settings = {
auto-optimise-store = true;
trusted-users = [ "root" "natto" ];
trusted-users = [
"root"
"@wheel"
];
substituters = [
"https://nix-gaming.cachix.org"
"https://nix-community.cachix.org"
# "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"
"https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"
];
trusted-public-keys = [
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};

View File

@@ -0,0 +1,13 @@
{ ... }:
{
programs.zsh = {
enable = true;
histSize = 30000;
enableBashCompletion = true;
enableCompletion = true;
autosuggestions = {
enable = true;
highlightStyle = "fg=yellow,bold";
};
};
}

View File

@@ -0,0 +1,21 @@
{
lib,
conf,
config,
...
}:
let
domain = conf.network.addresses.domain.natto;
nginx = config.services.nginx;
in
{
security = {
acme = lib.mkIf nginx.enable {
acceptTerms = true;
certs = lib.mapAttrs (n: _: { email = "natto@${domain}"; }) (
lib.filterAttrs (_: v: v.enableACME) nginx.virtualHosts
);
};
pki.certificateFiles = [ ../../../cert.pem ];
};
}

View File

@@ -1,6 +1,5 @@
{ lib, config, pkgs, ... }: {
# sound stuff
sound.enable = true;
{ ... }:
{
services.pipewire = {
enable = true;
alsa = {

View File

@@ -1,17 +1,11 @@
{ config, lib, ... }:
#let
# compiledLayout = pkgs.runCommand "keyboard-layout" {} ''
# ${pkgs.xorg.xkbcomp}/bin/xkbcomp ${./colemak-dh.xkb} $out
# '';
#in
{
services = {
libinput = {
enable = true;
mouse = {
accelSpeed = "0";
# accelProfile = "flat";
};
touchpad = {
middleEmulation = false;
@@ -22,13 +16,9 @@
};
xserver = {
enable = true;
displayManager = {
startx = {
enable = true;
};
};
displayManager.startx.enable = true;
xkb.layout = "us";
xkb.variant = "colemak_dh"; # trying to ditch DHz now
xkb.variant = "colemak_dh";
autoRepeatDelay = 320;
autoRepeatInterval = 30;
};

View File

@@ -1,5 +1,10 @@
#Taken from https://github.com/MagicRB/dotfiles/blob/master/nix/nixos-modules/vault-agent.nix
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.vault-agent;
@@ -59,8 +64,7 @@ in
};
};
config = mkIf cfg.enable
({
config = mkIf cfg.enable ({
users = {
users = {
"${cfg.userName}" = {
@@ -84,9 +88,12 @@ in
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
path = (with pkgs; [
path = (
with pkgs;
[
glibc
]);
]
);
serviceConfig = {
User = cfg.userName;
Group = cfg.groupName;
@@ -103,4 +110,3 @@ in
};
});
}

View File

@@ -0,0 +1,26 @@
{ config, ... }:
{
nix = {
extraOptions = ''
builders-use-substitutes = true
'';
buildMachines = [
{
hostName = "okina";
systems = [
"x86_64-linux"
"aarch64-linux"
];
maxJobs = 4;
speedFactor = 2;
supportedFeatures = [
"nixos-test"
"benchmark"
"big-parallel"
"kvm"
];
}
];
distributedBuilds = true;
};
}

View File

@@ -3,19 +3,23 @@ let
inherit (inputs) nixpkgs;
commonModules = [
./nvim.nix
{
_module.args = globalArgs;
}
./common/programs/neovim
./common/programs/nix
./common/programs/zsh
./common/programs/gnupg
./common/programs/git
./common/programs/doas
./common/security
];
desktopModules = [
./xorg.nix
./wayland.nix
./nix.nix
./desktop-pkgs.nix
./sound.nix
./common/programs/adb
./common/programs/dconf
./common/services/xserver
./common/services/pipewire
];
serverModules = [ ./minimal.nix ];
in
{
flake.nixosConfigurations = {
@@ -45,8 +49,7 @@ in
modules = [
./marisa
]
++ commonModules
++ serverModules;
++ commonModules;
};
#Oracle Cloud VM
@@ -54,11 +57,10 @@ in
system = "x86_64-linux";
modules = [
./remilia
./x86builder.nix
./common/x86builder.nix
inputs.mailserver.nixosModules.mailserver
]
++ commonModules
++ serverModules;
++ commonModules;
};
#Oracle Cloud VM
@@ -66,10 +68,19 @@ in
system = "x86_64-linux";
modules = [
./hina
./x86builder.nix
./common/x86builder.nix
]
++ commonModules
++ serverModules;
++ commonModules;
};
#Oracle Cloud VM
suwako = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [
./suwako
inputs.mailserver.nixosModules.mailserver
]
++ commonModules;
};
};
}

View File

@@ -1,63 +0,0 @@
{ lib, config, inputs, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
tmux
bc
gnumake
pciutils
usbutils
ntfs3g
python3
htop
wget
ripgrep
kbd
gcc
vulkan-tools
vulkan-headers
jq
dconf
];
fonts.packages = with pkgs; [
fira-code
fira-mono
monoid
font-awesome
material-icons
material-design-icons
lohit-fonts.devanagari
lohit-fonts.gurmukhi
office-code-pro
eb-garamond
noto-fonts-cjk
takao
liberation_ttf
];
programs = {
git.enable = true;
gnupg = {
agent = {
enableSSHSupport = true;
enable = true;
};
};
zsh = {
enable = true;
histSize = 30000;
enableBashCompletion = true;
enableCompletion = true;
autosuggestions = {
enable = true;
highlightStyle = "fg=yellow,bold";
};
};
adb.enable = true;
gamemode.enable = true;
};
}

View File

@@ -3,9 +3,19 @@
boot = {
kernel.sysctl."net.ipv4.ip_forward" = 1;
initrd.kernelModules = [ "bochs" ];
initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" ];
initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"virtio_scsi"
];
kernelModules = [ "kvm-amd" ];
kernelParams = [ "console=ttyS0" "console=tty1" "nvme.shutdown_timeout=10" "libiscsi.debug_libiscsi_eh=1" ];
kernelParams = [
"console=ttyS0"
"console=tty1"
"nvme.shutdown_timeout=10"
"libiscsi.debug_libiscsi_eh=1"
];
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;

View File

@@ -1,4 +1,9 @@
{ config, pkgs, conf, ... }:
{
config,
pkgs,
conf,
...
}:
{
imports = [
./networking.nix
@@ -16,7 +21,6 @@
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = conf.network.commonSSHKeys;
};
programs.zsh.enable = true;
system.stateVersion = "21.11";
}

View File

@@ -1,14 +1,18 @@
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports =
[
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/d91adce2-9059-4a8a-86e7-dee6ecc85b2b";
fileSystems."/" = {
device = "/dev/disk/by-label/cloudimg-rootfs";
fsType = "ext4";
};

View File

@@ -1,13 +1,22 @@
{ lib, config, conf, pkgs, ... }:
{
lib,
config,
conf,
pkgs,
...
}:
{
networking = {
useDHCP = false;
hostName = "hina";
firewall =
{
firewall = {
interfaces = {
ens3 = {
allowedTCPPorts = [ 9898 80 443 ];
allowedTCPPorts = [
9898
80
443
];
};
};
};

View File

@@ -1,4 +1,10 @@
{ config, pkgs, lib, conf, ... }:
{
config,
pkgs,
lib,
conf,
...
}:
let
domain = conf.network.addresses.domain.natto;
in
@@ -31,12 +37,4 @@ in
};
};
};
security.acme = {
acceptTerms = true;
certs = lib.mapAttrs (n: _: { email = "natto@${domain}"; })
(lib.filterAttrs (_: v: v.enableACME) config.services.nginx.virtualHosts);
};
security.pki.certificateFiles = [ ../../cert.pem ];
}

View File

@@ -2,19 +2,33 @@
{
boot = {
consoleLogLevel = 7;
kernelParams = [ "console=ttyS0,115200n8" "console=ttyAMA0,115200n8" "console=tty0" ];
kernelParams = [
"console=ttyS0,115200n8"
"console=ttyAMA0,115200n8"
"console=tty0"
];
kernelPackages = pkgs.linuxPackages_5_10;
initrd.availableKernelModules = [ "xhci_pci" "usb_storage" "usbhid" "uas" "pcie-brcmstb" "vc4" ];
initrd.availableKernelModules = [
"xhci_pci"
"usb_storage"
"usbhid"
"uas"
"pcie-brcmstb"
"vc4"
];
loader = {
grub.enable = false;
generic-extlinux-compatible.enable = true;
/* raspberryPi= {
/*
raspberryPi= {
version = 4;
firmwareConfig = "dtparam=sd_poll_once=on";
enable = true;
}; */
};
/* kernelPatches = [
*/
};
/*
kernelPatches = [
{
name = "change-pgtable";
patch = null;
@@ -22,6 +36,7 @@
CONFIG_PGTABLE_LEVELS 4
'';
}
];*/
];
*/
};
}

View File

@@ -1,4 +1,9 @@
{ config, pkgs, conf, ... }:
{
config,
pkgs,
conf,
...
}:
{
imports = [
./networking.nix
@@ -14,10 +19,7 @@
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = conf.network.commonSSHKeys;
};
programs.zsh.enable = true;
time.timeZone = "Asia/Kolkata";
system.stateVersion = "21.05";
security.pki.certificateFiles = [ ../../cert.pem ../../consul-agent-ca.pem ];
}

View File

@@ -1,17 +1,20 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
fileSystems."/" =
{
fileSystems."/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
};
fileSystems."/nix/store" =
{
fileSystems."/nix/store" = {
device = "/nix/store";
fsType = "none";
options = [ "bind" ];

View File

@@ -1,4 +1,9 @@
{ config, pkgs, conf, ... }:
{
config,
pkgs,
conf,
...
}:
{
networking = {
hostName = "marisa";
@@ -7,10 +12,10 @@
22 # ssh
80 # http
# 5454
5001 #gitea
4646 #nomad
5001 # gitea
4646 # nomad
# 8500 #vault nomad consul
8000 #simpler-filehost
8000 # simpler-filehost
# 6666 #concourse
# 202 #gitea-ssh
];
@@ -25,16 +30,20 @@
interfaces = {
eth0 = {
ipv4.addresses = [{
ipv4.addresses = [
{
prefixLength = 24;
address = "192.168.1.159";
}];
}
];
};
wlan0 = {
ipv4.addresses = [{
ipv4.addresses = [
{
prefixLength = 24;
address = "192.168.1.159";
}];
}
];
};
};
wireguard.interfaces.wg0 = with conf.network.addresses.wireguard.ips; {
@@ -52,6 +61,9 @@
];
};
defaultGateway = "192.168.1.1";
nameservers = [ "1.1.1.1" "8.8.8.8" ];
nameservers = [
"1.1.1.1"
"8.8.8.8"
];
};
}

View File

@@ -3,33 +3,20 @@
imports = [
# ./hashicorp.nix
./filehost.nix
./gitea.nix
];
# Add secrets to nomad, consul and vault
virtualisation.docker = {
enable = true;
daemon.settings = {
# default-cgroupns-mode = "host";
};
};
services = {
openssh = {
enable = true;
ports = [ 22 22001 ];
ports = [
22
22001
];
};
postgresql = {
enable = true;
authentication = ''
local gitea all ident map=gitea-map
'';
identMap =
''
gitea-map gitea gitea
'';
};
};
}

View File

@@ -1,19 +0,0 @@
{ config, pkgs, inputs, conf, ... }:
{
systemd.services.filehost = {
enable = true;
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
Environment = [
"TITLE=nattofiles"
"USER_URL=https://f.${conf.network.addresses.domain.natto}"
"ROCKET_LIMITS={file=\"512MB\",data-form=\"512MB\"}"
"ROCKET_LOG_LEVEL=debug"
"ROCKET_ADDRESS=0.0.0.0"
];
Restart = "on-failure";
ExecStart = "${inputs.filehost.packages.${pkgs.system}.simpler-filehost}/bin/simpler-filehost";
};
};
}

View File

@@ -6,7 +6,10 @@
enable = true;
enableDocker = true;
dropPrivileges = false;
extraPackages = with pkgs; [ consul cni-plugins ];
extraPackages = with pkgs; [
consul
cni-plugins
];
extraSettingsPaths = [ "/run/nomad/nomad.json" ];
};
vault = {
@@ -27,4 +30,3 @@
};
};
}

View File

@@ -1,41 +0,0 @@
{ config, pkgs, ... }:
{
security = {
sudo.enable = false;
doas = {
enable = true;
extraRules = [
{
groups = [ "wheel" ];
keepEnv = true;
persist = true;
}
];
};
};
environment.systemPackages = with pkgs; [
git
htop
vim
tmux
wireguard-tools
nmap
gcc
];
programs = {
gnupg = {
agent = {
enable = true;
};
};
};
nix = {
extraOptions = ''
experimental-features = nix-command flakes
'';
settings.trusted-users = [ "root" ];
};
}

View File

@@ -1,21 +1,41 @@
{ lib, config, pkgs, ... }:
{
lib,
config,
pkgs,
...
}:
{
boot = {
kernelPackages = pkgs.linuxPackages;
initrd = {
availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
];
kernelModules = [ ];
};
kernelParams = [ "i915.force_probe=56a1" "resume_offset=11287312" ];
kernelParams = [ "i915.force_probe=56a1" ];
# kernelModules = [ "kvm-intel" "i2c-dev" "ddcci_backlight" ];
kernelModules = [ "kvm-intel" "i2c-dev" ];
kernelModules = [
"kvm-intel"
"i2c-dev"
];
# extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback r8125 ddcci-driver ];
extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback r8125 ];
extraModulePackages = with config.boot.kernelPackages; [
v4l2loopback
r8125
];
blacklistedKernelModules = [ "r8169" ];
extraModprobeConfig = ''options snd-intel-dspcfg dsp_driver=1 '';
resumeDevice = "/dev/disk/by-uuid/5679b901-3a70-4422-81f5-af91f287500b";
resumeDevice = "/dev/disk/by-uuid/3770e3bd-a200-4e36-b3a5-4963d13865f9";
loader = {
efi = {

View File

@@ -1,7 +1,6 @@
{ lib, config, ... }:
{
imports =
[
imports = [
./hardware.nix
./stuff.nix
./networking.nix

View File

@@ -1,42 +1,45 @@
{ config, lib, modulesPath, pkgs, ... }:
{
config,
lib,
modulesPath,
pkgs,
...
}:
{
imports =
[
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
fileSystems."/" =
{
fileSystems."/" = {
device = "/dev/disk/by-uuid/5679b901-3a70-4422-81f5-af91f287500b";
fsType = "btrfs";
options = [ "compress-force=zstd:3" ];
};
fileSystems."/boot/efi" =
{
fileSystems."/boot/efi" = {
device = "/dev/disk/by-uuid/A2E5-006F";
fsType = "vfat";
};
fileSystems."/media/omghi" =
{
fileSystems."/media/omghi" = {
device = "/dev/disk/by-uuid/0e862bdb-168a-42cc-8a28-0ae9e9a0753c";
fsType = "ext4";
};
fileSystems."/media/real" =
{
fileSystems."/media/real" = {
device = "/dev/disk/by-uuid/8086be20-c770-46be-bd8f-5bd2d7735c7d";
fsType = "btrfs";
options = [ "compress-force=zstd:3" ];
};
/* fileSystems."/media/ntfs" =
/*
fileSystems."/media/ntfs" =
{
device = "/dev/disk/by-uuid/54034ca6-d3cd-11ee-9e0c-f020ff87c985";
fsType = "ntfs";
};*/
};
*/
zramSwap = {
enable = true;
@@ -46,7 +49,7 @@
};
swapDevices = [
{ device = "/var/swap"; size = 32768; }
{ device = "/dev/disk/by-uuid/3770e3bd-a200-4e36-b3a5-4963d13865f9"; }
];
powerManagement = {
@@ -55,13 +58,19 @@
};
hardware = {
steam-hardware.enable = true;
bluetooth.enable = true;
cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
opengl = {
driSupport32Bit = true;
graphics = {
enable32Bit = true;
enable = true;
package = pkgs.mesa.drivers;
package32 = pkgs.pkgsi686Linux.mesa.drivers;
package = pkgs.mesa;
package32 = pkgs.pkgsi686Linux.mesa;
extraPackages = with pkgs; [
intel-media-driver
intel-compute-runtime
vpl-gpu-rt
];
};
};
}

View File

@@ -1,4 +1,10 @@
{ config, pkgs, conf, lib, ... }:
{
config,
pkgs,
conf,
lib,
...
}:
{
networking = {
@@ -10,21 +16,53 @@
};
firewall = {
allowedTCPPorts = [ 22 18172 6600 8001 7590 25565 9092 8096 ];
allowedUDPPorts = [ 22 17840 18172 ];
allowedTCPPorts = [
22
18172
6600
8001
7590
25565
9092
8096
];
allowedUDPPorts = [
22
17840
18172
];
trustedInterfaces = [ "docker0" ];
};
interfaces = {
/*
enp7s0 = {
ipv4.addresses = [{
prefixLength = 24;
address = "192.168.1.106";
}];
};
*/
};
defaultGateway = "192.168.1.1";
nameservers = [ "1.1.1.1" "8.8.8.8" ];
wireguard.interfaces.wg0 = with conf.network.addresses.wireguard.ips; {
ips = [ okina ];
listenPort = 17840;
privateKeyFile = "/var/secrets/wg.key";
peers = [
{
#Oracle VM1
publicKey = "z0Y2VNEWcyVQVSqRHiwmiJ5/0MgSPM+HZfEcwIccSxM=";
allowedIPs = [ remilia ];
endpoint = "${conf.network.addresses.domain.natto}:17840";
persistentKeepalive = 25;
}
];
};
nameservers = [
"1.1.1.1"
"8.8.8.8"
];
};
}

View File

@@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }:
{
lib,
config,
pkgs,
...
}:
{
services = {
openssh = {
@@ -8,18 +13,21 @@
ratbagd.enable = true;
btrfs.autoScrub.enable = true;
gvfs.enable = true;
logind.extraConfig = "RuntimeDirectorySize=30%";
printing = {
enable = true;
drivers = [ pkgs.hplip ];
};
avahi = lib.mkIf config.services.printing.enable {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
};
systemd.services = {
libvirtd.wantedBy = lib.mkForce [ ];
};
security.pki.certificateFiles = [ ../../cert.pem ];
virtualisation = {
docker = {
enable = true;

View File

@@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }:
{
lib,
config,
pkgs,
...
}:
{
time.timeZone = "Asia/Kolkata";
@@ -8,25 +13,24 @@
rtkit.enable = true;
polkit.enable = true;
sudo.enable = true;
doas = {
enable = true;
extraRules = [
{
users = [ "natto" ];
keepEnv = true;
persist = true;
setEnv = [ "SSH_AUTH_SOCK" "PATH" "SHELL" ];
}
];
};
};
console.useXkbConfig = true;
users.users.natto = {
isNormalUser = true;
shell = pkgs.zsh;
home = "/home/natto";
extraGroups = [ "wheel" "adbusers" "video" "libvirtd" "docker" "networkmanager" "dialout" ];
extraGroups = [
"wheel"
"adbusers"
"video"
"libvirtd"
"docker"
"networkmanager"
"dialout"
"pipewire"
];
};
virtualisation = {

View File

@@ -3,9 +3,19 @@
boot = {
kernel.sysctl."net.ipv4.ip_forward" = 1;
initrd.kernelModules = [ "bochs" ];
initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" ];
initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"virtio_scsi"
];
kernelModules = [ "kvm-amd" ];
kernelParams = [ "console=ttyS0" "console=tty1" "nvme.shutdown_timeout=10" "libiscsi.debug_libiscsi_eh=1" ];
kernelParams = [
"console=ttyS0"
"console=tty1"
"nvme.shutdown_timeout=10"
"libiscsi.debug_libiscsi_eh=1"
];
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;

View File

@@ -1,4 +1,9 @@
{ config, pkgs, conf, ... }:
{
config,
pkgs,
conf,
...
}:
{
imports = [
./networking.nix
@@ -17,7 +22,6 @@
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = conf.network.commonSSHKeys;
};
programs.zsh.enable = true;
system.stateVersion = "21.11";
}

View File

@@ -1,14 +1,18 @@
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports =
[
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/d91adce2-9059-4a8a-86e7-dee6ecc85b2b";
fileSystems."/" = {
device = "/dev/disk/by-label/cloudimg-rootfs";
fsType = "ext4";
};

View File

@@ -1,14 +1,23 @@
{ config, pkgs, conf, network, ... }:
{
config,
pkgs,
conf,
network,
...
}:
{
mailserver =
let domain = conf.network.addresses.domain.natto; in
let
domain = conf.network.addresses.domain.natto;
in
rec {
enable = true;
stateVersion = 3;
fqdn = "mail.${domain}";
sendingFqdn = fqdn;
domains = [ domain ];
certificateDomains = [ "mail.${domain}" ];
certificateScheme = 3;
certificateScheme = "acme-nginx";
loginAccounts = {
"natto@${domain}" = {
hashedPasswordFile = "/var/secrets/natto@${domain}.key";

View File

@@ -1,26 +1,43 @@
{ lib, config, conf, pkgs, ... }:
{
lib,
config,
conf,
pkgs,
...
}:
{
networking = {
useDHCP = false;
hostName = "remilia";
firewall =
{
firewall = {
interfaces = {
ens3 = {
allowedTCPPorts = [ 80 81 443 444 993 465 143 25 22 22001 22002 4444 ]
allowedTCPPorts = [
80
81
443
444
993
465
143
25
22
22001
22002
4444
]
++ (map (x: x.sourcePort) config.networking.nat.forwardPorts);
allowedUDPPorts = [ 17840 ];
};
};
extraCommands = lib.concatMapStringsSep "\n"
(x:
extraCommands = lib.concatMapStringsSep "\n" (
x:
let
t = lib.splitString ":" x.destination;
in
with lib;
"iptables -t nat -A POSTROUTING -d ${head t} -p tcp -m tcp --dport ${last t} -j MASQUERADE"
)
config.networking.nat.forwardPorts;
) config.networking.nat.forwardPorts;
};
interfaces = {
ens3 = {
@@ -65,13 +82,21 @@
allowedIPs = [ ips.marisa ];
}
{
publicKey = "SqskEH7hz7Gv9ZS+FYLRFgKZyJCFbBFCyuvzBYnbfVU=";
publicKey = "oliAKHloLOulQrDwG+2NZIYg0sQAsuQ/q/lLkPCdcRE=";
allowedIPs = [ ips.satori ];
}
{
publicKey = "IHYIan9Xq2PBTSzcMdHpzx4PM67l09WdsGa6s+siyH0=";
allowedIPs = [ ips.hina ];
}
{
publicKey = "BRdWQYPyfZeEWGtghhoYZf90nOsU/kXB3vOFJ6A17Ao=";
allowedIPs = [ ips.okina ];
}
{
publicKey = "JriOM0LQr/YbdeIH++qY4O32vlcc8L2AC1MDoFGCpmA=";
allowedIPs = [ ips.suwako ];
}
];
};
};

View File

@@ -1,4 +1,10 @@
{ config, pkgs, lib, conf, ... }:
{
config,
pkgs,
lib,
conf,
...
}:
let
domain = conf.network.addresses.domain.natto;
in
@@ -8,7 +14,10 @@ in
openssh = {
enable = true;
settings.PermitRootLogin = "yes";
ports = [ 22 22002 ];
ports = [
22
22002
];
};
nginx = {
enable = true;
@@ -24,7 +33,13 @@ in
'';
virtualHosts =
let
genericHttpRProxy = { addr, ssl ? true, conf ? "" }: {
genericHttpRProxy =
{
addr,
ssl ? true,
conf ? "",
}:
{
enableACME = ssl;
# addSSL = ssl;
forceSSL = ssl;
@@ -33,11 +48,13 @@ in
extraConfig = ''
expires $expires;
proxy_set_header Host $host;
'' + conf;
''
+ conf;
};
};
in
with conf.network.addresses.wireguard.ips; {
with conf.network.addresses.wireguard.ips;
{
"${domain}" = {
addSSL = true;
enableACME = true;
@@ -47,11 +64,13 @@ in
};
serverAliases = [ "www.${domain}" ];
};
# "vault.${domain}" = genericHttpRProxy { addr = "https://${marisa}:8800"; };
# "consul.${domain}" = genericHttpRProxy { addr = "http://${marisa}:8500"; };
"f.${domain}" = genericHttpRProxy { addr = "http://${marisa}:8000"; };
# MPD server
"radio.${domain}" = genericHttpRProxy { addr = "http://${satori}:8001"; };
/* "radio.${domain}" = {
# Some random music server I once had
/*
"radio.${domain}" = {
addSSL = true;
enableACME = true;
locations."/" = {
@@ -62,13 +81,29 @@ in
'';
};
locations."= /".return = "301 /radio";
};*/
};
*/
# Gitea
/*
"git.${domain}" = genericHttpRProxy {
addr = "http://${marisa}:5001";
conf = "client_max_body_size 64M;";
};
/*"nomad.${domain}" = genericHttpRProxy {
*/
# Personal filehost
# "f.${domain}" = genericHttpRProxy { addr = "http://${marisa}:8000"; };
# Hashicorp Vault
# "vault.${domain}" = genericHttpRProxy { addr = "https://${marisa}:8800"; };
# Hashicorp Consul
# "consul.${domain}" = genericHttpRProxy { addr = "http://${marisa}:8500"; };
# Hashicorp Nomad
/*
"nomad.${domain}" = genericHttpRProxy {
addr = "http://${marisa}:4646";
conf = ''
proxy_buffering off;
@@ -79,15 +114,4 @@ in
};
};
};
security.acme = {
acceptTerms = true;
certs = {
"${domain}".extraDomainNames = lib.singleton "www.${domain}";
} //
lib.mapAttrs (n: _: { email = "natto@${domain}"; })
(lib.filterAttrs (_: v: v.enableACME) config.services.nginx.virtualHosts);
};
security.pki.certificateFiles = [ ../../cert.pem ];
}

View File

@@ -1,22 +1,49 @@
{ lib, config, pkgs, ... }:
{
lib,
config,
pkgs,
...
}:
{
boot = {
kernelPackages = pkgs.linuxPackages_latest;
initrd = {
availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "vfio-pci" ];
/* preDeviceCommands = ''
availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usb_storage"
"sd_mod"
"vfio-pci"
];
/*
preDeviceCommands = ''
DEVS="0000:01:00.0 0000:01:00.1 0000:01:00.2 0000:01:00.3"
for DEV in $DEVS; do
echo "vfio-pci" > /sys/bus/pci/devices/$DEV/driver_override
done
modprobe -i vfio-pci
'';*/
'';
*/
kernelModules = [ ];
};
kernelParams = [ "intel_pstate=active" "intel_iommu=on" "nvidia_drm.modeset=1" "clearcpuid=512" ];
kernelModules = [ "kvm-intel" "snd-seq" "snd-rawmidi" "joydev" ];
extraModulePackages = with config.boot.kernelPackages; [ nvidia_x11 v4l2loopback ];
kernelParams = [
"intel_pstate=active"
"intel_iommu=on"
"nvidia_drm.modeset=1"
"clearcpuid=512"
];
kernelModules = [
"kvm-intel"
"snd-seq"
"snd-rawmidi"
"joydev"
];
extraModulePackages = with config.boot.kernelPackages; [
nvidia_x11
v4l2loopback
];
loader = {
efi = {
canTouchEfiVariables = true;

View File

@@ -1,7 +1,6 @@
{ lib, config, ... }:
{
imports =
[
imports = [
./hardware.nix
./stuff.nix
./networking.nix

View File

@@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
let
nvidia-offload = pkgs.writeShellScriptBin "nvi" ''
export __NV_PRIME_RENDER_OFFLOAD=1
@@ -13,21 +18,25 @@ in
nvidia-offload
];
hardware = {
opengl = {
driSupport32Bit = true;
graphics = {
enable32Bit = true;
enable = true;
package = pkgs.mesa.drivers;
package32 = pkgs.pkgsi686Linux.mesa.drivers;
package = pkgs.mesa;
package32 = pkgs.pkgsi686Linux.mesa;
};
nvidia = {
package = config.boot.kernelPackages.nvidia_x11;
prime = {
# sync.enable = true;
offload = { enable = true; };
offload = {
enable = true;
};
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
modesetting = { enable = true; };
modesetting = {
enable = true;
};
powerManagement = {
enable = true;
finegrained = true;

View File

@@ -1,20 +1,27 @@
{ config, lib, modulesPath, ... }:
{
config,
lib,
modulesPath,
...
}:
{
imports =
[
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/4c02ddf5-d00e-4d84-856f-c327ae44d047";
fileSystems."/" = {
device = "/dev/disk/by-uuid/59af143c-1a87-4654-9b31-7594ac8ba530";
fsType = "ext4";
};
fileSystems."/media/real" = {
device = "/dev/disk/by-uuid/8086be20-c770-46be-bd8f-5bd2d7735c7d";
fsType = "btrfs";
options = [ "compress-force=zstd:3" ];
};
fileSystems."/boot/efi" =
{
fileSystems."/boot/efi" = {
device = "/dev/disk/by-uuid/2424-5639";
fsType = "vfat";
};
@@ -27,7 +34,10 @@
};
swapDevices = [
{ device = "/var/swap"; size = 4096; }
{
device = "/var/swap";
size = 4096;
}
];
powerManagement = {

View File

@@ -1,4 +1,9 @@
{ config, pkgs, conf, ... }:
{
config,
pkgs,
conf,
...
}:
{
networking = {
@@ -10,8 +15,20 @@
};
firewall = {
allowedTCPPorts = [ 22 18172 6600 8001 7590 25565 9092 ];
allowedUDPPorts = [ 22 17840 18172 ];
allowedTCPPorts = [
22
18172
6600
8001
7590
25565
9092
];
allowedUDPPorts = [
22
17840
18172
];
trustedInterfaces = [ "docker0" ];
};
@@ -19,16 +36,21 @@
ips = [ satori ];
listenPort = 17840;
privateKeyFile = "/var/secrets/wg.key";
peers = [{
peers = [
{
#Oracle VM1
publicKey = "z0Y2VNEWcyVQVSqRHiwmiJ5/0MgSPM+HZfEcwIccSxM=";
allowedIPs = [ remilia ];
endpoint = "${conf.network.addresses.domain.natto}:17840";
persistentKeepalive = 25;
}];
}
];
};
defaultGateway = "192.168.1.1";
nameservers = [ "1.1.1.1" "8.8.8.8" ];
nameservers = [
"1.1.1.1"
"8.8.8.8"
];
};
}

View File

@@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }:
{
lib,
config,
pkgs,
...
}:
{
services = {
openssh = {
@@ -21,7 +26,6 @@
libvirtd.wantedBy = lib.mkForce [ ];
};
security.pki.certificateFiles = [ ../../cert.pem ];
virtualisation = {
docker = {
enable = true;

View File

@@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }:
{
lib,
config,
pkgs,
...
}:
{
time.timeZone = "Asia/Kolkata";
@@ -8,26 +13,22 @@
rtkit.enable = true;
polkit.enable = true;
sudo.enable = true;
doas = {
enable = true;
extraRules = [
{
users = [ "natto" ];
keepEnv = true;
persist = true;
setEnv = [ "SSH_AUTH_SOCK" "PATH" "SHELL" ];
}
];
};
};
console.useXkbConfig = true;
users.users.natto = {
isNormalUser = true;
shell = pkgs.zsh;
home = "/home/natto";
extraGroups = [ "wheel" "adbusers" "video" "libvirtd" "docker" "networkmanager" "dialout" ];
extraGroups = [
"wheel"
"adbusers"
"video"
"libvirtd"
"docker"
"networkmanager"
"dialout"
];
};
virtualisation = {

24
hosts/suwako/boot.nix Normal file
View File

@@ -0,0 +1,24 @@
{ config, ... }:
{
boot = {
kernel.sysctl."net.ipv4.ip_forward" = 1;
initrd.kernelModules = [ "bochs" ];
initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"virtio_scsi"
];
kernelModules = [ "kvm-amd" ];
kernelParams = [
"console=ttyS0"
"console=tty1"
"nvme.shutdown_timeout=10"
"libiscsi.debug_libiscsi_eh=1"
];
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
};
}

27
hosts/suwako/default.nix Normal file
View File

@@ -0,0 +1,27 @@
{
config,
pkgs,
conf,
...
}:
{
imports = [
./networking.nix
./hardware.nix
./boot.nix
./services
./mailserver.nix
];
time.timeZone = "Asia/Kolkata";
users.users.kero = {
isNormalUser = true;
shell = pkgs.zsh;
home = "/home/kero";
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = conf.network.commonSSHKeys;
};
system.stateVersion = "24.05";
}

26
hosts/suwako/hardware.nix Normal file
View File

@@ -0,0 +1,26 @@
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
fileSystems."/" = {
device = "/dev/disk/by-label/cloudimg-rootfs";
fsType = "ext4";
};
swapDevices = [
{
device = "/swapfile";
size = 3084;
priority = 0;
}
];
}

View File

@@ -0,0 +1,26 @@
{
conf,
...
}:
{
mailserver =
let
domain = conf.network.addresses.domain.amneesh;
in
rec {
enable = true;
stateVersion = 3;
fqdn = "mail.${domain}";
sendingFqdn = fqdn;
domains = [ domain ];
certificateDomains = [ "mail.${domain}" ];
certificateScheme = "acme-nginx";
loginAccounts = {
"me@${domain}" = {
hashedPasswordFile = "/var/secrets/me@${domain}.key";
};
};
enablePop3 = false;
enablePop3Ssl = false;
};
}

View File

@@ -0,0 +1,42 @@
{
conf,
...
}:
{
networking = {
useDHCP = false;
hostName = "suwako";
firewall = {
interfaces = {
enp0s6 = {
allowedTCPPorts = [
22
443
80
25565 # minecraft
];
};
};
};
interfaces = {
enp0s6 = {
useDHCP = true;
};
};
wireguard.interfaces.wg0 = with conf.network.addresses.wireguard.ips; {
ips = [ suwako ];
listenPort = 17840;
privateKeyFile = "/var/secrets/wg.key";
peers = [
{
#Oracle VM1
publicKey = "z0Y2VNEWcyVQVSqRHiwmiJ5/0MgSPM+HZfEcwIccSxM=";
allowedIPs = [ remilia ];
endpoint = "${conf.network.addresses.domain.natto}:17840";
persistentKeepalive = 25;
}
];
};
};
}

View File

@@ -0,0 +1,33 @@
{ ... }:
{
imports = [
./nginx.nix
./pufferpanel.nix
./filehost.nix
./gitea.nix
];
virtualisation.docker = {
enable = true;
};
services = {
cron.enable = true;
openssh = {
enable = true;
settings.PermitRootLogin = "yes";
ports = [ 22 ];
};
postgresql = {
enable = true;
authentication = ''
local gitea all ident map=gitea-map
'';
identMap = ''
gitea-map gitea gitea
'';
};
};
}

View File

@@ -0,0 +1,39 @@
{
lib,
pkgs,
inputs,
conf,
...
}:
{
systemd.services = rec {
filehost = {
enable = true;
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
Environment = [
"TITLE=nattofiles"
"INTERNAL_HOST=0.0.0.0"
"INTERNAL_PORT=8000"
"MAX_FILESIZE_MB=500"
"EXTERNAL_HAS_TLS=1"
"EXTERNAL_HOST=f.${conf.network.addresses.domain.natto}"
];
Restart = "on-failure";
ExecStart = "${inputs.filehost.packages.${pkgs.system}.yamaf}/bin/yamaf";
};
};
filehost-chutiya = lib.recursiveUpdate filehost {
serviceConfig.Environment = [
"TITLE=chutiyafiles"
"INTERNAL_HOST=0.0.0.0"
"INTERNAL_PORT=8001"
"MAX_FILESIZE_MB=500"
"EXTERNAL_HAS_TLS=1"
"EXTERNAL_HOST=f.${conf.network.addresses.domain.chutiya}"
];
};
};
}

Some files were not shown because too many files have changed in this diff Show More