From 74a009da4b6974c021246264cad65166fa0ec8a3 Mon Sep 17 00:00:00 2001 From: rogueking Date: Mon, 1 Jun 2026 23:39:02 -0400 Subject: [PATCH] lint fixes and direnv --- .envrc | 1 + .gitea/workflows/iso-builder.yml | 27 +++- .gitignore | 11 ++ flake.nix | 178 ++++++++++++---------- home-manager/commands/newsboat.nix | 6 +- hosts/acheron/disko-config.nix | 2 +- hosts/acheron/hardware-configuration.nix | 10 +- hosts/acheron/iso.nix | 2 +- hosts/armaros/disko-config.nix | 2 +- hosts/armaros/hardware-configuration.nix | 10 +- hosts/armaros/iso.nix | 2 +- hosts/buildbox/disko-config.nix | 2 +- hosts/buildbox/hardware-configuration.nix | 10 +- hosts/buildbox/iso.nix | 2 +- hosts/ender-ml/disko-config.nix | 2 +- hosts/ender-ml/iso.nix | 2 +- hosts/eva-01/configuration.nix | 4 +- hosts/eva-01/disko-config.nix | 2 +- hosts/eva-01/hardware-configuration.nix | 10 +- 19 files changed, 174 insertions(+), 111 deletions(-) create mode 100644 .envrc create mode 100644 .gitignore diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitea/workflows/iso-builder.yml b/.gitea/workflows/iso-builder.yml index 3c4068b..f6c590b 100644 --- a/.gitea/workflows/iso-builder.yml +++ b/.gitea/workflows/iso-builder.yml @@ -55,9 +55,34 @@ jobs: echo "SHA256:" sha256sum iso-result/iso/*.iso + - name: Prepare ${{ matrix.host }} ISO artifact (split if needed) + run: | + set -euo pipefail + mkdir -p iso-result/artifact + ISO_SRC=$(ls iso-result/iso/*.iso) + ISO_BASENAME="${{ matrix.host }}-installer.iso" + ISO_DEST="iso-result/artifact/${ISO_BASENAME}" + mv "$ISO_SRC" "$ISO_DEST" + + SIZE=$(stat -c%s "$ISO_DEST") + if [ "$SIZE" -gt 240000000 ]; then + echo "ISO is $SIZE bytes; splitting into 200MB parts for artifact upload." + split -b 200M -d -a 3 "$ISO_DEST" "${ISO_DEST}.part-" + sha256sum "$ISO_DEST" > "${ISO_DEST}.sha256" + rm "$ISO_DEST" + cat > "iso-result/artifact/README.txt" < ${ISO_BASENAME} +Verify: + sha256sum -c ${ISO_BASENAME}.sha256 +EOF + else + sha256sum "$ISO_DEST" > "${ISO_DEST}.sha256" + fi + - name: Upload ${{ matrix.host }} ISO artifact if: ${{ github.event_name != 'workflow_dispatch' || inputs.upload-artifact }} uses: actions/upload-artifact@v3 with: name: ${{ matrix.host }}-installer-iso - path: iso-result/iso/*.iso + path: iso-result/artifact/** diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0b80812 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +.direnv +node_modules + +bun.lock +package.json + +.codegraph +.mcp.json +opencode.jsonc +.agents +skills-lock.json diff --git a/flake.nix b/flake.nix index 68cf283..1c067fe 100644 --- a/flake.nix +++ b/flake.nix @@ -97,96 +97,102 @@ inputs.disko.nixosModules.disko ]; }; + + # ── DevShell Helpers ───────────────────────────────────────── + supportedSystems = ["x86_64-linux" "aarch64-darwin"]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; in { - nixosConfigurations = { - acheron = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs pkgs-unstable configPath hostTypes; - hostname = "acheron"; + nixosConfigurations = + { + acheron = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs pkgs-unstable configPath hostTypes; + hostname = "acheron"; + }; + system = system; + modules = [ + ./hosts/acheron/configuration.nix + inputs.home-manager.nixosModules.default + inputs.disko.nixosModules.disko + ]; }; - system = system; - modules = [ - ./hosts/acheron/configuration.nix - inputs.home-manager.nixosModules.default - inputs.disko.nixosModules.disko - ]; - }; - armaros = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs pkgs-unstable configPath hostTypes; - hostname = "armaros"; + armaros = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs pkgs-unstable configPath hostTypes; + hostname = "armaros"; + }; + system = system; + modules = [ + ./hosts/armaros/configuration.nix + inputs.home-manager.nixosModules.default + inputs.disko.nixosModules.disko + ]; }; - system = system; - modules = [ - ./hosts/armaros/configuration.nix - inputs.home-manager.nixosModules.default - inputs.disko.nixosModules.disko - ]; - }; - buildbox = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs pkgs-unstable configPath hostTypes; - hostname = "buildbox"; + buildbox = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs pkgs-unstable configPath hostTypes; + hostname = "buildbox"; + }; + system = system; + modules = [ + ./hosts/buildbox/configuration.nix + inputs.home-manager.nixosModules.default + inputs.disko.nixosModules.disko + ]; }; - system = system; - modules = [ - ./hosts/buildbox/configuration.nix - inputs.home-manager.nixosModules.default - inputs.disko.nixosModules.disko - ]; - }; - ender-ml = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs pkgs-unstable configPath hostTypes; - hostname = "ender-ml"; + ender-ml = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs pkgs-unstable configPath hostTypes; + hostname = "ender-ml"; + }; + system = system; + modules = [ + ./hosts/ender-ml/configuration.nix + inputs.home-manager.nixosModules.default + comfyui-nix.nixosModules.default + inputs.disko.nixosModules.disko + ]; }; - system = system; - modules = [ - ./hosts/ender-ml/configuration.nix - inputs.home-manager.nixosModules.default - comfyui-nix.nixosModules.default - inputs.disko.nixosModules.disko - ]; - }; - eva-01 = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs pkgs-unstable configPath hostTypes; - hostname = "eva-01"; + eva-01 = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs pkgs-unstable configPath hostTypes; + hostname = "eva-01"; + }; + system = system; + modules = [ + ./hosts/eva-01/configuration.nix + inputs.home-manager.nixosModules.default + nixos-hardware.nixosModules.lenovo-thinkpad-x1-nano-gen1 + nix-snapd.nixosModules.default + {services.snap.enable = true;} + inputs.disko.nixosModules.disko + ]; }; - system = system; - modules = [ - ./hosts/eva-01/configuration.nix - inputs.home-manager.nixosModules.default - nixos-hardware.nixosModules.lenovo-thinkpad-x1-nano-gen1 - nix-snapd.nixosModules.default - {services.snap.enable = true;} - inputs.disko.nixosModules.disko - ]; - }; - eva-03 = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs pkgs-unstable configPath hostTypes; - hostname = "eva-03"; + eva-03 = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs pkgs-unstable configPath hostTypes; + hostname = "eva-03"; + }; + system = system; + modules = [ + ./hosts/eva-03/configuration.nix + inputs.home-manager.nixosModules.default + comfyui-nix.nixosModules.default + inputs.disko.nixosModules.disko + ]; }; - system = system; - modules = [ - ./hosts/eva-03/configuration.nix - inputs.home-manager.nixosModules.default - comfyui-nix.nixosModules.default - inputs.disko.nixosModules.disko - ]; - }; - } - # ── Rescue / installer ISOs (generated) ────────────────────── - // builtins.listToAttrs (map (name: { - name = "${name}-iso"; - value = nixpkgs.lib.nixosSystem (mkIso name); - }) isoHosts); + } + # ── Rescue / installer ISOs (generated) ────────────────────── + // builtins.listToAttrs (map (name: { + name = "${name}-iso"; + value = nixpkgs.lib.nixosSystem (mkIso name); + }) + isoHosts); darwinConfigurations = { eva-02 = nix-darwin.lib.darwinSystem { @@ -206,5 +212,21 @@ ]; }; }; + + # ── Dev Shells (for direnv) ────────────────────────────────── + devShells = forAllSystems (sys: let + pkgs = nixpkgs.legacyPackages.${sys}; + in { + # Notice the 'default =' here! + default = pkgs.mkShell { + buildInputs = with pkgs; [ + nixd + alejandra + git + nil + bun + ]; + }; + }); }; } diff --git a/home-manager/commands/newsboat.nix b/home-manager/commands/newsboat.nix index fffcd41..c589473 100644 --- a/home-manager/commands/newsboat.nix +++ b/home-manager/commands/newsboat.nix @@ -1,4 +1,8 @@ -{pkgs, lib, ...}: +{ + pkgs, + lib, + ... +}: lib.mkIf (!pkgs.stdenv.isDarwin) { programs.newsboat = { enable = true; diff --git a/hosts/acheron/disko-config.nix b/hosts/acheron/disko-config.nix index 57252f9..1eb6059 100644 --- a/hosts/acheron/disko-config.nix +++ b/hosts/acheron/disko-config.nix @@ -17,7 +17,7 @@ size = "100%"; content = { type = "btrfs"; - extraArgs = [ "-f" ]; + extraArgs = ["-f"]; subvolumes = { "/root" = { mountpoint = "/"; diff --git a/hosts/acheron/hardware-configuration.nix b/hosts/acheron/hardware-configuration.nix index e27e852..c57e152 100644 --- a/hosts/acheron/hardware-configuration.nix +++ b/hosts/acheron/hardware-configuration.nix @@ -20,32 +20,32 @@ fileSystems."/" = { device = "/dev/disk/by-partuuid/REPLACE-ME"; fsType = "btrfs"; - options = [ "subvol=root" "compress=zstd" "noatime" ]; + options = ["subvol=root" "compress=zstd" "noatime"]; }; fileSystems."/home" = { device = "/dev/disk/by-partuuid/REPLACE-ME"; fsType = "btrfs"; - options = [ "subvol=home" "compress=zstd" "noatime" ]; + options = ["subvol=home" "compress=zstd" "noatime"]; }; fileSystems."/nix" = { device = "/dev/disk/by-partuuid/REPLACE-ME"; fsType = "btrfs"; - options = [ "subvol=nix" "compress=zstd" "noatime" ]; + options = ["subvol=nix" "compress=zstd" "noatime"]; }; fileSystems."/var/log" = { device = "/dev/disk/by-partuuid/REPLACE-ME"; fsType = "btrfs"; - options = [ "subvol=var-log" "compress=zstd" "noatime" ]; + options = ["subvol=var-log" "compress=zstd" "noatime"]; neededForBoot = false; }; fileSystems."/.snapshots" = { device = "/dev/disk/by-partuuid/REPLACE-ME"; fsType = "btrfs"; - options = [ "subvol=snapshots" "compress=zstd" "noatime" ]; + options = ["subvol=snapshots" "compress=zstd" "noatime"]; neededForBoot = false; }; diff --git a/hosts/acheron/iso.nix b/hosts/acheron/iso.nix index def4f90..12d9392 100644 --- a/hosts/acheron/iso.nix +++ b/hosts/acheron/iso.nix @@ -13,7 +13,7 @@ boot.loader.grub.enable = lib.mkDefault true; boot.loader.grub.devices = ["nodev"]; - iso.extraPackages = with pkgs; [ btrfs-progs ]; + iso.extraPackages = with pkgs; [btrfs-progs]; iso.diskoConfig = ./disko-config.nix; iso.description = "acheron Rescue ISO"; } diff --git a/hosts/armaros/disko-config.nix b/hosts/armaros/disko-config.nix index 18ca81a..97b338c 100644 --- a/hosts/armaros/disko-config.nix +++ b/hosts/armaros/disko-config.nix @@ -17,7 +17,7 @@ size = "100%"; content = { type = "btrfs"; - extraArgs = [ "-f" ]; + extraArgs = ["-f"]; subvolumes = { "/root" = { mountpoint = "/"; diff --git a/hosts/armaros/hardware-configuration.nix b/hosts/armaros/hardware-configuration.nix index f2653c9..14772ad 100644 --- a/hosts/armaros/hardware-configuration.nix +++ b/hosts/armaros/hardware-configuration.nix @@ -20,32 +20,32 @@ fileSystems."/" = { device = "/dev/disk/by-partuuid/REPLACE-ME"; fsType = "btrfs"; - options = [ "subvol=root" "compress=zstd" "noatime" ]; + options = ["subvol=root" "compress=zstd" "noatime"]; }; fileSystems."/home" = { device = "/dev/disk/by-partuuid/REPLACE-ME"; fsType = "btrfs"; - options = [ "subvol=home" "compress=zstd" "noatime" ]; + options = ["subvol=home" "compress=zstd" "noatime"]; }; fileSystems."/nix" = { device = "/dev/disk/by-partuuid/REPLACE-ME"; fsType = "btrfs"; - options = [ "subvol=nix" "compress=zstd" "noatime" ]; + options = ["subvol=nix" "compress=zstd" "noatime"]; }; fileSystems."/var/log" = { device = "/dev/disk/by-partuuid/REPLACE-ME"; fsType = "btrfs"; - options = [ "subvol=var-log" "compress=zstd" "noatime" ]; + options = ["subvol=var-log" "compress=zstd" "noatime"]; neededForBoot = false; }; fileSystems."/.snapshots" = { device = "/dev/disk/by-partuuid/REPLACE-ME"; fsType = "btrfs"; - options = [ "subvol=snapshots" "compress=zstd" "noatime" ]; + options = ["subvol=snapshots" "compress=zstd" "noatime"]; neededForBoot = false; }; diff --git a/hosts/armaros/iso.nix b/hosts/armaros/iso.nix index d3cca64..90a3d1b 100644 --- a/hosts/armaros/iso.nix +++ b/hosts/armaros/iso.nix @@ -13,7 +13,7 @@ boot.loader.grub.enable = lib.mkDefault true; boot.loader.grub.devices = ["nodev"]; - iso.extraPackages = with pkgs; [ btrfs-progs ]; + iso.extraPackages = with pkgs; [btrfs-progs]; iso.diskoConfig = ./disko-config.nix; iso.description = "armaros Rescue ISO"; } diff --git a/hosts/buildbox/disko-config.nix b/hosts/buildbox/disko-config.nix index 8cc8122..9efaac5 100644 --- a/hosts/buildbox/disko-config.nix +++ b/hosts/buildbox/disko-config.nix @@ -17,7 +17,7 @@ size = "100%"; content = { type = "btrfs"; - extraArgs = [ "-f" ]; + extraArgs = ["-f"]; subvolumes = { "/root" = { mountpoint = "/"; diff --git a/hosts/buildbox/hardware-configuration.nix b/hosts/buildbox/hardware-configuration.nix index 65bc07f..c8fa53f 100644 --- a/hosts/buildbox/hardware-configuration.nix +++ b/hosts/buildbox/hardware-configuration.nix @@ -20,32 +20,32 @@ fileSystems."/" = { device = "/dev/disk/by-partuuid/REPLACE-ME"; fsType = "btrfs"; - options = [ "subvol=root" "compress=zstd" "noatime" ]; + options = ["subvol=root" "compress=zstd" "noatime"]; }; fileSystems."/home" = { device = "/dev/disk/by-partuuid/REPLACE-ME"; fsType = "btrfs"; - options = [ "subvol=home" "compress=zstd" "noatime" ]; + options = ["subvol=home" "compress=zstd" "noatime"]; }; fileSystems."/nix" = { device = "/dev/disk/by-partuuid/REPLACE-ME"; fsType = "btrfs"; - options = [ "subvol=nix" "compress=zstd" "noatime" ]; + options = ["subvol=nix" "compress=zstd" "noatime"]; }; fileSystems."/var/log" = { device = "/dev/disk/by-partuuid/REPLACE-ME"; fsType = "btrfs"; - options = [ "subvol=var-log" "compress=zstd" "noatime" ]; + options = ["subvol=var-log" "compress=zstd" "noatime"]; neededForBoot = false; }; fileSystems."/.snapshots" = { device = "/dev/disk/by-partuuid/REPLACE-ME"; fsType = "btrfs"; - options = [ "subvol=snapshots" "compress=zstd" "noatime" ]; + options = ["subvol=snapshots" "compress=zstd" "noatime"]; neededForBoot = false; }; diff --git a/hosts/buildbox/iso.nix b/hosts/buildbox/iso.nix index b183444..047cd1b 100644 --- a/hosts/buildbox/iso.nix +++ b/hosts/buildbox/iso.nix @@ -13,7 +13,7 @@ boot.loader.grub.enable = lib.mkDefault true; boot.loader.grub.devices = ["nodev"]; - iso.extraPackages = with pkgs; [ btrfs-progs ]; + iso.extraPackages = with pkgs; [btrfs-progs]; iso.diskoConfig = ./disko-config.nix; iso.description = "buildbox Rescue ISO"; } diff --git a/hosts/ender-ml/disko-config.nix b/hosts/ender-ml/disko-config.nix index 8cc8122..9efaac5 100644 --- a/hosts/ender-ml/disko-config.nix +++ b/hosts/ender-ml/disko-config.nix @@ -17,7 +17,7 @@ size = "100%"; content = { type = "btrfs"; - extraArgs = [ "-f" ]; + extraArgs = ["-f"]; subvolumes = { "/root" = { mountpoint = "/"; diff --git a/hosts/ender-ml/iso.nix b/hosts/ender-ml/iso.nix index b183444..047cd1b 100644 --- a/hosts/ender-ml/iso.nix +++ b/hosts/ender-ml/iso.nix @@ -13,7 +13,7 @@ boot.loader.grub.enable = lib.mkDefault true; boot.loader.grub.devices = ["nodev"]; - iso.extraPackages = with pkgs; [ btrfs-progs ]; + iso.extraPackages = with pkgs; [btrfs-progs]; iso.diskoConfig = ./disko-config.nix; iso.description = "buildbox Rescue ISO"; } diff --git a/hosts/eva-01/configuration.nix b/hosts/eva-01/configuration.nix index a9c96c1..68ff46b 100644 --- a/hosts/eva-01/configuration.nix +++ b/hosts/eva-01/configuration.nix @@ -105,8 +105,8 @@ }; boot.kernel.sysctl = { - # 11th Gen Intel Tiger Lake performance fix - "dev.i915.perf_stream_paranoid" = 0; + # 11th Gen Intel Tiger Lake performance fix + "dev.i915.perf_stream_paranoid" = 0; }; networking.hostName = "eva-01"; # Define your hostname. diff --git a/hosts/eva-01/disko-config.nix b/hosts/eva-01/disko-config.nix index 286f0af..0e3529a 100644 --- a/hosts/eva-01/disko-config.nix +++ b/hosts/eva-01/disko-config.nix @@ -30,7 +30,7 @@ size = "100%"; content = { type = "btrfs"; - extraArgs = [ "-f" ]; + extraArgs = ["-f"]; subvolumes = { "/root" = { mountpoint = "/"; diff --git a/hosts/eva-01/hardware-configuration.nix b/hosts/eva-01/hardware-configuration.nix index 7f51a1f..b7bb8f4 100644 --- a/hosts/eva-01/hardware-configuration.nix +++ b/hosts/eva-01/hardware-configuration.nix @@ -33,32 +33,32 @@ fileSystems."/" = { device = "/dev/disk/by-uuid/0ec1b4fd-ca0f-4938-a038-37a69ec00b21"; fsType = "btrfs"; - options = [ "subvol=root" "compress=zstd" "discard=async" "noatime" ]; + options = ["subvol=root" "compress=zstd" "discard=async" "noatime"]; }; fileSystems."/home" = { device = "/dev/disk/by-uuid/0ec1b4fd-ca0f-4938-a038-37a69ec00b21"; fsType = "btrfs"; - options = [ "subvol=home" "compress=zstd" "discard=async" "noatime" ]; + options = ["subvol=home" "compress=zstd" "discard=async" "noatime"]; }; fileSystems."/nix" = { device = "/dev/disk/by-uuid/0ec1b4fd-ca0f-4938-a038-37a69ec00b21"; fsType = "btrfs"; - options = [ "subvol=nix" "compress=zstd" "discard=async" "noatime" ]; + options = ["subvol=nix" "compress=zstd" "discard=async" "noatime"]; }; fileSystems."/var/log" = { device = "/dev/disk/by-uuid/0ec1b4fd-ca0f-4938-a038-37a69ec00b21"; fsType = "btrfs"; - options = [ "subvol=var-log" "compress=zstd" "discard=async" "noatime" ]; + options = ["subvol=var-log" "compress=zstd" "discard=async" "noatime"]; neededForBoot = false; }; fileSystems."/.snapshots" = { device = "/dev/disk/by-uuid/0ec1b4fd-ca0f-4938-a038-37a69ec00b21"; fsType = "btrfs"; - options = [ "subvol=snapshots" "compress=zstd" "discard=async" "noatime" ]; + options = ["subvol=snapshots" "compress=zstd" "discard=async" "noatime"]; neededForBoot = false; };