From 0ce0d549ba2e563c654de52a17ac21a2d9ff4b64 Mon Sep 17 00:00:00 2001 From: smayzy Date: Sun, 24 Aug 2025 22:27:49 +0200 Subject: [PATCH] format --- flake.nix | 12 +++++-- hosts/desktop1/configuration.nix | 9 +++-- hosts/server1/hardware-configuration.nix | 45 ++++++++++++++++-------- modules/nix/base-cli/pkgs.nix | 1 + modules/nix/flatpak/flatpak.nix | 3 +- modules/nix/isolation/firejail.nix | 7 +++- modules/nix/networking/wireshark.nix | 7 +++- secrets/secrets.nix | 20 +++++++---- 8 files changed, 76 insertions(+), 28 deletions(-) diff --git a/flake.nix b/flake.nix index 38b9fc9..c7a5e9b 100644 --- a/flake.nix +++ b/flake.nix @@ -38,9 +38,17 @@ inputs.agenix.nixosModules.default ]; - mkHost = hostConfig: + mkHost = + hostConfig: nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs system overlays agenix; }; + specialArgs = { + inherit + inputs + system + overlays + agenix + ; + }; modules = [ hostConfig ] ++ sharedModules; }; in diff --git a/hosts/desktop1/configuration.nix b/hosts/desktop1/configuration.nix index 2e26ee7..bdea3a7 100644 --- a/hosts/desktop1/configuration.nix +++ b/hosts/desktop1/configuration.nix @@ -9,7 +9,12 @@ networking.hostName = "desktop1"; networking.bridges.br0.interfaces = [ ]; - networking.interfaces.br0.ipv4.addresses = [ { address = "10.0.0.1"; prefixLength = 24; } ]; + networking.interfaces.br0.ipv4.addresses = [ + { + address = "10.0.0.1"; + prefixLength = 24; + } + ]; smayzy = { desktop.enable = true; @@ -29,7 +34,7 @@ }; backupFileExtension = "backup"; }; - + programs.adb.enable = true; system.stateVersion = "24.11"; diff --git a/hosts/server1/hardware-configuration.nix b/hosts/server1/hardware-configuration.nix index 9c420a1..7a61bdf 100644 --- a/hosts/server1/hardware-configuration.nix +++ b/hosts/server1/hardware-configuration.nix @@ -1,28 +1,45 @@ # 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, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/profiles/qemu-guest.nix") - ]; + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; - boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; + boot.initrd.availableKernelModules = [ + "uhci_hcd" + "ehci_pci" + "ahci" + "virtio_pci" + "virtio_scsi" + "sd_mod" + "sr_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/72df93fc-6794-42d1-b611-8660b32a9cfa"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/72df93fc-6794-42d1-b611-8660b32a9cfa"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/F5B8-A39C"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/F5B8-A39C"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; swapDevices = [ ]; diff --git a/modules/nix/base-cli/pkgs.nix b/modules/nix/base-cli/pkgs.nix index 322c878..c19df2e 100644 --- a/modules/nix/base-cli/pkgs.nix +++ b/modules/nix/base-cli/pkgs.nix @@ -31,6 +31,7 @@ in usbutils git unzip + treefmt agenix.packages.${system}.default ]; }; diff --git a/modules/nix/flatpak/flatpak.nix b/modules/nix/flatpak/flatpak.nix index fa2a2f5..0dc905e 100644 --- a/modules/nix/flatpak/flatpak.nix +++ b/modules/nix/flatpak/flatpak.nix @@ -37,7 +37,7 @@ in }; }; }; - default = {}; + default = { }; }; config = mkIf config.smayzy.flatpak.enable ( @@ -75,4 +75,3 @@ in } ); } - diff --git a/modules/nix/isolation/firejail.nix b/modules/nix/isolation/firejail.nix index 4fa5827..a9e6a1f 100644 --- a/modules/nix/isolation/firejail.nix +++ b/modules/nix/isolation/firejail.nix @@ -1,4 +1,9 @@ -{ lib, pkgs, config, ... }: +{ + lib, + pkgs, + config, + ... +}: let inherit (lib) mkIf mkOption types; in diff --git a/modules/nix/networking/wireshark.nix b/modules/nix/networking/wireshark.nix index 7a0ba99..e7595d2 100644 --- a/modules/nix/networking/wireshark.nix +++ b/modules/nix/networking/wireshark.nix @@ -1,4 +1,9 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: let inherit (lib) mkIf mkOption types; in diff --git a/secrets/secrets.nix b/secrets/secrets.nix index a74ff65..07fed04 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -4,7 +4,11 @@ let smayzy_desktop1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKebxL3JGy2UgPX4NjDvHjRz1ri6yyReAOURET+ULKz5"; smayzy_laptop1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB1AK9eYCMHAz1HE0/UmFeAmFNn6EJsVwiKsvzeHipuI"; smayzy_server1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0rBzdu8mwX26ZH7+bxHQsYqLZ/uCcBRP05OJlhzfZF"; - users = [ smayzy_desktop1 smayzy_laptop1 smayzy_server1 ]; + users = [ + smayzy_desktop1 + smayzy_laptop1 + smayzy_server1 + ]; desktop1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM627oXXyR+0SlVNcRhyw2/8c3X4y+cl3XSU/BUumxzi"; laptop1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ6tnupPyqe4Ihc3D4S8ZSPCX4k1M/AEQ0gmy61O4CTb"; @@ -14,11 +18,15 @@ let servers = [ server1 ]; systems = desktops ++ laptops ++ servers; - mkKey = key:{ - publicKeys = - if builtins.isList key - then key ++ [ nix-config-dev ] - else [ key nix-config-dev ]; + mkKey = key: { + publicKeys = + if builtins.isList key then + key ++ [ nix-config-dev ] + else + [ + key + nix-config-dev + ]; armor = true; }; in