Added initial files

This commit is contained in:
baduhai 2022-11-29 17:36:21 -03:00
commit 0c97384a8d
20 changed files with 874 additions and 0 deletions

15
hosts/common/boot.nix Normal file
View file

@ -0,0 +1,15 @@
{ config, pkgs, lib, ... }:
{
boot = {
loader = {
timeout = 1;
efi.canTouchEfiVariables = true;
systemd-boot = {
enable = true;
editor = false;
netbootxyz.enable = true;
};
};
};
}

20
hosts/common/locale.nix Normal file
View file

@ -0,0 +1,20 @@
{ config, pkgs, lib, ... }:
{
time.timeZone = "America/Bahia";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "pt_BR.utf8";
LC_IDENTIFICATION = "pt_BR.utf8";
LC_MEASUREMENT = "pt_BR.utf8";
LC_MONETARY = "pt_BR.utf8";
LC_NAME = "pt_BR.utf8";
LC_NUMERIC = "pt_BR.utf8";
LC_PAPER = "pt_BR.utf8";
LC_TELEPHONE = "pt_BR.utf8";
LC_TIME = "en_IE.utf8";
};
};
}

View file

@ -0,0 +1,11 @@
{ config, pkgs, lib, ... }:
{
networking = {
networkmanager.enable = true;
firewall = {
enable = true;
checkReversePath = "loose"; # Tailscale mail fail without this
};
};
}

13
hosts/common/nix.nix Normal file
View file

@ -0,0 +1,13 @@
{ config, pkgs, lib, ... }:
{
nix = {
extraOptions = "experimental-features = nix-command flakes";
gc = { # Garbage collector
automatic = true;
options = "--delete-older-than 8d";
};
};
system.stateVersion = "22.05";
}

23
hosts/common/packages.nix Normal file
View file

@ -0,0 +1,23 @@
{ config, pkgs, lib, ... }:
{
nixpkgs.config = {
allowUnfree = true;
};
environment.systemPackages = with pkgs; [
any-nix-shell
bind
btop
git
lazydocker
micro
tmux
tree
wget
];
programs = {
fish.enable = true;
};
}

10
hosts/common/services.nix Normal file
View file

@ -0,0 +1,10 @@
{ config, pkgs, lib, ... }:
{
services = {
fwupd.enable = true;
fstrim.enable = true;
openssh.enable = true;
tailscale.enable = true;
};
}

21
hosts/common/users.nix Normal file
View file

@ -0,0 +1,21 @@
{ config, pkgs, lib, ... }:
{
users.users = {
user = {
isNormalUser = true;
shell = pkgs.fish;
extraGroups = [
"networkmanager"
"wheel"
];
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKcwF1yuWEfYGScNocEbs0AmGxyTIzGc4/IhpU587SJE" ];
hashedPassword = "$6$Pj7v/CpstyuWQQV0$cNujVDhfMBdwlGVEnnd8t71.kZPixbo0u25cd.874iaqLTH4V5fa1f98V5zGapjQCz5JyZmsR94xi00sUrntT0";
};
root = {
shell = pkgs.fish;
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKcwF1yuWEfYGScNocEbs0AmGxyTIzGc4/IhpU587SJE" ];
hashedPassword = "!";
};
};
}

View file

@ -0,0 +1,22 @@
{ config, pkgs, lib, ... }:
{
boot = {
plymouth.enable = true;
initrd.systemd.enable = true;
loader.efi.efiSysMountPoint = "/boot/efi";
kernelPackages = pkgs.linuxPackages_xanmod_latest; # Xanmod kernel
kernelModules = [
"i2c-dev" # Required for arduino dev
"i2c-piix4" # Required for arduino dev
];
kernelParams = [
"quiet"
"splash"
"loglevel=3"
"udev.log_priority=3"
"rd.udev.log_level=3"
"rd.systemd.show_status=false"
];
};
}

View file

@ -0,0 +1,14 @@
{ config, pkgs, lib, ... }:
{
hardware = {
bluetooth.enable = true;
opengl.driSupport32Bit = true; # For OpenGL games
steam-hardware.enable = true; # Allow steam client to manage controllers
pulseaudio.enable = false; # Use pipewire instead
};
sound.enable = true;
security.rtkit.enable = true; # Needed for pipewire to acquire realtime priority
}

View file

@ -0,0 +1,82 @@
{ config, pkgs, lib, ... }:
{
environment.systemPackages = with pkgs; [
arduino
ark
bat
bitwarden
chatterino2
deploy-rs
fd
filelight
firefox-wayland # Until firefox moves to using wayland by default
foliate
fzf
gimp
gocryptfs
helvum
heroic
inkscape
# itch # Currently using unsafe electron version
kate
kitty
kolourpaint
libreoffice-qt
logseq
mangohud
megasync # Soon to be dropped once nas is fully operational
mpv
neofetch
obs-studio
obs-studio-plugins.obs-vkcapture
prismlauncher-qt5
protonup
prusa-slicer
qbittorrent
quickemu
retroarchFull
rpcs3
signal-desktop
solvespace
steam-run
streamlink-twitch-gui-bin
tdesktop
thunderbird-wayland # Until thunderbird moves to using wayland by default
ungoogled-chromium
unrar
vagrant
ventoy-bin
virt-manager
yakuake
# Package overrides
(appimage-run.override {
extraPkgs = pkgs: [ ];
})
# Packages from 3rd party overlays
nur.repos.baduhai.koi
nur.repos.baduhai.emulationstation-de
];
programs = {
steam.enable = true;
dconf.enable = true;
kdeconnect.enable = true;
partition-manager.enable = true;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
pinentryFlavor = "qt";
};
};
fonts = {
fontDir.enable = true;
fontconfig.enable = true;
fonts = with pkgs; [
inter
roboto
(nerdfonts.override { fonts = [ "Hack" ]; })
];
};
}

View file

@ -0,0 +1,40 @@
{ config, pkgs, lib, ... }:
{
services = {
printing.enable = true;
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
wireplumber.enable = true;
};
xserver = {
enable = true;
layout = "us";
xkbVariant = "altgr-intl";
excludePackages = ( with pkgs; [ xterm ]);
desktopManager.plasma5 = {
enable = true;
excludePackages = ( with pkgs.plasma5Packages; [ elisa oxygen khelpcenter ]);
};
displayManager = {
defaultSession = "plasmawayland";
sddm = {
enable = true;
autoNumlock = true;
settings = {
Theme = {
CursorTheme = "breeze_cursors";
};
X11 = {
UserAuthFile = ".local/share/sddm/Xauthority";
};
};
};
};
};
};
}

View file

@ -0,0 +1,16 @@
{ config, pkgs, lib, ... }:
{
environment.sessionVariables = rec {
KDEHOME = "$XDG_CONFIG_HOME/kde4"; # Stops kde from placing a .kde4 folder in the home dir
};
users.users.user = {
description = "William";
extraGroups = [
"libvirtd"
"uaccess" # Needed for HID dev
"dialout" # Needed for arduino dev
];
};
}

View file

@ -0,0 +1,11 @@
{ config, pkgs, lib, ... }:
{
virtualisation = {
libvirtd.enable = true;
podman = {
enable = true;
dockerCompat = true; # Baisically aliases docker to podman
};
};
}

53
hosts/desktops/io.nix Normal file
View file

@ -0,0 +1,53 @@
{ config, pkgs, lib, ... }:
{
imports = [
# Host-specific imports
./io/hardware-configuration.nix
# Host-common imports
../../common/networking.nix
../../common/services.nix
../../common/packages.nix
../../common/locale.nix
../../common/users.nix
../../common/boot.nix
../../common/nix.nix
# Desktop-common imports
../common/virtualisation.nix
../common/hardware.nix
../common/services.nix
../common/packages.nix
../common/users.nix
../common/boot.nix
];
networking.hostName = "io";
environment.systemPackages = with pkgs; [
gnome-network-displays
maliit-keyboard
rnote
write_stylus
];
boot.kernelParams = [
"nosgx"
"i915.fastboot=1"
"mem_sleep_default=deep"
];
zramSwap = {
enable = true;
memoryPercent = 100;
};
services = {
kmonad = {
enable = true;
keyboards.internal = {
device = "/dev/input/by-path/platform-i8042-serio-0-event-kbd";
config = builtins.readFile ./io/kmonad.kbd;
};
};
};
}

View file

@ -0,0 +1,39 @@
# 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, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/2321ee32-a952-4a4b-bba0-bb25f616a4a5";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-008bb7cb-917c-4dda-93fe-542c2285bafb".device = "/dev/disk/by-uuid/008bb7cb-917c-4dda-93fe-542c2285bafb";
fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/36B4-C473";
fsType = "vfat";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,53 @@
(defcfg
input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd")
output (uinput-sink "KMonad Virtal Keyboard"
"/run/current-system/sw/bin/sleep 1 && /run/current-system/sw/bin/setxkbmap -option compose:ralt")
cmp-seq ralt
cmp-seq-delay 5
fallthrough true
allow-cmd false
)
(defalias
ovrvw M-w #|Overview button|#
cps (multi-tap 150 rsft caps) #|Caps lock replacement|#
medkey (multi-tap 200 KeyNextSong KeyPreviousSong) #|Play-pause key|#
mute (multi-tap 200 KeyMute M-KeyMute) #|Mute audio and mic|#
#|Handling function key|#
fk (layer-toggle fkeys)
fkk (layer-switch fkeys)
fks (multi-tap 200 @fk @fkk)
fkout (layer-switch default)
fko (multi-tap 200 @fk @fkout)
)
(defsrc
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f13
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] ret
lmet a s d f g h j k l ; ' \
lsft 102d z x c v b n m , . / rsft
lctl lalt spc ralt rctl up
left down rght
)
(deflayer default
esc KeyBack KeyForward KeyRefresh f11 @ovrvw brdn brup @mute pp @medkey del
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] ret
lmet a s d f g h j k l ; ' \
lsft @fks z x c v b n m , . / @cps
lctl lalt spc ralt rctl up
left down rght
)
(deflayer fkeys
f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
_ _ _ _ _ _ _ _ _ kp/ kp* kp- KeyHome _
_ prnt _ _ _ _ _ _ 7 8 9 kp+ pgup _
_ _ _ _ _ _ _ _ 4 5 6 kprt pgdn
_ @fko _ _ _ _ _ _ _ 1 2 3 KeyEnd
_ _ _ 0 . _
_ _ _
)