From 415715a4f9f0c586f997aeb87d161b7a626ac71c Mon Sep 17 00:00:00 2001 From: osbm Date: Sat, 12 Jul 2025 21:36:18 +0300 Subject: [PATCH] formatting --- flake.nix | 123 +++++++++--------- home/alacritty.nix | 10 +- home/firefox.nix | 21 +-- home/ghostty.nix | 3 +- home/gtk.nix | 3 +- home/home.nix | 3 +- home/ssh.nix | 6 +- home/tlrc.nix | 2 +- home/tmux/default.nix | 14 +- home/wezterm.nix | 3 +- hosts/atreus/configuration.nix | 3 +- hosts/harmonica-sd/configuration.nix | 5 +- hosts/harmonica-sd/hardware-configuration.nix | 14 +- hosts/harmonica-sd/sd-image.nix | 24 ++-- hosts/harmonica/configuration.nix | 3 +- hosts/harmonica/hardware-configuration.nix | 14 +- hosts/iso/configuration.nix | 3 +- hosts/pochita-sd/configuration.nix | 15 ++- hosts/pochita/configuration.nix | 3 +- hosts/pochita/hardware-configuration.nix | 18 ++- hosts/tartarus/configuration.nix | 5 +- hosts/tartarus/hardware-configuration.nix | 24 +++- hosts/wallfacer/configuration.nix | 3 +- hosts/wallfacer/hardware-configuration.nix | 26 +++- hosts/ymir/configuration.nix | 10 +- hosts/ymir/hardware-configuration.nix | 25 +++- lib/default.nix | 12 +- modules/adb.nix | 5 +- modules/arduino.nix | 3 +- modules/common-packages.nix | 3 +- modules/concentration.nix | 3 +- modules/disable-hibernation.nix | 3 +- modules/emulation.nix | 5 +- modules/fonts.nix | 24 +++- modules/graphical-interface.nix | 5 +- modules/home.nix | 3 +- modules/i18n.nix | 3 +- modules/minegrub.nix | 17 ++- modules/nix-settings.nix | 16 ++- modules/remote-builds.nix | 3 +- modules/secrets.nix | 3 +- modules/services/caddy.nix | 11 +- modules/services/cloudflare-dyndns.nix | 10 +- modules/services/cloudflared.nix | 3 +- modules/services/forgejo.nix | 3 +- modules/services/jellyfin.nix | 5 +- modules/services/nextcloud.nix | 3 +- modules/services/ollama.nix | 8 +- modules/services/system-logger/default.nix | 16 ++- modules/services/tailscale.nix | 7 +- modules/services/vaultwarden.nix | 3 +- modules/services/vscode-server.nix | 8 +- modules/services/wanikani-bypass-lessons.nix | 13 +- .../services/wanikani-fetch-data/default.nix | 14 +- modules/sound.nix | 3 +- modules/users.nix | 11 +- modules/wake-on-lan.nix | 7 +- secrets/secrets.nix | 11 +- 58 files changed, 398 insertions(+), 229 deletions(-) diff --git a/flake.nix b/flake.nix index b827be1..94aea54 100644 --- a/flake.nix +++ b/flake.nix @@ -41,67 +41,74 @@ nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = { - self, - nixpkgs, - nix-on-droid, - deploy-rs, - ... - } @ inputs: let - inherit (self) outputs; - supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ]; - forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system); - makePkgs = system: import nixpkgs { inherit system; }; - in { - nixosConfigurations = { - tartarus = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs;}; - modules = [./hosts/tartarus/configuration.nix]; + outputs = + { + self, + nixpkgs, + nix-on-droid, + deploy-rs, + ... + }@inputs: + let + inherit (self) outputs; + supportedSystems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + ]; + forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system); + makePkgs = system: import nixpkgs { inherit system; }; + in + { + nixosConfigurations = { + tartarus = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs outputs; }; + modules = [ ./hosts/tartarus/configuration.nix ]; + }; + ymir = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs outputs; }; + modules = [ ./hosts/ymir/configuration.nix ]; + }; + harmonica = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs outputs; }; + modules = [ ./hosts/harmonica/configuration.nix ]; + }; + harmonica-sd = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs outputs; }; + modules = [ ./hosts/harmonica-sd/configuration.nix ]; + }; + pochita = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs outputs; }; + modules = [ ./hosts/pochita/configuration.nix ]; + }; + pochita-sd = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs outputs; }; + modules = [ ./hosts/pochita-sd/configuration.nix ]; + }; + myISO = nixpkgs.lib.nixosSystem { + modules = [ + ./hosts/iso/configuration.nix + "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-plasma6.nix" + ]; + }; + wallfacer = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs outputs; }; + modules = [ ./hosts/wallfacer/configuration.nix ]; + }; }; - ymir = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs;}; - modules = [./hosts/ymir/configuration.nix]; + nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration { + extraSpecialArgs = { inherit inputs outputs; }; + pkgs = import nixpkgs { system = "aarch64-linux"; }; + modules = [ ./hosts/atreus/configuration.nix ]; }; - harmonica = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs;}; - modules = [./hosts/harmonica/configuration.nix]; - }; - harmonica-sd = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs;}; - modules = [./hosts/harmonica-sd/configuration.nix]; - }; - pochita = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs;}; - modules = [./hosts/pochita/configuration.nix]; - }; - pochita-sd = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs;}; - modules = [./hosts/pochita-sd/configuration.nix]; - }; - myISO = nixpkgs.lib.nixosSystem { - modules = [ - ./hosts/iso/configuration.nix - "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-plasma6.nix" - ]; - }; - wallfacer = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs;}; - modules = [./hosts/wallfacer/configuration.nix]; - }; - }; - nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration { - extraSpecialArgs = {inherit inputs outputs;}; - pkgs = import nixpkgs {system = "aarch64-linux";}; - modules = [./hosts/atreus/configuration.nix]; - }; - formatter = forAllSystems (system: (makePkgs system).nixfmt-rfc-style); - deploy.nodes.harmonica = { - hostname = "192.168.0.11"; - profiles.system = { - user = "osbm"; - path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.harmonica; + formatter = forAllSystems (system: (makePkgs system).nixfmt-rfc-style); + deploy.nodes.harmonica = { + hostname = "192.168.0.11"; + profiles.system = { + user = "osbm"; + path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.harmonica; + }; }; }; - }; } diff --git a/home/alacritty.nix b/home/alacritty.nix index 2c61acc..10c431b 100644 --- a/home/alacritty.nix +++ b/home/alacritty.nix @@ -3,7 +3,8 @@ lib, config, ... -}: { +}: +{ options.enableAlacritty = lib.mkEnableOption "Alacritty terminal emulator"; config = { programs.alacritty = { @@ -14,7 +15,12 @@ normal.family = "Cascadia Code"; }; terminal.shell = { - args = ["new-session" "-A" "-s" "general"]; + args = [ + "new-session" + "-A" + "-s" + "general" + ]; program = lib.getExe pkgs.tmux; }; window = { diff --git a/home/firefox.nix b/home/firefox.nix index 1c1b5c7..435e104 100644 --- a/home/firefox.nix +++ b/home/firefox.nix @@ -2,7 +2,8 @@ lib, config, ... -}: { +}: +{ options.enableFirefox = lib.mkEnableOption "enableFirefox"; config = { programs.firefox = { @@ -32,15 +33,17 @@ DisplayBookmarksToolbar = "always"; # alternatives: "never" or "newtab" # DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" # SearchBar = "unified"; # alternat - ExtensionSettings = with builtins; let - extension = shortId: uuid: { - name = uuid; - value = { - install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi"; - installation_mode = "normal_installed"; + ExtensionSettings = + with builtins; + let + extension = shortId: uuid: { + name = uuid; + value = { + install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi"; + installation_mode = "normal_installed"; + }; }; - }; - in + in listToAttrs [ (extension "tree-style-tab" "treestyletab@piro.sakura.ne.jp") (extension "ublock-origin" "uBlock0@raymondhill.net") diff --git a/home/ghostty.nix b/home/ghostty.nix index 913ecb7..2194d42 100644 --- a/home/ghostty.nix +++ b/home/ghostty.nix @@ -2,7 +2,8 @@ lib, config, ... -}: { +}: +{ options.enableGhostty = lib.mkEnableOption "Ghostty terminal emulator"; config = { programs.ghostty = { diff --git a/home/gtk.nix b/home/gtk.nix index eb3d5c4..5e171fa 100644 --- a/home/gtk.nix +++ b/home/gtk.nix @@ -3,7 +3,8 @@ lib, config, ... -}: { +}: +{ options = { # Enable the GTK theme enableGTK = lib.mkEnableOption "enableGTK"; diff --git a/home/home.nix b/home/home.nix index dafc3ec..5f53dc5 100644 --- a/home/home.nix +++ b/home/home.nix @@ -2,7 +2,8 @@ config, pkgs, ... -}: { +}: +{ imports = [ ./alacritty.nix ./tmux diff --git a/home/ssh.nix b/home/ssh.nix index 422ffef..a7ab6d8 100644 --- a/home/ssh.nix +++ b/home/ssh.nix @@ -1,4 +1,5 @@ -{...}: let +{ ... }: +let # define a block that just takes a hostname and returns attrset to not repeat the same fields sshBlock = hostname: { hostname = hostname; @@ -18,7 +19,8 @@ port = 8022; # fish not found error ??? }; -in { +in +{ programs.ssh = { enable = true; hashKnownHosts = true; diff --git a/home/tlrc.nix b/home/tlrc.nix index af7f3f1..562273a 100644 --- a/home/tlrc.nix +++ b/home/tlrc.nix @@ -5,7 +5,7 @@ }: # stolen from https://github.com/dmarcoux/dotfiles { - home.packages = [pkgs.tlrc]; + home.packages = [ pkgs.tlrc ]; xdg.configFile."tlrc/config.toml".text = '' [cache] dir = "${config.xdg.cacheHome}/tlrc" diff --git a/home/tmux/default.nix b/home/tmux/default.nix index e545a2d..1a773fd 100644 --- a/home/tmux/default.nix +++ b/home/tmux/default.nix @@ -2,10 +2,11 @@ pkgs, lib, ... -}: let - wanikani-current-reviews-script = builtins.path {path = ./wanikani-current-reviews.sh;}; - wanikani-level-script = builtins.path {path = ./wanikani-level.sh;}; - wanikani-progression-script = builtins.path {path = ./wanikani-progression.sh;}; +}: +let + wanikani-current-reviews-script = builtins.path { path = ./wanikani-current-reviews.sh; }; + wanikani-level-script = builtins.path { path = ./wanikani-level.sh; }; + wanikani-progression-script = builtins.path { path = ./wanikani-progression.sh; }; tmux-dracula = pkgs.tmuxPlugins.mkTmuxPlugin rec { pluginName = "dracula"; version = "3.0.0"; @@ -26,10 +27,11 @@ description = "Feature packed Dracula theme for tmux!"; license = licenses.mit; platforms = platforms.unix; - maintainers = with maintainers; [ethancedwards8]; + maintainers = with maintainers; [ ethancedwards8 ]; }; }; -in { +in +{ programs.tmux = { enable = true; historyLimit = 100000; diff --git a/home/wezterm.nix b/home/wezterm.nix index de0f194..4f1b0c2 100644 --- a/home/wezterm.nix +++ b/home/wezterm.nix @@ -3,7 +3,8 @@ config, pkgs, ... -}: { +}: +{ options.enableWezterm = lib.mkEnableOption "Wezterm terminal emulator"; config = { programs.wezterm = { diff --git a/hosts/atreus/configuration.nix b/hosts/atreus/configuration.nix index 2a805e8..5b2ef4e 100644 --- a/hosts/atreus/configuration.nix +++ b/hosts/atreus/configuration.nix @@ -2,7 +2,8 @@ lib, pkgs, ... -}: { +}: +{ user.userName = lib.mkForce "osbm"; # fuck i hate unmaintained projects environment.packages = with pkgs; [ vim # or some other editor, e.g. nano or neovim diff --git a/hosts/harmonica-sd/configuration.nix b/hosts/harmonica-sd/configuration.nix index 22c3ac1..a8f9874 100644 --- a/hosts/harmonica-sd/configuration.nix +++ b/hosts/harmonica-sd/configuration.nix @@ -2,7 +2,8 @@ lib, inputs, ... -}: { +}: +{ imports = [ ./sd-image.nix "${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" @@ -28,7 +29,7 @@ interfaces."wlan0".useDHCP = true; wireless = { enable = true; - interfaces = ["wlan0"]; + interfaces = [ "wlan0" ]; networks = { "House_Bayram" = { psk = "PASSWORD"; diff --git a/hosts/harmonica-sd/hardware-configuration.nix b/hosts/harmonica-sd/hardware-configuration.nix index 6627bca..541780f 100644 --- a/hosts/harmonica-sd/hardware-configuration.nix +++ b/hosts/harmonica-sd/hardware-configuration.nix @@ -2,12 +2,12 @@ pkgs, lib, ... -}: { +}: +{ # Some packages (ahci fail... this bypasses that) https://discourse.nixos.org/t/does-pkgs-linuxpackages-rpi3-build-all-required-kernel-modules/42509 nixpkgs.overlays = [ (final: super: { - makeModulesClosure = x: - super.makeModulesClosure (x // {allowMissing = true;}); + makeModulesClosure = x: super.makeModulesClosure (x // { allowMissing = true; }); }) ]; @@ -37,7 +37,7 @@ hardware = { enableRedistributableFirmware = lib.mkForce false; - firmware = [pkgs.raspberrypiWirelessFirmware]; # Keep this to make sure wifi works + firmware = [ pkgs.raspberrypiWirelessFirmware ]; # Keep this to make sure wifi works i2c.enable = true; deviceTree.filter = "bcm2837-rpi-zero*.dtb"; deviceTree.overlays = [ @@ -63,7 +63,11 @@ boot = { kernelPackages = pkgs.linuxPackages_rpi02w; - initrd.availableKernelModules = ["xhci_pci" "usbhid" "usb_storage"]; + initrd.availableKernelModules = [ + "xhci_pci" + "usbhid" + "usb_storage" + ]; loader = { grub.enable = false; generic-extlinux-compatible.enable = true; diff --git a/hosts/harmonica-sd/sd-image.nix b/hosts/harmonica-sd/sd-image.nix index 1893925..d6de7d4 100644 --- a/hosts/harmonica-sd/sd-image.nix +++ b/hosts/harmonica-sd/sd-image.nix @@ -4,11 +4,12 @@ config, lib, ... -}: { +}: +{ options.sdImage = with lib; { extraFirmwareConfig = mkOption { type = types.attrs; - default = {}; + default = { }; description = lib.mdDoc '' Extra configuration to be added to config.txt. ''; @@ -18,15 +19,14 @@ config = { sdImage.populateFirmwareCommands = lib.mkIf ((lib.length (lib.attrValues config.sdImage.extraFirmwareConfig)) > 0) - ( - let - # Convert the set into a string of lines of "key=value" pairs. - keyValueMap = name: value: name + "=" + toString value; - keyValueList = lib.mapAttrsToList keyValueMap config.sdImage.extraFirmwareConfig; - extraFirmwareConfigString = lib.concatStringsSep "\n" keyValueList; - in - lib.mkAfter - '' + ( + let + # Convert the set into a string of lines of "key=value" pairs. + keyValueMap = name: value: name + "=" + toString value; + keyValueList = lib.mapAttrsToList keyValueMap config.sdImage.extraFirmwareConfig; + extraFirmwareConfigString = lib.concatStringsSep "\n" keyValueList; + in + lib.mkAfter '' config=firmware/config.txt # The initial file has just been created without write permissions. Add them to be able to append the file. chmod u+w $config @@ -34,6 +34,6 @@ echo "${extraFirmwareConfigString}" >> $config chmod u-w $config '' - ); + ); }; } diff --git a/hosts/harmonica/configuration.nix b/hosts/harmonica/configuration.nix index d525bb8..928a786 100644 --- a/hosts/harmonica/configuration.nix +++ b/hosts/harmonica/configuration.nix @@ -2,7 +2,8 @@ lib, inputs, ... -}: { +}: +{ imports = [ ./hardware-configuration.nix ../../modules diff --git a/hosts/harmonica/hardware-configuration.nix b/hosts/harmonica/hardware-configuration.nix index 1a0ba46..27edb68 100644 --- a/hosts/harmonica/hardware-configuration.nix +++ b/hosts/harmonica/hardware-configuration.nix @@ -2,12 +2,12 @@ pkgs, lib, ... -}: { +}: +{ # Some packages (ahci fail... this bypasses that) https://discourse.nixos.org/t/does-pkgs-linuxpackages-rpi3-build-all-required-kernel-modules/42509 nixpkgs.overlays = [ (final: super: { - makeModulesClosure = x: - super.makeModulesClosure (x // {allowMissing = true;}); + makeModulesClosure = x: super.makeModulesClosure (x // { allowMissing = true; }); }) ]; @@ -23,7 +23,7 @@ hardware = { enableRedistributableFirmware = lib.mkForce false; - firmware = [pkgs.raspberrypiWirelessFirmware]; # Keep this to make sure wifi works + firmware = [ pkgs.raspberrypiWirelessFirmware ]; # Keep this to make sure wifi works i2c.enable = true; deviceTree.filter = "bcm2837-rpi-zero*.dtb"; deviceTree.overlays = [ @@ -49,7 +49,11 @@ boot = { kernelPackages = pkgs.linuxPackages_rpi02w; - initrd.availableKernelModules = ["xhci_pci" "usbhid" "usb_storage"]; + initrd.availableKernelModules = [ + "xhci_pci" + "usbhid" + "usb_storage" + ]; loader = { grub.enable = false; generic-extlinux-compatible.enable = true; diff --git a/hosts/iso/configuration.nix b/hosts/iso/configuration.nix index a7139a2..54c819d 100644 --- a/hosts/iso/configuration.nix +++ b/hosts/iso/configuration.nix @@ -4,7 +4,8 @@ pkgs, system, ... -}: { +}: +{ imports = [ ]; diff --git a/hosts/pochita-sd/configuration.nix b/hosts/pochita-sd/configuration.nix index 7b5815d..ae3bbe0 100644 --- a/hosts/pochita-sd/configuration.nix +++ b/hosts/pochita-sd/configuration.nix @@ -2,7 +2,8 @@ pkgs, inputs, ... -}: { +}: +{ imports = [ inputs.raspberry-pi-nix.nixosModules.raspberry-pi inputs.raspberry-pi-nix.nixosModules.sd-image @@ -19,7 +20,7 @@ # Define a user account. Don't forget to set a password with ‘passwd’. users.users.osbm = { isNormalUser = true; - extraGroups = ["wheel"]; # Enable ‘sudo’ for the user. + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. initialPassword = "changeme"; }; @@ -37,9 +38,15 @@ wget ]; - nix.settings.experimental-features = ["nix-command" "flakes"]; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; - nix.settings.trusted-users = ["root" "osbm"]; + nix.settings.trusted-users = [ + "root" + "osbm" + ]; nixpkgs.hostPlatform = "aarch64-linux"; diff --git a/hosts/pochita/configuration.nix b/hosts/pochita/configuration.nix index a5ce70a..5863e02 100644 --- a/hosts/pochita/configuration.nix +++ b/hosts/pochita/configuration.nix @@ -3,7 +3,8 @@ lib, inputs, ... -}: { +}: +{ imports = [ ./hardware-configuration.nix ../../modules diff --git a/hosts/pochita/hardware-configuration.nix b/hosts/pochita/hardware-configuration.nix index 90ca28b..6a94256 100644 --- a/hosts/pochita/hardware-configuration.nix +++ b/hosts/pochita/hardware-configuration.nix @@ -5,15 +5,16 @@ lib, modulesPath, ... -}: { +}: +{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = []; - boot.initrd.kernelModules = []; - boot.kernelModules = []; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; fileSystems."/" = { device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; @@ -23,10 +24,13 @@ fileSystems."/boot/firmware" = { device = "/dev/disk/by-uuid/2178-694E"; fsType = "vfat"; - options = ["fmask=0022" "dmask=0022"]; + options = [ + "fmask=0022" + "dmask=0022" + ]; }; - swapDevices = []; + 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 diff --git a/hosts/tartarus/configuration.nix b/hosts/tartarus/configuration.nix index 0b1ade8..0a058b9 100644 --- a/hosts/tartarus/configuration.nix +++ b/hosts/tartarus/configuration.nix @@ -3,7 +3,8 @@ pkgs, inputs, ... -}: { +}: +{ imports = [ ./hardware-configuration.nix ../../modules @@ -19,7 +20,7 @@ }; virtualisation.virtualbox.host.enable = true; - users.extraGroups.vboxusers.members = ["osbm"]; + users.extraGroups.vboxusers.members = [ "osbm" ]; # Bootloader. boot.loader.systemd-boot.enable = true; diff --git a/hosts/tartarus/hardware-configuration.nix b/hosts/tartarus/hardware-configuration.nix index aecb129..9d9879a 100644 --- a/hosts/tartarus/hardware-configuration.nix +++ b/hosts/tartarus/hardware-configuration.nix @@ -7,15 +7,22 @@ pkgs, modulesPath, ... -}: { +}: +{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; fileSystems."/" = { device = "/dev/disk/by-uuid/246d3df7-3578-44b2-8aee-c1ed33581184"; @@ -25,11 +32,14 @@ fileSystems."/boot" = { device = "/dev/disk/by-uuid/33D0-6524"; fsType = "vfat"; - options = ["fmask=0077" "dmask=0077"]; + options = [ + "fmask=0077" + "dmask=0077" + ]; }; swapDevices = [ - {device = "/dev/disk/by-uuid/b74b04db-c7ea-44e7-b3fe-15cd6d0cd851";} + { device = "/dev/disk/by-uuid/b74b04db-c7ea-44e7-b3fe-15cd6d0cd851"; } ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking diff --git a/hosts/wallfacer/configuration.nix b/hosts/wallfacer/configuration.nix index bffe71f..9c059d9 100644 --- a/hosts/wallfacer/configuration.nix +++ b/hosts/wallfacer/configuration.nix @@ -1,4 +1,5 @@ -{lib, ...}: { +{ lib, ... }: +{ imports = [ ./hardware-configuration.nix ../../modules diff --git a/hosts/wallfacer/hardware-configuration.nix b/hosts/wallfacer/hardware-configuration.nix index 79297e2..d9c96cf 100644 --- a/hosts/wallfacer/hardware-configuration.nix +++ b/hosts/wallfacer/hardware-configuration.nix @@ -7,15 +7,24 @@ pkgs, modulesPath, ... -}: { +}: +{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["ahci" "ehci_pci" "megaraid_sas" "nvme" "usbhid" "usb_storage" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ + "ahci" + "ehci_pci" + "megaraid_sas" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; fileSystems."/" = { device = "/dev/disk/by-uuid/8270dba5-6d89-438a-90bd-d9f29b20cb5b"; @@ -25,11 +34,14 @@ fileSystems."/boot" = { device = "/dev/disk/by-uuid/A1EB-43F8"; fsType = "vfat"; - options = ["fmask=0077" "dmask=0077"]; + options = [ + "fmask=0077" + "dmask=0077" + ]; }; swapDevices = [ - {device = "/dev/disk/by-uuid/534ea30c-2664-498b-915f-41b037eba01b";} + { device = "/dev/disk/by-uuid/534ea30c-2664-498b-915f-41b037eba01b"; } ]; # 2 tb mini hdd diff --git a/hosts/ymir/configuration.nix b/hosts/ymir/configuration.nix index 9cbe2aa..b97b4a6 100644 --- a/hosts/ymir/configuration.nix +++ b/hosts/ymir/configuration.nix @@ -2,7 +2,8 @@ config, pkgs, ... -}: { +}: +{ imports = [ ./hardware-configuration.nix ../../modules @@ -29,7 +30,10 @@ networking.hostName = "ymir"; # Define your hostname. - networking.firewall.allowedTCPPorts = [8889 8000]; + networking.firewall.allowedTCPPorts = [ + 8889 + 8000 + ]; # Enable networking networking.networkmanager.enable = true; @@ -47,7 +51,7 @@ virtualisation.waydroid.enable = true; # Load nvidia driver for Xorg and Wayland - services.xserver.videoDrivers = ["nvidia"]; + services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia = { # Modesetting is required. diff --git a/hosts/ymir/hardware-configuration.nix b/hosts/ymir/hardware-configuration.nix index 2c07fa7..35232ea 100644 --- a/hosts/ymir/hardware-configuration.nix +++ b/hosts/ymir/hardware-configuration.nix @@ -7,15 +7,23 @@ pkgs, modulesPath, ... -}: { +}: +{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; fileSystems."/" = { device = "/dev/disk/by-uuid/fd6792b4-d1ec-493c-a686-64dbeaac3371"; @@ -25,11 +33,14 @@ fileSystems."/boot" = { device = "/dev/disk/by-uuid/383D-1E8A"; fsType = "vfat"; - options = ["fmask=0077" "dmask=0077"]; + options = [ + "fmask=0077" + "dmask=0077" + ]; }; swapDevices = [ - {device = "/dev/disk/by-uuid/33c6277d-eb0a-487d-8be0-829829a8a308";} + { device = "/dev/disk/by-uuid/33c6277d-eb0a-487d-8be0-829829a8a308"; } ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking diff --git a/lib/default.nix b/lib/default.nix index 140252b..de0246b 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,7 +1,9 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ - importList = lib.mapAttrsToList (name: _path: ./. + "/${name}") - (lib.filterAttrs (filename: kind: - filename != "default.nix" && (kind == "regular" || kind == "directory")) - (builtins.readDir ./.)); + importList = lib.mapAttrsToList (name: _path: ./. + "/${name}") ( + lib.filterAttrs ( + filename: kind: filename != "default.nix" && (kind == "regular" || kind == "directory") + ) (builtins.readDir ./.) + ); } diff --git a/modules/adb.nix b/modules/adb.nix index 85e5b48..44b8cdb 100644 --- a/modules/adb.nix +++ b/modules/adb.nix @@ -2,7 +2,8 @@ lib, config, ... -}: { +}: +{ options = { myModules.enableADB = lib.mkOption { type = lib.types.bool; @@ -14,7 +15,7 @@ config = lib.mkMerge [ (lib.mkIf config.myModules.enableADB { programs.adb.enable = true; - users.users.osbm.extraGroups = ["adbusers"]; + users.users.osbm.extraGroups = [ "adbusers" ]; }) ]; } diff --git a/modules/arduino.nix b/modules/arduino.nix index c3d87c7..82f001e 100644 --- a/modules/arduino.nix +++ b/modules/arduino.nix @@ -3,7 +3,8 @@ lib, config, ... -}: { +}: +{ options = { myModules.arduinoSetup = lib.mkOption { type = lib.types.bool; diff --git a/modules/common-packages.nix b/modules/common-packages.nix index 52b7eb2..e71e4fd 100644 --- a/modules/common-packages.nix +++ b/modules/common-packages.nix @@ -2,7 +2,8 @@ pkgs, inputs, ... -}: { +}: +{ environment.systemPackages = with pkgs; [ inputs.osbm-nvim.packages."${pkgs.stdenv.hostPlatform.system}".default wget diff --git a/modules/concentration.nix b/modules/concentration.nix index b7486e9..1162f75 100644 --- a/modules/concentration.nix +++ b/modules/concentration.nix @@ -2,7 +2,8 @@ lib, config, ... -}: { +}: +{ options = { myModules = { blockYoutube = lib.mkOption { diff --git a/modules/disable-hibernation.nix b/modules/disable-hibernation.nix index 254d3a2..0b7f40b 100644 --- a/modules/disable-hibernation.nix +++ b/modules/disable-hibernation.nix @@ -2,7 +2,8 @@ lib, config, ... -}: { +}: +{ options = { myModules.disableHibernation = lib.mkOption { type = lib.types.bool; diff --git a/modules/emulation.nix b/modules/emulation.nix index 6daeef1..84ac972 100644 --- a/modules/emulation.nix +++ b/modules/emulation.nix @@ -2,7 +2,8 @@ lib, config, ... -}: { +}: +{ options = { myModules.enableAarch64Emulation = lib.mkOption { type = lib.types.bool; @@ -13,7 +14,7 @@ config = lib.mkMerge [ (lib.mkIf config.myModules.enableAarch64Emulation { - boot.binfmt.emulatedSystems = ["aarch64-linux"]; + boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; nix.settings.extra-platforms = config.boot.binfmt.emulatedSystems; }) ]; diff --git a/modules/fonts.nix b/modules/fonts.nix index 2097cea..a8a96f6 100644 --- a/modules/fonts.nix +++ b/modules/fonts.nix @@ -3,7 +3,8 @@ lib, config, ... -}: { +}: +{ options = { myModules.enableFonts = lib.mkOption { type = lib.types.bool; @@ -43,10 +44,23 @@ # defaultFonts.emoji = ["Noto Color Emoji"]; # }; fonts.fontconfig.defaultFonts = { - serif = ["Source Han Serif SC" "Source Han Serif TC" "Noto Color Emoji"]; - sansSerif = ["Source Han Sans SC" "Source Han Sans TC" "Noto Color Emoji"]; - monospace = ["Droid Sans Mono" "DejaVu Sans Mono" "Source Han Mono" "Cascadia Code"]; - emoji = ["Noto Color Emoji"]; + serif = [ + "Source Han Serif SC" + "Source Han Serif TC" + "Noto Color Emoji" + ]; + sansSerif = [ + "Source Han Sans SC" + "Source Han Sans TC" + "Noto Color Emoji" + ]; + monospace = [ + "Droid Sans Mono" + "DejaVu Sans Mono" + "Source Han Mono" + "Cascadia Code" + ]; + emoji = [ "Noto Color Emoji" ]; }; }) ]; diff --git a/modules/graphical-interface.nix b/modules/graphical-interface.nix index 0130d4b..62d37b5 100644 --- a/modules/graphical-interface.nix +++ b/modules/graphical-interface.nix @@ -3,7 +3,8 @@ lib, config, ... -}: { +}: +{ options = { myModules.enableKDE = lib.mkOption { type = lib.types.bool; @@ -93,7 +94,7 @@ # Open ports in the firewall for Steam Local Network Game Transfers localNetworkGameTransfers.openFirewall = true; }; - networking.firewall.allowedTCPPorts = [51513]; + networking.firewall.allowedTCPPorts = [ 51513 ]; }) ]; } diff --git a/modules/home.nix b/modules/home.nix index 7ae00eb..3450737 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -3,7 +3,8 @@ pkgs, inputs, ... -}: { +}: +{ imports = [ inputs.home-manager.nixosModules.home-manager ]; diff --git a/modules/i18n.nix b/modules/i18n.nix index 35a4707..6860e81 100644 --- a/modules/i18n.nix +++ b/modules/i18n.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ time.timeZone = "Europe/Istanbul"; # Select internationalisation properties. diff --git a/modules/minegrub.nix b/modules/minegrub.nix index 02090f1..ce1fe94 100644 --- a/modules/minegrub.nix +++ b/modules/minegrub.nix @@ -4,7 +4,8 @@ lib, pkgs, ... -}: { +}: +{ # imports = [ # inputs.minegrub-theme.nixosModules.default # ]; @@ -24,14 +25,12 @@ # background = "background_options/1.8 - [Classic Minecraft].png"; # boot-options-count = 4; # }; - theme = - pkgs.fetchFromGitHub - { - owner = "Lxtharia"; - repo = "minegrub-theme"; - rev = "193b3a7c3d432f8c6af10adfb465b781091f56b3"; - sha256 = "1bvkfmjzbk7pfisvmyw5gjmcqj9dab7gwd5nmvi8gs4vk72bl2ap"; - }; + theme = pkgs.fetchFromGitHub { + owner = "Lxtharia"; + repo = "minegrub-theme"; + rev = "193b3a7c3d432f8c6af10adfb465b781091f56b3"; + sha256 = "1bvkfmjzbk7pfisvmyw5gjmcqj9dab7gwd5nmvi8gs4vk72bl2ap"; + }; }; }) ]; diff --git a/modules/nix-settings.nix b/modules/nix-settings.nix index 1c4a54b..73abcb5 100644 --- a/modules/nix-settings.nix +++ b/modules/nix-settings.nix @@ -2,13 +2,15 @@ inputs, lib, ... -}: { +}: +{ imports = [ inputs.nix-index-database.nixosModules.nix-index ]; programs.nix-index-database.comma.enable = true; # Allow unfree packages - nixpkgs.config.allowUnfreePredicate = pkg: + nixpkgs.config.allowUnfreePredicate = + pkg: builtins.elem (lib.getName pkg) [ "vscode" # TODO: remove this "discord" @@ -30,7 +32,10 @@ ]; # enable nix flakes - nix.settings.experimental-features = ["nix-command" "flakes"]; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; # nix.nixPath = ["nixpkgs=${inputs.nixpkgs}"]; @@ -57,7 +62,10 @@ }; }; - nix.settings.trusted-users = ["root" "osbm"]; + nix.settings.trusted-users = [ + "root" + "osbm" + ]; nix.gc = { automatic = true; diff --git a/modules/remote-builds.nix b/modules/remote-builds.nix index 27a236b..e6b1f58 100644 --- a/modules/remote-builds.nix +++ b/modules/remote-builds.nix @@ -2,7 +2,8 @@ # config, # outputs, ... -}: { +}: +{ # nix.distributedBuilds = true; # nix.settings.builders-use-substitutes = true; # nix.buildMachines = [ diff --git a/modules/secrets.nix b/modules/secrets.nix index b71b622..91b0d08 100644 --- a/modules/secrets.nix +++ b/modules/secrets.nix @@ -4,7 +4,8 @@ inputs, lib, ... -}: { +}: +{ imports = [ inputs.agenix.nixosModules.default ]; diff --git a/modules/services/caddy.nix b/modules/services/caddy.nix index 685178b..ad65ca7 100644 --- a/modules/services/caddy.nix +++ b/modules/services/caddy.nix @@ -3,7 +3,8 @@ lib, config, ... -}: { +}: +{ options = { myModules.enableCaddy = lib.mkOption { type = lib.types.bool; @@ -19,7 +20,7 @@ package = pkgs.caddy.withPlugins { # update time to time # last update: 2025-03-02 - plugins = ["github.com/caddy-dns/cloudflare@v0.0.0-20250228175314-1fb64108d4de"]; + plugins = [ "github.com/caddy-dns/cloudflare@v0.0.0-20250228175314-1fb64108d4de" ]; hash = "sha256-YYpsf8HMONR1teMiSymo2y+HrKoxuJMKIea5/NEykGc="; }; email = "contact@osbm.dev"; @@ -58,7 +59,11 @@ }; }; - networking.firewall.allowedTCPPorts = [80 443 3000]; + networking.firewall.allowedTCPPorts = [ + 80 + 443 + 3000 + ]; environment.systemPackages = with pkgs; [ nssTools diff --git a/modules/services/cloudflare-dyndns.nix b/modules/services/cloudflare-dyndns.nix index b298692..a2c0f2e 100644 --- a/modules/services/cloudflare-dyndns.nix +++ b/modules/services/cloudflare-dyndns.nix @@ -3,10 +3,13 @@ config, pkgs, ... -}: let +}: +let # https://github.com/NixOS/nixpkgs/pull/394352 cloudflare-dyndns-5-3 = pkgs.cloudflare-dyndns.overridePythonAttrs rec { - version = lib.warnIfNot (pkgs.cloudflare-dyndns.version == "5.0") "The cloudflare-dyndns package is updated, you should remove this override" "5.3"; + version = lib.warnIfNot ( + pkgs.cloudflare-dyndns.version == "5.0" + ) "The cloudflare-dyndns package is updated, you should remove this override" "5.3"; src = pkgs.fetchFromGitHub { owner = "kissgyorgy"; repo = "cloudflare-dyndns"; @@ -23,7 +26,8 @@ truststore ]; }; -in { +in +{ options = { myModules.enableCloudflareDyndns = lib.mkOption { type = lib.types.bool; diff --git a/modules/services/cloudflared.nix b/modules/services/cloudflared.nix index 6c28333..2855e56 100644 --- a/modules/services/cloudflared.nix +++ b/modules/services/cloudflared.nix @@ -2,7 +2,8 @@ config, lib, ... -}: { +}: +{ options = { myModules.enableCloudflared = lib.mkOption { type = lib.types.bool; diff --git a/modules/services/forgejo.nix b/modules/services/forgejo.nix index dd51099..de92f35 100644 --- a/modules/services/forgejo.nix +++ b/modules/services/forgejo.nix @@ -2,7 +2,8 @@ lib, config, ... -}: { +}: +{ options = { myModules.enableForgejo = lib.mkOption { type = lib.types.bool; diff --git a/modules/services/jellyfin.nix b/modules/services/jellyfin.nix index 43f1fb8..153bf5d 100644 --- a/modules/services/jellyfin.nix +++ b/modules/services/jellyfin.nix @@ -2,7 +2,8 @@ config, lib, ... -}: { +}: +{ options = { myModules.enableJellyfin = lib.mkOption { type = lib.types.bool; @@ -21,7 +22,7 @@ dataDir = "/home/osbm/.local/share/jellyfin"; }; - networking.firewall.allowedTCPPorts = [8096]; + networking.firewall.allowedTCPPorts = [ 8096 ]; }) ]; } diff --git a/modules/services/nextcloud.nix b/modules/services/nextcloud.nix index f5bac7b..a2667f0 100644 --- a/modules/services/nextcloud.nix +++ b/modules/services/nextcloud.nix @@ -3,7 +3,8 @@ config, pkgs, ... -}: { +}: +{ options = { myModules.enableNextcloud = lib.mkOption { type = lib.types.bool; diff --git a/modules/services/ollama.nix b/modules/services/ollama.nix index cb5dab8..40b0192 100644 --- a/modules/services/ollama.nix +++ b/modules/services/ollama.nix @@ -2,7 +2,8 @@ lib, config, ... -}: { +}: +{ options = { myModules = { enableOllama = lib.mkOption { @@ -18,7 +19,10 @@ services.ollama = { enable = true; acceleration = "cuda"; - loadModels = ["deepseek-r1:7b" "deepseek-r1:14b"]; + loadModels = [ + "deepseek-r1:7b" + "deepseek-r1:14b" + ]; }; services.open-webui = { diff --git a/modules/services/system-logger/default.nix b/modules/services/system-logger/default.nix index 67da14d..a6f72d3 100644 --- a/modules/services/system-logger/default.nix +++ b/modules/services/system-logger/default.nix @@ -3,13 +3,21 @@ config, lib, ... -}: let +}: +let system-logger = pkgs.writeShellApplication { name = "system-logger"; - runtimeInputs = with pkgs; [curl jq zip gawk systemd]; + runtimeInputs = with pkgs; [ + curl + jq + zip + gawk + systemd + ]; text = builtins.readFile ./system-logger.sh; }; -in { +in +{ options.services.system-logger = { enable = lib.mkEnableOption { description = "Enable System Logger Service"; @@ -38,7 +46,7 @@ in { config = lib.mkIf config.services.system-logger.enable { systemd.timers.system-logger = { description = "System Logger Timer"; - wantedBy = ["timers.target"]; + wantedBy = [ "timers.target" ]; timerConfig = { OnCalendar = "daily"; Persistent = true; diff --git a/modules/services/tailscale.nix b/modules/services/tailscale.nix index ace140f..c111a87 100644 --- a/modules/services/tailscale.nix +++ b/modules/services/tailscale.nix @@ -3,7 +3,8 @@ lib, pkgs, ... -}: { +}: +{ options = { myModules.enableTailscale = lib.mkOption { type = lib.types.bool; @@ -25,8 +26,8 @@ port = 51513; }; - networking.firewall.allowedUDPPorts = [config.services.tailscale.port]; - environment.systemPackages = [pkgs.tailscale]; + networking.firewall.allowedUDPPorts = [ config.services.tailscale.port ]; + environment.systemPackages = [ pkgs.tailscale ]; }) ]; } diff --git a/modules/services/vaultwarden.nix b/modules/services/vaultwarden.nix index 1e8bd3c..d3db64e 100644 --- a/modules/services/vaultwarden.nix +++ b/modules/services/vaultwarden.nix @@ -2,7 +2,8 @@ config, lib, ... -}: { +}: +{ options = { myModules.enableVaultwarden = lib.mkOption { type = lib.types.bool; diff --git a/modules/services/vscode-server.nix b/modules/services/vscode-server.nix index f8756ac..279343c 100644 --- a/modules/services/vscode-server.nix +++ b/modules/services/vscode-server.nix @@ -2,7 +2,8 @@ config, pkgs, ... -}: { +}: +{ services.code-server = { # only true if the machine is not pochita enable = config.networking.hostName != "pochita"; @@ -16,7 +17,8 @@ hashedPassword = "$argon2i$v=19$m=4096,t=3,p=1$dGc0TStGMDNzSS9JRkJYUFp3d091Q2p0bXlzPQ$zvdE9BkclkJmyFaenzPy2E99SEqsyDMt4IQNZfcfFFQ"; package = pkgs.vscode-with-extensions.override { vscode = pkgs.code-server; - vscodeExtensions = with pkgs.vscode-extensions; + vscodeExtensions = + with pkgs.vscode-extensions; [ bbenoist.nix catppuccin.catppuccin-vsc @@ -47,5 +49,5 @@ ]; }; }; - networking.firewall.allowedTCPPorts = [config.services.code-server.port]; + networking.firewall.allowedTCPPorts = [ config.services.code-server.port ]; } diff --git a/modules/services/wanikani-bypass-lessons.nix b/modules/services/wanikani-bypass-lessons.nix index 19aaeac..43b48b4 100644 --- a/modules/services/wanikani-bypass-lessons.nix +++ b/modules/services/wanikani-bypass-lessons.nix @@ -3,10 +3,14 @@ config, pkgs, ... -}: let +}: +let waniKani-bypass-lessons = pkgs.writeShellApplication { name = "wanikani-bypass-lessons"; - runtimeInputs = with pkgs; [curl jq]; + runtimeInputs = with pkgs; [ + curl + jq + ]; text = '' #!/usr/bin/env bash @@ -44,7 +48,8 @@ sleep 3600 ''; }; -in { +in +{ options.services.wanikani-bypass-lessons.enable = lib.mkEnableOption { description = "Enable WaniKani Bypass Lessons"; default = false; @@ -53,7 +58,7 @@ in { config = lib.mkIf config.services.wanikani-bypass-lessons.enable { systemd.services.wanikani-bypass-lessons = { description = "WaniKani Bypass Lessons"; - wantedBy = ["multi-user.target"]; + wantedBy = [ "multi-user.target" ]; serviceConfig = { Type = "simple"; ExecStart = "${lib.getExe waniKani-bypass-lessons}"; diff --git a/modules/services/wanikani-fetch-data/default.nix b/modules/services/wanikani-fetch-data/default.nix index 4193052..0cf09ae 100644 --- a/modules/services/wanikani-fetch-data/default.nix +++ b/modules/services/wanikani-fetch-data/default.nix @@ -3,13 +3,19 @@ config, lib, ... -}: let +}: +let wanikani-fetcher = pkgs.writeShellApplication { name = "wanikani-fetcher"; - runtimeInputs = with pkgs; [curl jq zip]; + runtimeInputs = with pkgs; [ + curl + jq + zip + ]; text = builtins.readFile ./wanikani-fetcher.sh; }; -in { +in +{ options.services.wanikani-fetch-data.enable = lib.mkEnableOption { description = "Enable WaniKani Fetch Data"; default = false; @@ -18,7 +24,7 @@ in { config = lib.mkIf config.services.wanikani-fetch-data.enable { systemd.timers.wanikani-fetch-data = { description = "WaniKani Fetch Data"; - wantedBy = ["timers.target"]; + wantedBy = [ "timers.target" ]; timerConfig = { OnCalendar = "02:00"; }; diff --git a/modules/sound.nix b/modules/sound.nix index 7b5f550..deb119d 100644 --- a/modules/sound.nix +++ b/modules/sound.nix @@ -2,7 +2,8 @@ lib, config, ... -}: { +}: +{ options = { myModules.enableSound = lib.mkOption { type = lib.types.bool; diff --git a/modules/users.nix b/modules/users.nix index 95a0a2e..3056e19 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -1,10 +1,15 @@ -{...}: { +{ ... }: +{ users.users = { osbm = { isNormalUser = true; description = "osbm"; initialHashedPassword = "$6$IamAbigfailure$irfkAsWev8CMAr78wUwUggclplXL98sbI21fpGY9nMDz47bU88RZWFLO7FcN5SdRA18ZSidkMqS76uLCMH68f."; - extraGroups = ["networkmanager" "wheel" "docker"]; + extraGroups = [ + "networkmanager" + "wheel" + "docker" + ]; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPfnV+qqUCJf92npNW4Jy0hIiepCJFBDJHXBHnUlNX0k" ]; @@ -15,7 +20,7 @@ isNormalUser = true; description = "bayram"; initialHashedPassword = "$6$IamAbigfailure$3BP231DVwbqUtZ.mq33nM/JitBrT2u26Y25VpsfBwhZbezMHz4XbySrOMnaMcCYdsb3wZFL3Ppcp0L.R8nonT."; - extraGroups = ["networkmanager"]; + extraGroups = [ "networkmanager" ]; packages = [ ]; }; diff --git a/modules/wake-on-lan.nix b/modules/wake-on-lan.nix index fa1b0d5..4a0f955 100644 --- a/modules/wake-on-lan.nix +++ b/modules/wake-on-lan.nix @@ -3,7 +3,8 @@ lib, config, ... -}: { +}: +{ options = { myModules.enableWakeOnLan = lib.mkOption { type = lib.types.bool; @@ -19,13 +20,13 @@ # see https://github.com/NixOS/nixpkgs/issues/91352 systemd.services.wakeonlan = { description = "Reenable wake on lan every boot"; - after = ["network.target"]; + after = [ "network.target" ]; serviceConfig = { Type = "simple"; RemainAfterExit = "true"; ExecStart = "${pkgs.ethtool}/sbin/ethtool -s enp3s0 wol g"; }; - wantedBy = ["default.target"]; + wantedBy = [ "default.target" ]; }; }) ]; diff --git a/secrets/secrets.nix b/secrets/secrets.nix index aff5aee..8c79bf6 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -12,9 +12,10 @@ let pochita wallfacer ]; -in { - "network-manager.age".publicKeys = machines ++ [osbm]; - "ssh-key-private.age".publicKeys = machines ++ [osbm]; - "ssh-key-public.age".publicKeys = machines ++ [osbm]; - "cloudflare.age".publicKeys = machines ++ [osbm]; +in +{ + "network-manager.age".publicKeys = machines ++ [ osbm ]; + "ssh-key-private.age".publicKeys = machines ++ [ osbm ]; + "ssh-key-public.age".publicKeys = machines ++ [ osbm ]; + "cloudflare.age".publicKeys = machines ++ [ osbm ]; }