diff --git a/conf/colors.nix b/conf/colors.nix index 19065a2..82815bc 100644 --- a/conf/colors.nix +++ b/conf/colors.nix @@ -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 } diff --git a/flake.nix b/flake.nix index 44a3612..330127c 100644 --- a/flake.nix +++ b/flake.nix @@ -2,36 +2,36 @@ description = "dotfiles"; inputs = { - nixpkgs.url = github:nixos/nixpkgs/nixpkgs-unstable; + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - stable.url = github:nixos/nixpkgs/release-24.05; + stable.url = "github:nixos/nixpkgs/release-24.05"; - flake-parts.url = github:hercules-ci/flake-parts; + flake-parts.url = "github:hercules-ci/flake-parts"; home-manager = { - url = github:nix-community/home-manager; + url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; mailserver = { - url = gitlab:simple-nixos-mailserver/nixos-mailserver; + url = "gitlab:simple-nixos-mailserver/nixos-mailserver"; inputs.nixpkgs.follows = "nixpkgs"; }; filehost = { - url = github:natto1784/simpler-filehost; + url = "github:natto1784/simpler-filehost"; }; - nix-gaming.url = github:fufexan/nix-gaming; + nix-gaming.url = "github:fufexan/nix-gaming"; nbfc = { - url = github:nbfc-linux/nbfc-linux; + url = "github:nbfc-linux/nbfc-linux"; inputs.nixpkgs.follows = "nixpkgs"; }; - emacs-overlay.url = github:nix-community/emacs-overlay; + emacs-overlay.url = "github:nix-community/emacs-overlay"; - nvim-overlay.url = github:nix-community/neovim-nightly-overlay; + nvim-overlay.url = "github:nix-community/neovim-nightly-overlay"; hyprland = { type = "git"; @@ -40,17 +40,21 @@ }; hyprland-contrib = { - url = github:hyprwm/contrib; + url = "github:hyprwm/contrib"; }; - agenix.url = github:ryantm/agenix; + agenix.url = "github:ryantm/agenix"; - ags.url = github:Aylur/ags/v1; + ags.url = "github:Aylur/ags/v1"; }; - 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,15 +63,18 @@ ./conf ]; - perSystem = { system, pkgs, ... }: + perSystem = + { system, pkgs, ... }: rec { formatter = pkgs.nixfmt-rfc-style; - devShells.default = with pkgs; mkShell { - packages = [ - nixd - formatter - ]; - }; + devShells.default = + with pkgs; + mkShell { + packages = [ + nixd + formatter + ]; + }; _module.args.pkgs = import inputs.nixpkgs { inherit system; }; diff --git a/home/amneesh.nix b/home/amneesh.nix index 6d3e97d..e56d529 100644 --- a/home/amneesh.nix +++ b/home/amneesh.nix @@ -1,4 +1,9 @@ -{ config, pkgs, inputs, ... }: +{ + config, + pkgs, + inputs, + ... +}: { home = { homeDirectory = "/home/amneesh"; @@ -14,7 +19,7 @@ }; imports = [ - ./programs/emacs + ./programs/emacs ]; xdg.mime.enable = true; diff --git a/home/common/emacs/default.nix b/home/common/emacs/default.nix index b87b360..6f20e7d 100644 --- a/home/common/emacs/default.nix +++ b/home/common/emacs/default.nix @@ -24,10 +24,11 @@ in alwaysEnsure = true; alwaysTangle = true; defaultInitFile = true; - extraEmacsPackages = epkgs: with epkgs; [ - use-package - (tree-sitter-langs.withPlugins (_: tree-sitter-langs.plugins)) - ]; + extraEmacsPackages = + epkgs: with epkgs; [ + use-package + (tree-sitter-langs.withPlugins (_: tree-sitter-langs.plugins)) + ]; }; }; services.emacs = { diff --git a/home/default.nix b/home/default.nix index 31a2c42..1af6089 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,4 +1,9 @@ -{ self, inputs, globalArgs, ... }: +{ + self, + inputs, + globalArgs, + ... +}: let common = [ { programs.home-manager.enable = true; } @@ -6,15 +11,17 @@ let ./common/direnv ]; - mkPkgs = system: import inputs.nixpkgs { - inherit system; - config = { - allowUnfree = true; - allowBroken = true; - allowInsecure = true; + mkPkgs = + system: + import inputs.nixpkgs { + inherit system; + config = { + allowUnfree = true; + allowBroken = true; + allowInsecure = true; + }; + overlays = [ self.overlays.default ]; }; - overlays = [ self.overlays.default ]; - }; extraSpecialArgs = globalArgs; in @@ -50,49 +57,57 @@ in // { spark = inputs.home-manager.lib.homeManagerConfiguration { inherit extraSpecialArgs; - modules = [{ - home = { - homeDirectory = "/home/spark"; - username = "spark"; - stateVersion = "23.05"; - }; - }] ++ common; + modules = [ + { + home = { + homeDirectory = "/home/spark"; + username = "spark"; + stateVersion = "23.05"; + }; + } + ] ++ common; pkgs = mkPkgs "aarch64-linux"; }; bat = inputs.home-manager.lib.homeManagerConfiguration { inherit extraSpecialArgs; - modules = [{ - home = { - homeDirectory = "/home/bat"; - username = "bat"; - stateVersion = "23.05"; - }; - }] ++ common; + modules = [ + { + home = { + homeDirectory = "/home/bat"; + username = "bat"; + stateVersion = "23.05"; + }; + } + ] ++ common; pkgs = mkPkgs "x86_64-linux"; }; spin = inputs.home-manager.lib.homeManagerConfiguration { inherit extraSpecialArgs; - modules = [{ - home = { - homeDirectory = "/home/spin"; - username = "spin"; - stateVersion = "23.05"; - }; - }] ++ common; + modules = [ + { + home = { + homeDirectory = "/home/spin"; + username = "spin"; + stateVersion = "23.05"; + }; + } + ] ++ 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; + modules = [ + { + home = { + homeDirectory = "/home/kero"; + username = "kero"; + stateVersion = "24.05"; + }; + } + ] ++ common; pkgs = mkPkgs "aarch64-linux"; }; diff --git a/home/natto/ags/default.nix b/home/natto/ags/default.nix index 5c71cf8..d314d4d 100644 --- a/home/natto/ags/default.nix +++ b/home/natto/ags/default.nix @@ -1,26 +1,35 @@ -{ pkgs, lib, config, inputs, ... }: +{ + pkgs, + lib, + config, + inputs, + ... +}: let cfg = config.programs.ags; - deps = with pkgs; [ - sass - gawk - bash - procps - coreutils - imagemagick - systemd - config.wayland.windowManager.hyprland.package - ] ++ lib.optional config.isLaptop brightnessctl; - + deps = + with pkgs; + [ + sass + gawk + bash + procps + coreutils + imagemagick + systemd + config.wayland.windowManager.hyprland.package + ] + ++ lib.optional config.isLaptop brightnessctl; configDir = lib.cleanSourceWith { src = ./.; - filter = name: _: + filter = + name: _: let baseName = baseNameOf (toString name); in - !(lib.hasSuffix ".nix" baseName); + !(lib.hasSuffix ".nix" baseName); }; 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; diff --git a/home/natto/default.nix b/home/natto/default.nix index c7f1c2a..1a4b2cb 100644 --- a/home/natto/default.nix +++ b/home/natto/default.nix @@ -21,10 +21,10 @@ ./zsh.nix ./games.nix - /* when xserver */ + # when xserver # ./xsession.nix - /* when wayland */ + # when wayland ./wayland.nix ./hyprland.nix ./foot.nix diff --git a/home/natto/dunst.nix b/home/natto/dunst.nix index 7388048..660ee2f 100644 --- a/home/natto/dunst.nix +++ b/home/natto/dunst.nix @@ -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"; diff --git a/home/natto/email.nix b/home/natto/email.nix index 3279de7..2b25397 100644 --- a/home/natto/email.nix +++ b/home/natto/email.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let key = "53EC089EF230E47A83BA8F8195949BD4B853F559"; host = "mail.weirdnatto.in"; @@ -51,18 +56,17 @@ in enable = true; package = pkgs.neomutt; sort = "reverse-date"; - extraConfig = - lib.concatMapStringsSep - "\n" - builtins.readFile - [ - ./config/neomutt/neomuttrc - ./config/neomutt/theme - ]; + 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; diff --git a/home/natto/eww/default.nix b/home/natto/eww/default.nix index b6de378..9dfd110 100644 --- a/home/natto/eww/default.nix +++ b/home/natto/eww/default.nix @@ -1,15 +1,21 @@ -{ 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 - !(lib.hasSuffix ".nix" baseName); + !(lib.hasSuffix ".nix" baseName); }; }; @@ -20,24 +26,24 @@ }; Service = let - deps = [ - config.programs.eww.package - ] ++ lib.optional - config.wayland.windowManager.hyprland.enable - config.wayland.windowManager.hyprland.package - ++ (with pkgs; [ - coreutils - bash - jq - less - gawk - socat - playerctl - networkmanager - iwgtk - wireplumber - ]) - ++ lib.optional config.laptop pkgs.light; + deps = + [ + config.programs.eww.package + ] + ++ lib.optional config.wayland.windowManager.hyprland.enable config.wayland.windowManager.hyprland.package + ++ (with pkgs; [ + coreutils + bash + jq + less + gawk + socat + playerctl + networkmanager + iwgtk + wireplumber + ]) + ++ lib.optional config.laptop pkgs.light; in { Type = "simple"; @@ -48,4 +54,3 @@ Install.WantedBy = [ "graphical-session.target" ]; }; } - diff --git a/home/natto/games.nix b/home/natto/games.nix index 7818efe..a81a98f 100644 --- a/home/natto/games.nix +++ b/home/natto/games.nix @@ -11,4 +11,3 @@ programs.mangohud.enable = true; } - diff --git a/home/natto/hyprland.nix b/home/natto/hyprland.nix index 1b03bfd..e32a9ad 100644 --- a/home/natto/hyprland.nix +++ b/home/natto/hyprland.nix @@ -1,4 +1,11 @@ -{ pkgs, inputs, config, conf, ... }: { +{ + pkgs, + inputs, + config, + conf, + ... +}: +{ wayland = { windowManager = { hyprland = { @@ -8,16 +15,17 @@ xwayland = { enable = true; }; - extraConfig = (builtins.readFile ./config/hypr/hyprland.conf) + 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} - } - ''); + 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} + } + ''); }; }; }; diff --git a/home/natto/music.nix b/home/natto/music.nix index e220cd7..f36bfdb 100644 --- a/home/natto/music.nix +++ b/home/natto/music.nix @@ -84,7 +84,6 @@ in }; }; - age.secrets.mpdasrc = { file = ./secrets/mpdasrc.age; path = "${home}/.config/mpdasrc"; diff --git a/home/natto/pdf.nix b/home/natto/pdf.nix index 5506247..64ec295 100644 --- a/home/natto/pdf.nix +++ b/home/natto/pdf.nix @@ -16,4 +16,3 @@ }; }; } - diff --git a/home/natto/pkgs.nix b/home/natto/pkgs.nix index 57d35e6..9d6e459 100644 --- a/home/natto/pkgs.nix +++ b/home/natto/pkgs.nix @@ -1,46 +1,54 @@ -{ flake, pkgs, config, ... }: { - home.packages = with pkgs; [ - # A/V, codec and media stuff - ffmpeg-full - wireplumber - pulseaudio - pavucontrol - imagemagick + flake, + pkgs, + config, + ... +}: +{ + home.packages = + with pkgs; + [ + # A/V, codec and media stuff + ffmpeg-full + wireplumber + pulseaudio + pavucontrol + imagemagick - # Utils - neofetch - rage - curl - yt-dlp - p7zip - unrar - vim - (flake.packages.${system}.customscripts) - cachix - steam-run + # Utils + neofetch + rage + curl + yt-dlp + p7zip + unrar + vim + (flake.packages.${system}.customscripts) + cachix + steam-run - # GUI - vesktop - (xfce.thunar.override { - thunarPlugins = with xfce; [ - thunar-media-tags-plugin - thunar-volman - thunar-archive-plugin - ]; - }) - xfce.xfconf - xfce.tumbler - qbittorrent - hexchat - dunst - zenity + # GUI + vesktop + (xfce.thunar.override { + thunarPlugins = with xfce; [ + thunar-media-tags-plugin + thunar-volman + thunar-archive-plugin + ]; + }) + xfce.xfconf + xfce.tumbler + qbittorrent + hexchat + dunst + zenity - # Misc - mailcap - libsForQt5.qtstyleplugins - ] ++ lib.optionals config.isLaptop [ - powertop - undervolt - ]; + # Misc + mailcap + libsForQt5.qtstyleplugins + ] + ++ lib.optionals config.isLaptop [ + powertop + undervolt + ]; } diff --git a/home/natto/stuff.nix b/home/natto/stuff.nix index 3ed684a..d544c3d 100644 --- a/home/natto/stuff.nix +++ b/home/natto/stuff.nix @@ -1,4 +1,10 @@ -{ config, lib, pkgs, ... }: { +{ + config, + lib, + pkgs, + ... +}: +{ xdg = { enable = true; userDirs.enable = true; @@ -29,7 +35,10 @@ inputMethod = { enable = true; type = "fcitx5"; - fcitx5.addons = with pkgs; [ fcitx5-m17n fcitx5-mozc ]; + fcitx5.addons = with pkgs; [ + fcitx5-m17n + fcitx5-mozc + ]; }; }; } diff --git a/home/natto/xsession.nix b/home/natto/xsession.nix index ede0022..6bcced2 100644 --- a/home/natto/xsession.nix +++ b/home/natto/xsession.nix @@ -1,4 +1,9 @@ -{ pkgs, config, flake, ... }: +{ + pkgs, + config, + flake, + ... +}: { xsession = { enable = true; diff --git a/hosts/default.nix b/hosts/default.nix index f6ecaee..aa517f6 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -26,21 +26,23 @@ in # Desktop okina = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - modules = [ - ./okina - ] - ++ desktopModules - ++ commonModules; + modules = + [ + ./okina + ] + ++ desktopModules + ++ commonModules; }; #Home laptop satori = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - modules = [ - ./satori - ] - ++ desktopModules - ++ commonModules; + modules = + [ + ./satori + ] + ++ desktopModules + ++ commonModules; }; #Home server (RPi4) @@ -48,8 +50,7 @@ in system = "aarch64-linux"; modules = [ ./marisa - ] - ++ commonModules; + ] ++ commonModules; }; #Oracle Cloud VM @@ -59,8 +60,7 @@ in ./remilia ./x86builder.nix inputs.mailserver.nixosModules.mailserver - ] - ++ commonModules; + ] ++ commonModules; }; #Oracle Cloud VM @@ -69,8 +69,7 @@ in modules = [ ./hina ./x86builder.nix - ] - ++ commonModules; + ] ++ commonModules; }; #Oracle Cloud VM @@ -78,8 +77,7 @@ in system = "aarch64-linux"; modules = [ ./suwako - ] - ++ commonModules; + ] ++ commonModules; }; }; } diff --git a/hosts/hina/boot.nix b/hosts/hina/boot.nix index 6f50331..3ebc8b6 100644 --- a/hosts/hina/boot.nix +++ b/hosts/hina/boot.nix @@ -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; diff --git a/hosts/hina/default.nix b/hosts/hina/default.nix index 814b0f6..5fa0510 100644 --- a/hosts/hina/default.nix +++ b/hosts/hina/default.nix @@ -1,4 +1,9 @@ -{ config, pkgs, conf, ... }: +{ + config, + pkgs, + conf, + ... +}: { imports = [ ./networking.nix diff --git a/hosts/hina/hardware.nix b/hosts/hina/hardware.nix index 6ae1292..57e46e4 100644 --- a/hosts/hina/hardware.nix +++ b/hosts/hina/hardware.nix @@ -1,16 +1,20 @@ -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ - (modulesPath + "/profiles/qemu-guest.nix") - ]; + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; - fileSystems."/" = - { - device = "/dev/disk/by-uuid/d91adce2-9059-4a8a-86e7-dee6ecc85b2b"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/d91adce2-9059-4a8a-86e7-dee6ecc85b2b"; + fsType = "ext4"; + }; swapDevices = [ { diff --git a/hosts/hina/networking.nix b/hosts/hina/networking.nix index db2686e..1319fce 100644 --- a/hosts/hina/networking.nix +++ b/hosts/hina/networking.nix @@ -1,16 +1,25 @@ -{ lib, config, conf, pkgs, ... }: +{ + lib, + config, + conf, + pkgs, + ... +}: { networking = { useDHCP = false; hostName = "hina"; - firewall = - { - interfaces = { - ens3 = { - allowedTCPPorts = [ 9898 80 443 ]; - }; + firewall = { + interfaces = { + ens3 = { + allowedTCPPorts = [ + 9898 + 80 + 443 + ]; }; }; + }; interfaces = { ens3 = { useDHCP = true; diff --git a/hosts/hina/services.nix b/hosts/hina/services.nix index 39b04d5..d65a041 100644 --- a/hosts/hina/services.nix +++ b/hosts/hina/services.nix @@ -1,4 +1,10 @@ -{ config, pkgs, lib, conf, ... }: +{ + config, + pkgs, + lib, + conf, + ... +}: let domain = conf.network.addresses.domain.natto; in @@ -32,4 +38,3 @@ in }; }; } - diff --git a/hosts/marisa/boot.nix b/hosts/marisa/boot.nix index 6477987..5ff3c07 100644 --- a/hosts/marisa/boot.nix +++ b/hosts/marisa/boot.nix @@ -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; - }; */ + enable = true; + }; + */ }; - /* kernelPatches = [ + /* + kernelPatches = [ { name = "change-pgtable"; patch = null; @@ -22,6 +36,7 @@ CONFIG_PGTABLE_LEVELS 4 ''; } - ];*/ + ]; + */ }; } diff --git a/hosts/marisa/default.nix b/hosts/marisa/default.nix index c5858c0..c559d5a 100644 --- a/hosts/marisa/default.nix +++ b/hosts/marisa/default.nix @@ -1,4 +1,9 @@ -{ config, pkgs, conf, ... }: +{ + config, + pkgs, + conf, + ... +}: { imports = [ ./networking.nix diff --git a/hosts/marisa/hardware.nix b/hosts/marisa/hardware.nix index ae92fe7..cab1c70 100644 --- a/hosts/marisa/hardware.nix +++ b/hosts/marisa/hardware.nix @@ -1,21 +1,24 @@ # 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."/" = - { - device = "/dev/disk/by-label/NIXOS_SD"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-label/NIXOS_SD"; + fsType = "ext4"; + }; - fileSystems."/nix/store" = - { - device = "/nix/store"; - fsType = "none"; - options = [ "bind" ]; - }; + fileSystems."/nix/store" = { + device = "/nix/store"; + fsType = "none"; + options = [ "bind" ]; + }; swapDevices = [ { diff --git a/hosts/marisa/networking.nix b/hosts/marisa/networking.nix index d26dcd5..b50813f 100644 --- a/hosts/marisa/networking.nix +++ b/hosts/marisa/networking.nix @@ -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 = [{ - prefixLength = 24; - address = "192.168.1.159"; - }]; + ipv4.addresses = [ + { + prefixLength = 24; + address = "192.168.1.159"; + } + ]; }; wlan0 = { - ipv4.addresses = [{ - prefixLength = 24; - address = "192.168.1.159"; - }]; + 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" + ]; }; } diff --git a/hosts/marisa/services/default.nix b/hosts/marisa/services/default.nix index f431e1c..c9e20cd 100644 --- a/hosts/marisa/services/default.nix +++ b/hosts/marisa/services/default.nix @@ -17,19 +17,20 @@ 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 - ''; + identMap = '' + gitea-map gitea gitea + ''; }; }; } - diff --git a/hosts/marisa/services/filehost.nix b/hosts/marisa/services/filehost.nix index 4ec6025..79abe30 100644 --- a/hosts/marisa/services/filehost.nix +++ b/hosts/marisa/services/filehost.nix @@ -1,4 +1,10 @@ -{ config, pkgs, inputs, conf, ... }: +{ + config, + pkgs, + inputs, + conf, + ... +}: { systemd.services.filehost = { enable = true; diff --git a/hosts/marisa/services/gitea.nix b/hosts/marisa/services/gitea.nix index e821673..f6ee315 100644 --- a/hosts/marisa/services/gitea.nix +++ b/hosts/marisa/services/gitea.nix @@ -1,4 +1,9 @@ -{ config, pkgs, conf, ... }: +{ + config, + pkgs, + conf, + ... +}: { services = { gitea = rec { @@ -38,4 +43,3 @@ }; }; } - diff --git a/hosts/marisa/services/hashicorp.nix b/hosts/marisa/services/hashicorp.nix index 7127fa2..be095c4 100644 --- a/hosts/marisa/services/hashicorp.nix +++ b/hosts/marisa/services/hashicorp.nix @@ -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 @@ }; }; } - diff --git a/hosts/okina/boot.nix b/hosts/okina/boot.nix index 63b9040..50d0a50 100644 --- a/hosts/okina/boot.nix +++ b/hosts/okina/boot.nix @@ -1,20 +1,38 @@ -{ 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" ]; # 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 ''; + extraModprobeConfig = ''options snd-intel-dspcfg dsp_driver=1 ''; resumeDevice = "/dev/disk/by-uuid/3770e3bd-a200-4e36-b3a5-4963d13865f9"; diff --git a/hosts/okina/default.nix b/hosts/okina/default.nix index 3c44bf8..7581bb5 100644 --- a/hosts/okina/default.nix +++ b/hosts/okina/default.nix @@ -1,12 +1,11 @@ { lib, config, ... }: { - imports = - [ - ./hardware.nix - ./stuff.nix - ./networking.nix - ./boot.nix - ./services.nix - ]; + imports = [ + ./hardware.nix + ./stuff.nix + ./networking.nix + ./boot.nix + ./services.nix + ]; system.stateVersion = "23.05"; } diff --git a/hosts/okina/hardware.nix b/hosts/okina/hardware.nix index 142ab27..ae7a3c4 100644 --- a/hosts/okina/hardware.nix +++ b/hosts/okina/hardware.nix @@ -1,42 +1,45 @@ -{ config, lib, modulesPath, pkgs, ... }: +{ + config, + lib, + modulesPath, + pkgs, + ... +}: { - imports = - [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - fileSystems."/" = - { - device = "/dev/disk/by-uuid/5679b901-3a70-4422-81f5-af91f287500b"; - fsType = "btrfs"; - options = [ "compress-force=zstd:3" ]; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/5679b901-3a70-4422-81f5-af91f287500b"; + fsType = "btrfs"; + options = [ "compress-force=zstd:3" ]; + }; - fileSystems."/boot/efi" = - { - device = "/dev/disk/by-uuid/A2E5-006F"; - fsType = "vfat"; - }; + fileSystems."/boot/efi" = { + device = "/dev/disk/by-uuid/A2E5-006F"; + fsType = "vfat"; + }; - fileSystems."/media/omghi" = - { - device = "/dev/disk/by-uuid/0e862bdb-168a-42cc-8a28-0ae9e9a0753c"; - fsType = "ext4"; - }; + fileSystems."/media/omghi" = { + device = "/dev/disk/by-uuid/0e862bdb-168a-42cc-8a28-0ae9e9a0753c"; + fsType = "ext4"; + }; - fileSystems."/media/real" = - { - device = "/dev/disk/by-uuid/8086be20-c770-46be-bd8f-5bd2d7735c7d"; - fsType = "btrfs"; - options = [ "compress-force=zstd:3" ]; - }; + 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; diff --git a/hosts/okina/networking.nix b/hosts/okina/networking.nix index 9a4c3ad..c170ffd 100644 --- a/hosts/okina/networking.nix +++ b/hosts/okina/networking.nix @@ -1,4 +1,10 @@ -{ config, pkgs, conf, lib, ... }: +{ + config, + pkgs, + conf, + lib, + ... +}: { networking = { @@ -10,35 +16,54 @@ }; 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"; - }]; - }; + /* + enp7s0 = { + ipv4.addresses = [{ + prefixLength = 24; + address = "192.168.1.106"; + }]; + }; + */ }; 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; - }]; + 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" + ]; }; } diff --git a/hosts/okina/services.nix b/hosts/okina/services.nix index d5d9541..bcbd986 100644 --- a/hosts/okina/services.nix +++ b/hosts/okina/services.nix @@ -1,4 +1,9 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: { services = { openssh = { diff --git a/hosts/okina/stuff.nix b/hosts/okina/stuff.nix index 00c79a9..a9a48b8 100644 --- a/hosts/okina/stuff.nix +++ b/hosts/okina/stuff.nix @@ -1,4 +1,9 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: { time.timeZone = "Asia/Kolkata"; @@ -9,13 +14,23 @@ polkit.enable = true; sudo.enable = true; }; + console.useXkbConfig = true; users.users.natto = { isNormalUser = true; shell = pkgs.zsh; home = "/home/natto"; - extraGroups = [ "wheel" "adbusers" "video" "libvirtd" "docker" "networkmanager" "dialout" "pipewire" ]; + extraGroups = [ + "wheel" + "adbusers" + "video" + "libvirtd" + "docker" + "networkmanager" + "dialout" + "pipewire" + ]; }; virtualisation = { diff --git a/hosts/programs/nix/default.nix b/hosts/programs/nix/default.nix index 75b54e7..ff68853 100644 --- a/hosts/programs/nix/default.nix +++ b/hosts/programs/nix/default.nix @@ -16,7 +16,10 @@ ''; settings = { auto-optimise-store = true; - trusted-users = [ "root" "@wheel" ]; + trusted-users = [ + "root" + "@wheel" + ]; substituters = [ "https://nix-community.cachix.org" "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" diff --git a/hosts/remilia/boot.nix b/hosts/remilia/boot.nix index 6f50331..3ebc8b6 100644 --- a/hosts/remilia/boot.nix +++ b/hosts/remilia/boot.nix @@ -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; diff --git a/hosts/remilia/default.nix b/hosts/remilia/default.nix index d3378dd..6dd9b08 100644 --- a/hosts/remilia/default.nix +++ b/hosts/remilia/default.nix @@ -1,4 +1,9 @@ -{ config, pkgs, conf, ... }: +{ + config, + pkgs, + conf, + ... +}: { imports = [ ./networking.nix diff --git a/hosts/remilia/hardware.nix b/hosts/remilia/hardware.nix index 6ae1292..57e46e4 100644 --- a/hosts/remilia/hardware.nix +++ b/hosts/remilia/hardware.nix @@ -1,16 +1,20 @@ -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ - (modulesPath + "/profiles/qemu-guest.nix") - ]; + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; - fileSystems."/" = - { - device = "/dev/disk/by-uuid/d91adce2-9059-4a8a-86e7-dee6ecc85b2b"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/d91adce2-9059-4a8a-86e7-dee6ecc85b2b"; + fsType = "ext4"; + }; swapDevices = [ { diff --git a/hosts/remilia/mailserver.nix b/hosts/remilia/mailserver.nix index 2f7c22f..ffbb6d7 100644 --- a/hosts/remilia/mailserver.nix +++ b/hosts/remilia/mailserver.nix @@ -1,7 +1,15 @@ -{ 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; fqdn = "mail.${domain}"; diff --git a/hosts/remilia/networking.nix b/hosts/remilia/networking.nix index 61c0808..7eef68f 100644 --- a/hosts/remilia/networking.nix +++ b/hosts/remilia/networking.nix @@ -1,27 +1,43 @@ -{ lib, config, conf, pkgs, ... }: +{ + lib, + config, + conf, + pkgs, + ... +}: { networking = { useDHCP = false; hostName = "remilia"; - firewall = - { - interfaces = { - ens3 = { - allowedTCPPorts = [ 80 81 443 444 993 465 143 25 22 22001 22002 4444 ] - ++ (map (x: x.sourcePort) config.networking.nat.forwardPorts); - allowedUDPPorts = [ 17840 ]; - }; + firewall = { + interfaces = { + ens3 = { + 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: - 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; }; + 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; + }; interfaces = { ens3 = { useDHCP = true; diff --git a/hosts/remilia/services.nix b/hosts/remilia/services.nix index 2db265d..5f1ec0a 100644 --- a/hosts/remilia/services.nix +++ b/hosts/remilia/services.nix @@ -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,20 +33,29 @@ in ''; virtualHosts = let - genericHttpRProxy = { addr, ssl ? true, conf ? "" }: { - enableACME = ssl; - # addSSL = ssl; - forceSSL = ssl; - locations."/" = { - proxyPass = toString addr; - extraConfig = '' - expires $expires; - proxy_set_header Host $host; - '' + conf; + genericHttpRProxy = + { + addr, + ssl ? true, + conf ? "", + }: + { + enableACME = ssl; + # addSSL = ssl; + forceSSL = ssl; + locations."/" = { + proxyPass = toString addr; + extraConfig = + '' + expires $expires; + proxy_set_header Host $host; + '' + + conf; + }; }; - }; in - with conf.network.addresses.wireguard.ips; { + with conf.network.addresses.wireguard.ips; + { "${domain}" = { addSSL = true; enableACME = true; @@ -51,7 +69,8 @@ in # "consul.${domain}" = genericHttpRProxy { addr = "http://${marisa}:8500"; }; "f.${domain}" = genericHttpRProxy { addr = "http://${marisa}:8000"; }; "radio.${domain}" = genericHttpRProxy { addr = "http://${satori}:8001"; }; - /* "radio.${domain}" = { + /* + "radio.${domain}" = { addSSL = true; enableACME = true; locations."/" = { @@ -62,13 +81,15 @@ in ''; }; locations."= /".return = "301 /radio"; - };*/ + }; + */ "git.${domain}" = genericHttpRProxy { addr = "http://${marisa}:5001"; conf = "client_max_body_size 64M;"; }; - /*"nomad.${domain}" = genericHttpRProxy { + /* + "nomad.${domain}" = genericHttpRProxy { addr = "http://${marisa}:4646"; conf = '' proxy_buffering off; @@ -80,4 +101,3 @@ in }; }; } - diff --git a/hosts/satori/boot.nix b/hosts/satori/boot.nix index b738eaa..f80ad39 100644 --- a/hosts/satori/boot.nix +++ b/hosts/satori/boot.nix @@ -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; diff --git a/hosts/satori/default.nix b/hosts/satori/default.nix index 87820aa..d978162 100644 --- a/hosts/satori/default.nix +++ b/hosts/satori/default.nix @@ -1,13 +1,12 @@ { lib, config, ... }: { - imports = - [ - ./hardware.nix - ./stuff.nix - ./networking.nix - ./boot.nix - ./services.nix - ./graphics.nix - ]; + imports = [ + ./hardware.nix + ./stuff.nix + ./networking.nix + ./boot.nix + ./services.nix + ./graphics.nix + ]; system.stateVersion = "23.05"; } diff --git a/hosts/satori/graphics.nix b/hosts/satori/graphics.nix index ca046ca..b869441 100644 --- a/hosts/satori/graphics.nix +++ b/hosts/satori/graphics.nix @@ -1,4 +1,9 @@ -{ config, pkgs, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: let nvidia-offload = pkgs.writeShellScriptBin "nvi" '' export __NV_PRIME_RENDER_OFFLOAD=1 @@ -23,11 +28,15 @@ in 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; diff --git a/hosts/satori/hardware.nix b/hosts/satori/hardware.nix index 6bf5ccc..bb7b168 100644 --- a/hosts/satori/hardware.nix +++ b/hosts/satori/hardware.nix @@ -1,29 +1,30 @@ -{ config, lib, modulesPath, ... }: +{ + config, + lib, + modulesPath, + ... +}: { - imports = - [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - fileSystems."/" = - { - device = "/dev/disk/by-uuid/59af143c-1a87-4654-9b31-7594ac8ba530"; - fsType = "ext4"; - }; + 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."/media/real" = { + device = "/dev/disk/by-uuid/8086be20-c770-46be-bd8f-5bd2d7735c7d"; + fsType = "btrfs"; + options = [ "compress-force=zstd:3" ]; + }; - fileSystems."/boot/efi" = - { - device = "/dev/disk/by-uuid/2424-5639"; - fsType = "vfat"; - }; + fileSystems."/boot/efi" = { + device = "/dev/disk/by-uuid/2424-5639"; + fsType = "vfat"; + }; zramSwap = { enable = true; @@ -33,7 +34,10 @@ }; swapDevices = [ - { device = "/var/swap"; size = 4096; } + { + device = "/var/swap"; + size = 4096; + } ]; powerManagement = { diff --git a/hosts/satori/networking.nix b/hosts/satori/networking.nix index eebc091..0cb6ded 100644 --- a/hosts/satori/networking.nix +++ b/hosts/satori/networking.nix @@ -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 = [{ - #Oracle VM1 - publicKey = "z0Y2VNEWcyVQVSqRHiwmiJ5/0MgSPM+HZfEcwIccSxM="; - allowedIPs = [ remilia ]; - endpoint = "${conf.network.addresses.domain.natto}:17840"; - persistentKeepalive = 25; - }]; + 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" + ]; }; } diff --git a/hosts/satori/services.nix b/hosts/satori/services.nix index 146dd41..a77ce4e 100644 --- a/hosts/satori/services.nix +++ b/hosts/satori/services.nix @@ -1,4 +1,9 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: { services = { openssh = { diff --git a/hosts/satori/stuff.nix b/hosts/satori/stuff.nix index 0badb1c..38b121f 100644 --- a/hosts/satori/stuff.nix +++ b/hosts/satori/stuff.nix @@ -1,4 +1,9 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: { time.timeZone = "Asia/Kolkata"; @@ -11,12 +16,19 @@ }; 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 = { diff --git a/hosts/suwako/boot.nix b/hosts/suwako/boot.nix index 6f50331..3ebc8b6 100644 --- a/hosts/suwako/boot.nix +++ b/hosts/suwako/boot.nix @@ -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; diff --git a/hosts/suwako/default.nix b/hosts/suwako/default.nix index 1bb72b3..575c504 100644 --- a/hosts/suwako/default.nix +++ b/hosts/suwako/default.nix @@ -1,4 +1,9 @@ -{ config, pkgs, conf, ... }: +{ + config, + pkgs, + conf, + ... +}: { imports = [ ./networking.nix diff --git a/hosts/suwako/hardware.nix b/hosts/suwako/hardware.nix index 480f3b5..fca19ec 100644 --- a/hosts/suwako/hardware.nix +++ b/hosts/suwako/hardware.nix @@ -1,16 +1,20 @@ -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ - (modulesPath + "/profiles/qemu-guest.nix") - ]; + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; - fileSystems."/" = - { - device = "/dev/disk/by-uuid/e87c20b9-f451-45bf-b863-385ac9c290cf "; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/e87c20b9-f451-45bf-b863-385ac9c290cf "; + fsType = "ext4"; + }; swapDevices = [ { diff --git a/hosts/suwako/networking.nix b/hosts/suwako/networking.nix index af2bcee..e927c1f 100644 --- a/hosts/suwako/networking.nix +++ b/hosts/suwako/networking.nix @@ -1,16 +1,25 @@ -{ lib, config, conf, pkgs, ... }: +{ + lib, + config, + conf, + pkgs, + ... +}: { networking = { useDHCP = false; hostName = "suwako"; - firewall = - { - interfaces = { - enp0s6 = { - allowedTCPPorts = [ 22 443 80 ]; - }; + firewall = { + interfaces = { + enp0s6 = { + allowedTCPPorts = [ + 22 + 443 + 80 + ]; }; }; + }; interfaces = { enp0s6 = { useDHCP = true; diff --git a/hosts/suwako/services.nix b/hosts/suwako/services.nix index d063848..fa470a8 100644 --- a/hosts/suwako/services.nix +++ b/hosts/suwako/services.nix @@ -1,4 +1,10 @@ -{ config, pkgs, lib, conf, ... }: +{ + config, + pkgs, + lib, + conf, + ... +}: let domain = conf.network.addresses.domain.natto; in @@ -13,4 +19,3 @@ in }; }; } - diff --git a/hosts/vault-agent.nix b/hosts/vault-agent.nix index 148d5f5..c01a09f 100644 --- a/hosts/vault-agent.nix +++ b/hosts/vault-agent.nix @@ -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,48 +64,49 @@ in }; }; - config = mkIf cfg.enable - ({ + config = mkIf cfg.enable ({ + users = { users = { - users = { - "${cfg.userName}" = { - group = cfg.groupName; - uid = cfg.uid; - isSystemUser = true; - description = "Vault-Agent User"; - }; - }; - groups = { - "${cfg.groupName}" = { - gid = cfg.gid; - }; + "${cfg.userName}" = { + group = cfg.groupName; + uid = cfg.uid; + isSystemUser = true; + description = "Vault-Agent User"; }; }; - systemd.tmpfiles.rules = mkIf (cfg.secretsDir != null) [ - "d ${cfg.secretsDir} 6755 vault-agent ${cfg.groupName} 0" - ]; - systemd.services.vault-agent = { - description = "Vault Agent"; - wantedBy = [ "multi-user.target" ]; - wants = [ "network-online.target" ]; - after = [ "network-online.target" ]; - path = (with pkgs; [ + groups = { + "${cfg.groupName}" = { + gid = cfg.gid; + }; + }; + }; + systemd.tmpfiles.rules = mkIf (cfg.secretsDir != null) [ + "d ${cfg.secretsDir} 6755 vault-agent ${cfg.groupName} 0" + ]; + systemd.services.vault-agent = { + description = "Vault Agent"; + wantedBy = [ "multi-user.target" ]; + wants = [ "network-online.target" ]; + after = [ "network-online.target" ]; + path = ( + with pkgs; + [ glibc - ]); - serviceConfig = { - User = cfg.userName; - Group = cfg.groupName; - ExecReload = "${pkgs.busybox}/bin/kill -HUP $MAINPID"; - ExecStart = "${cfg.package}/bin/vault agent -config=${json.generate "vault.json" cfg.settings}"; - KillMode = "process"; - KillSignal = "SIGINT"; - Restart = "on-failure"; - TimeoutStopSec = "30s"; - RestartSec = 2; - ConfigurationDirectory = "vault-agent"; - ConfigurationDirectoryMode = "0600"; - }; + ] + ); + serviceConfig = { + User = cfg.userName; + Group = cfg.groupName; + ExecReload = "${pkgs.busybox}/bin/kill -HUP $MAINPID"; + ExecStart = "${cfg.package}/bin/vault agent -config=${json.generate "vault.json" cfg.settings}"; + KillMode = "process"; + KillSignal = "SIGINT"; + Restart = "on-failure"; + TimeoutStopSec = "30s"; + RestartSec = 2; + ConfigurationDirectory = "vault-agent"; + ConfigurationDirectoryMode = "0600"; }; - }); + }; + }); } - diff --git a/hosts/x86builder.nix b/hosts/x86builder.nix index 1cf621d..8054288 100644 --- a/hosts/x86builder.nix +++ b/hosts/x86builder.nix @@ -4,13 +4,23 @@ 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" ]; - }]; + buildMachines = [ + { + hostName = "okina"; + systems = [ + "x86_64-linux" + "aarch64-linux" + ]; + maxJobs = 4; + speedFactor = 2; + supportedFeatures = [ + "nixos-test" + "benchmark" + "big-parallel" + "kvm" + ]; + } + ]; distributedBuilds = true; }; } diff --git a/pkgs/customscripts/default.nix b/pkgs/customscripts/default.nix index 2a4ca92..3a66b9e 100644 --- a/pkgs/customscripts/default.nix +++ b/pkgs/customscripts/default.nix @@ -1,4 +1,8 @@ -{ lib, stdenvNoCC, fetchFromGitHub }: +{ + lib, + stdenvNoCC, + fetchFromGitHub, +}: stdenvNoCC.mkDerivation { name = "customscripts"; diff --git a/pkgs/default.nix b/pkgs/default.nix index ed9d049..f581c9c 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,4 +1,5 @@ -{ self, ... }: { +{ self, ... }: +{ flake = { overlays = rec { packages = import ./packages.nix; @@ -6,7 +7,9 @@ }; }; - perSystem = { pkgs, ... }: { - packages = self.overlays.default null pkgs; - }; + perSystem = + { pkgs, ... }: + { + packages = self.overlays.default null pkgs; + }; } diff --git a/pkgs/nattovim/default.nix b/pkgs/nattovim/default.nix index 573436e..e4df9d6 100644 --- a/pkgs/nattovim/default.nix +++ b/pkgs/nattovim/default.nix @@ -1,4 +1,11 @@ -{ wrapNeovimUnstable, neovimUtils, neovim-unwrapped, nvimPackage ? neovim-unwrapped, vimPlugins, ... }: +{ + wrapNeovimUnstable, + neovimUtils, + neovim-unwrapped, + nvimPackage ? neovim-unwrapped, + vimPlugins, + ... +}: let nvimConfig = neovimUtils.makeNeovimConfig { plugins = with vimPlugins; [ @@ -24,8 +31,11 @@ let ]; }; in -wrapNeovimUnstable nvimPackage (nvimConfig // { - luaRcContent = '' - ${builtins.readFile ./init.lua} - ''; -}) +wrapNeovimUnstable nvimPackage ( + nvimConfig + // { + luaRcContent = '' + ${builtins.readFile ./init.lua} + ''; + } +) diff --git a/pkgs/simp1e/default.nix b/pkgs/simp1e/default.nix index 575e0d3..87f821f 100644 --- a/pkgs/simp1e/default.nix +++ b/pkgs/simp1e/default.nix @@ -1,4 +1,11 @@ -{ lib, stdenvNoCC, fetchFromGitLab, python3, librsvg, xcursorgen }: +{ + lib, + stdenvNoCC, + fetchFromGitLab, + python3, + librsvg, + xcursorgen, +}: stdenvNoCC.mkDerivation rec { pname = "simp1e-cursors"; @@ -36,4 +43,3 @@ stdenvNoCC.mkDerivation rec { maintainers = with maintainers; [ natto1784 ]; }; } -