Ayo the pizza here (restructuring)

This commit is contained in:
2021-07-21 22:32:32 +05:30
parent 7dffa41ae2
commit 347c8bd00c
41 changed files with 86 additions and 126 deletions

3
hosts/README.md Normal file
View File

@@ -0,0 +1,3 @@
Satori is my home laptop\
Marisa is my Raspberry Pi 4 (B)\
Remilia is my cloud VM

12
hosts/marisa/default.nix Executable file
View File

@@ -0,0 +1,12 @@
{config, pkgs, ...}:
{
imports =
[
./networking.nix
./hardware.nix
./boot.nix
./services.nix
];
programs.gnupg.agent.enable = pkgs.lib.mkForce false;
system.stateVersion = "21.05";
}

View File

@@ -6,8 +6,7 @@
permitRootLogin = "yes";
};
vault = {
package = pkgs.vault-bin;
enable = true;
package = pkgs.vault-bin; enable = true;
tlsCertFile = "/var/certs/cert.pem";
tlsKeyFile = "/var/certs/key.pem";
address = "0.0.0.0:8800";
@@ -97,5 +96,5 @@
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPX1HDzWpoaOcU8GDEGuDzXgxkCpyeqxRR6gLs/8JgHw"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK06ZUa9BKmZ6m+xapBjOAm10OCLzxIm8ais20wQC47m"
];
security.pki.certificateFiles = [ ../../../cert.pem ];
security.pki.certificateFiles = [ ../../cert.pem ];
}

View File

@@ -1 +0,0 @@
Satori is my home laptop

View File

@@ -1,64 +0,0 @@
default partial alphanumeric_keys modifier_keys
xkb_symbols "basic" {
name[Group1] = "English (US Colemak-DH)";
key <TLDE> { [ grave, asciitilde, dead_tilde, asciitilde ] };
key <AE01> { [ 1, exclam, exclamdown, onesuperior ] };
key <AE02> { [ 2, at, masculine, twosuperior ] };
key <AE03> { [ 3, numbersign, ordfeminine, threesuperior ] };
key <AE04> { [ 4, dollar, cent, sterling ] };
key <AE05> { [ 5, percent, EuroSign, yen ] };
key <AE06> { [ 6, asciicircum, hstroke, Hstroke ] };
key <AE07> { [ 7, ampersand, eth, ETH ] };
key <AE08> { [ 8, asterisk, thorn, THORN ] };
key <AE09> { [ 9, parenleft, leftsinglequotemark, leftdoublequotemark ] };
key <AE10> { [ 0, parenright, rightsinglequotemark, rightdoublequotemark ] };
key <AE11> { [ minus, underscore, endash, emdash ] };
key <AE12> { [ equal, plus, multiply, division ] };
key <AD01> { [ q, Q, adiaeresis, Adiaeresis ] };
key <AD02> { [ w, W, aring, Aring ] };
key <AD03> { [ f, F, atilde, Atilde ] };
key <AD04> { [ p, P, oslash, Ooblique ] };
key <AD05> { [ b, B, dead_breve, asciitilde ] };
key <AD06> { [ j, J, dstroke, Dstroke ] };
key <AD07> { [ l, L, lstroke, Lstroke ] };
key <AD08> { [ u, U, uacute, Uacute ] };
key <AD09> { [ y, Y, udiaeresis, Udiaeresis ] };
key <AD10> { [ semicolon, colon, odiaeresis, Odiaeresis ] };
key <AD11> { [ bracketleft, braceleft, guillemotleft, 0x1002039 ] };
key <AD12> { [ bracketright, braceright, guillemotright, 0x100203a ] };
key <BKSL> { [ backslash, bar, asciitilde, asciitilde ] };
key <AC01> { [ a, A, aacute, Aacute ] };
key <AC02> { [ r, R, dead_grave, asciitilde ] };
key <AC03> { [ s, S, ssharp, asciitilde ] };
key <AC04> { [ t, T, dead_acute, dead_doubleacute ] };
key <AC05> { [ g, G, dead_ogonek, asciitilde ] };
key <AC06> { [ m, M, dead_macron, asciitilde ] };
key <AC07> { [ n, N, ntilde, Ntilde ] };
key <AC08> { [ e, E, eacute, Eacute ] };
key <AC09> { [ i, I, iacute, Iacute ] };
key <AC10> { [ o, O, oacute, Oacute ] };
key <AC11> { [ apostrophe, quotedbl, otilde, Otilde ] };
key <AB01> { [ z, Z, ae, AE ] };
key <AB02> { [ x, X, dead_circumflex, asciitilde ] };
key <AB03> { [ c, C, ccedilla, Ccedilla ] };
key <AB04> { [ d, D, dead_diaeresis, asciitilde ] };
key <AB05> { [ v, V, oe, OE ] };
key <AB06> { [ k, K, dead_abovering, asciitilde ] };
key <AB07> { [ h, H, dead_caron, asciitilde ] };
key <AB08> { [ comma, less, dead_cedilla, asciitilde ] };
key <AB09> { [ period, greater, dead_abovedot, asciitilde ] };
key <AB10> { [ slash, question, questiondown, asciitilde ] };
key <CAPS> { [ Caps_Lock, Caps_Lock, Caps_Lock, Caps_Lock ] };
key <LSGT> { [ minus, underscore, endash, emdash ] };
key <SPCE> { [ space, space, space, nobreakspace ] };
include "level3(ralt_switch)"
};
partial alphanumeric_keys
xkb_symbols "ganda-dh" {
include "us-colemak(basic)"
name[Group1] = "English (US Ganda-DH)";
key <CAPS> { [ BackSpace, BackSpace, BackSpace, BackSpace ] };
include "level3(ralt_switch)"
};

View File

@@ -1,31 +0,0 @@
{config, pkgs, ... }:
let
nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" ''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec -a "$0" "$@"
'';
in
{
environment.systemPackages = with pkgs; [
nvidia-offload
];
hardware = {
opengl = {
driSupport32Bit = true;
#package = pkgs.mesa_drivers;
enable = true;
};
nvidia = {
prime = {
offload = { enable = true; };
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
modesetting = { enable = true; };
};
};
services.xserver.videoDrivers = [ "nvidia" ];
}

View File

@@ -1,72 +0,0 @@
{lib, config, pkgs, ... }:
{
services.pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse = {
enable = true;
};
config.pipewire = {
context.modules = [
{
name = "libpipewire-module-rtkit";
args = {
nice.level = -15;
rt.prio = 88;
rt.time.soft = 200000;
rt.time.hard = 200000;
};
flags = [ "ifexists" "nofail" ];
}
{ name = "libpipewire-module-protocol-native"; }
{ name = "libpipewire-module-profiler"; }
{ name = "libpipewire-module-metadata"; }
{ name = "libpipewire-module-spa-device-factory"; }
{ name = "libpipewire-module-spa-node-factory"; }
{ name = "libpipewire-module-client-node"; }
{ name = "libpipewire-module-client-device"; }
{
name = "libpipewire-module-portal";
flags = [ "ifexists" "nofail" ];
}
{
name = "libpipewire-module-access";
args = {};
}
{ name = "libpipewire-module-adapter"; }
{ name = "libpipewire-module-link-factory"; }
{ name = "libpipewire-module-session-manager"; }
];
};
config.pipewire-pulse = {
context.modules = [
{ name = "libpipewire-module-protocol-native"; }
{ name = "libpipewire-module-client-node"; }
{ name = "libpipewire-module-adapter"; }
{ name = "libpipewire-module-metadata"; }
{
name = "libpipewire-module-protocol-pulse";
args = {
pulse.min.req = "32/48000";
pulse.min.quantum = "32/48000";
pulse.min.frag = "32/48000";
};
}
];
stream.properties = {
node.latency = "32/48000";
resample.quality = 1;
};
};
};
sound.enable = true;
# hardware = {
# pulseaudio.enable = true;
# pulseaudio.support32Bit = true;
# };
}

View File

@@ -1,44 +0,0 @@
{ config, lib, ... }:
#let
# compiledLayout = pkgs.runCommand "keyboard-layout" {} ''
# ${pkgs.xorg.xkbcomp}/bin/xkbcomp ${./colemak-dh.xkb} $out
# '';
#in
{
services = {
xserver = {
enable = true;
libinput= {
enable = true;
mouse = {
accelSpeed = "0";
};
touchpad = {
middleEmulation = false;
clickMethod = "buttonareas";
tapping = true;
naturalScrolling =true;
};
};
displayManager = {
startx = {
enable = true;
};
# sessionCommands = "${pkgs.xorg.xkbcomp}/bin/xkbcomp ${compiledLayout} $DISPLAY";
};
extraLayouts = {
us-colemak = {
description = "Colemak with MOD-dh";
languages = [ "eng" ];
symbolsFile = ./colemak-dh;
};
};
layout = "us-colemak";
xkbVariant = "basic";
autoRepeatDelay = 320;
autoRepeatInterval = 30;
};
};
}

View File

@@ -1,17 +0,0 @@
{ lib, config, ...}:
{
imports =
[
./satori/hardware.nix
./satori/stuff.nix
./satori/pkgs.nix
./satori/networking.nix
./satori/boot.nix
./satori/services.nix
./common/nvidia-offload.nix
./common/pipewire.nix
./common/xorg.nix
../../configs/nvim.nix
];
system.stateVersion = "21.05";
}

12
hosts/remilia/default.nix Executable file
View File

@@ -0,0 +1,12 @@
{lib, config, ...}:
{
imports =
[
./networking.nix
./hardware.nix
./boot.nix
./services.nix
./mailserver.nix
];
system.stateVersion = "21.11";
}

View File

@@ -75,5 +75,5 @@
"git.weirdnatto.in".email = "git+acme@weirdnatto.in";
};
};
security.pki.certificateFiles = [ ../../../cert.pem ];
security.pki.certificateFiles = [ ../../cert.pem ];
}

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

13
hosts/satori/default.nix Normal file
View File

@@ -0,0 +1,13 @@
{ lib, config, ...}:
{
imports =
[
./hardware.nix
./stuff.nix
./pkgs.nix
./networking.nix
./boot.nix
./services.nix
];
system.stateVersion = "21.05";
}

View File

@@ -31,7 +31,7 @@
#printing.wantedBy = lib.mkForce [];
#vault.wantedBy = lib.mkForce [];
};
security.pki.certificateFiles = [ ../../../cert.pem ];
security.pki.certificateFiles = [ ../../cert.pem ];
/* virtualisation.libvirtd = {
enable = true;
onBoot = "ignore";

View File

@@ -1,16 +0,0 @@
{config, pkgs, ...}:
{
imports =
[
./pkgs.nix
./stuff.nix
./marisa/networking.nix
./marisa/hardware.nix
./marisa/boot.nix
./marisa/services.nix
./marisa/builder.nix
../../configs/nvim.nix
];
programs.gnupg.agent.enable = pkgs.lib.mkForce false;
system.stateVersion = "21.05";
}

View File

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

View File

@@ -1,14 +0,0 @@
# WARN: this file will get overwritten by $ cachix use <name>
{ pkgs, lib, ... }:
let
folder = ./cachix;
toImport = name: value: folder + ("/" + name);
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder));
in {
inherit imports;
nix.binaryCaches = ["https://cache.nixos.org/"];
}

View File

@@ -1,12 +0,0 @@
{
nix = {
binaryCaches = [
"https://rpi4.cachix.org"
];
binaryCachePublicKeys = [
"rpi4.cachix.org-1:fMaYBuIlj/Sa9YTXnXMXoXnVZEoVhnFxOkxseKKlku8="
];
};
}

View File

@@ -1,36 +0,0 @@
{lib, config, pkgs, ...}:
{
environment.systemPackages = with pkgs; [
git
htop
vim
wireguard
vault
];
programs = {
zsh = {
enable = true;
promptInit = "PROMPT='%B%F{cyan}%~ %F{blue}>%f%b '\nRPROMPT='%B%F{cyan}%n%f@%F{red}%m%b'";
histSize = 12000;
enableCompletion = true;
syntaxHighlighting.enable = true;
autosuggestions. enable = true;
ohMyZsh.enable = true;
};
gnupg = {
agent = {
enable = true;
pinentryFlavor = "curses";
};
};
};
nix = {
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command ca-references flakes
builders-use-substitutes = true
'';
trustedUsers = [ "root" ];
};
documentation.enable = false;
}

View File

@@ -1,17 +0,0 @@
{lib, config, ...}:
{
imports =
[
./pkgs.nix
./stuff.nix
./remilia/networking.nix
./remilia/hardware.nix
./remilia/boot.nix
./remilia/services.nix
./remilia/builder.nix
./remilia/mailserver.nix
../../configs/nvim.nix
];
# programs.gnupg.agent.enable = lib.mkForce false;
system.stateVersion = "21.11";
}

View File

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

View File

@@ -1,26 +0,0 @@
{config, pkgs, ...}:
{
time.timeZone = "Asia/Kolkata";
environment = {
sessionVariables = {
EDITOR = "vim";
};
};
security = {
sudo.enable = false;
doas = {
enable = true;
extraRules = [
{
users = [ ];
keepEnv = true;
persist = true;
}
];
};
};
documentation.enable = false;
users.extraUsers.root = {
shell = pkgs.zsh;
};
}