summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-07-27 04:40:47 +0700
committerpolwex <polwex@sortug.com>2025-07-27 04:40:47 +0700
commita61c5db40ee85f98e6f40417c73ef10ca566aa19 (patch)
treefb40f83a53901077a91ce93552b6d37aaa44392c
parent05cdc5aa6b41fa4cefa2e7a13520c8a618f8536c (diff)
parent9dc29832c4fc17cd93f6eca6c0556277690a0061 (diff)
-rw-r--r--derivations/codex/flake.lock27
-rw-r--r--derivations/codex/flake.nix10
-rw-r--r--derivations/codex/node.nix59
-rw-r--r--derivations/codex/rust.nix (renamed from derivations/codex/default.nix)2
-rw-r--r--derivations/gemini/default.nix7
-rw-r--r--derivations/gemini/flake.lock27
-rw-r--r--derivations/gemini/flake.nix1
-rw-r--r--flake.nix4
-rw-r--r--hosts/cloud/sortug/mail.nix2
-rw-r--r--hosts/editors.nix5
-rw-r--r--hosts/local/master/hardware-configuration.nix19
-rw-r--r--hosts/local/master/hw.nix47
-rw-r--r--hosts/pkgs.nix6
l---------result1
14 files changed, 192 insertions, 25 deletions
diff --git a/derivations/codex/flake.lock b/derivations/codex/flake.lock
new file mode 100644
index 0000000..05b1cf8
--- /dev/null
+++ b/derivations/codex/flake.lock
@@ -0,0 +1,27 @@
+{
+ "nodes": {
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1752480373,
+ "narHash": "sha256-JHQbm+OcGp32wAsXTE/FLYGNpb+4GLi5oTvCxwSoBOA=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "62e0f05ede1da0d54515d4ea8ce9c733f12d9f08",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/derivations/codex/flake.nix b/derivations/codex/flake.nix
index 3a0a46f..38ad305 100644
--- a/derivations/codex/flake.nix
+++ b/derivations/codex/flake.nix
@@ -12,8 +12,14 @@
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
- packages.${system}.default = pkgs.callPackage ./default.nix {
- inherit (pkgs) lib buildNpmPackage fetchFromGitHub fetchNpmDeps gitUpdater;
+ packages.${system}.rust = pkgs.callPackage ./rust.nix {
+ inherit (pkgs) lib rustPlatform fetchFromGitHub nix-update-script pkg-config openssl versionCheckHook;
+ };
+ packages.${system}.node = pkgs.callPackage ./node.nix {
+ inherit (pkgs) lib fetchFromGitHub jq makeWrapper;
+ node = pkgs.nodejs_22;
+ pnpm = pkgs.pnpm_10;
+ mkDerivation = pkgs.stdenv.mkDerivation;
};
};
}
diff --git a/derivations/codex/node.nix b/derivations/codex/node.nix
new file mode 100644
index 0000000..7cf50d5
--- /dev/null
+++ b/derivations/codex/node.nix
@@ -0,0 +1,59 @@
+{
+ lib,
+ mkDerivation,
+ fetchFromGitHub,
+ pnpm,
+ node,
+ jq,
+ makeWrapper,
+}:
+mkDerivation (finalAttrs: {
+ pname = "codex-cli";
+ version = "0.8.0";
+ src = fetchFromGitHub {
+ owner = "openai";
+ repo = "codex";
+ rev = "4082246f6aac288a817330b92cfd5573df61f0e7";
+ # tag = "v${finalAttrs.version}";
+ sha256 = "DAenod/w9BydYdYsOnuLj7kCQRcTnZ81tf4MhLUug6c=";
+ };
+ pnpmDeps = pnpm.fetchDeps {
+ inherit (finalAttrs) pname version src;
+ hash = "sha256-otogkSsKJ5j1BY00y4SRhL9pm7CK9nmzVisvGCDIMlU=";
+ };
+ nativeBuildInputs = [
+ node
+ pnpm
+ pnpm.configHook
+ jq
+ makeWrapper
+ ];
+ pnpmInstallFlags = ["--frozen-lockfile"];
+
+ buildPhase = ''
+ runHook preBuild
+ pnpm install --offline --frozen-lockfile
+ pnpm --filter ./codex-cli... run build
+ runHook postBuild
+ '';
+
+ installPhase = ''
+ runHook preInstall
+
+ pkgRoot=$out/lib/node_modules/${final.pname}
+ mkdir -p $pkgRoot
+ cp -R codex-cli/* $pkgRoot/
+
+ path=$(jq -r '.bin.codex' codex-cli/package.json)
+ mkdir -p $out/bin
+ makeWrapper ${node}/bin/node $out/bin/codex --add-flags "$pkgRoot/$path"
+
+ runHook postInstall
+ '';
+
+ meta = with lib; {
+ description = "OpenAI Codex command‑line interface";
+ license = licenses.asl20;
+ homepage = "https://github.com/openai/codex";
+ };
+})
diff --git a/derivations/codex/default.nix b/derivations/codex/rust.nix
index 5a0f366..e07fb79 100644
--- a/derivations/codex/default.nix
+++ b/derivations/codex/rust.nix
@@ -9,7 +9,7 @@
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "codex";
- version = "0.7.0";
+ version = "0.4.0";
src = fetchFromGitHub {
owner = "openai";
diff --git a/derivations/gemini/default.nix b/derivations/gemini/default.nix
index ee53130..c1034f4 100644
--- a/derivations/gemini/default.nix
+++ b/derivations/gemini/default.nix
@@ -62,12 +62,13 @@
}:
buildNpmPackage (finalAttrs: {
pname = "gemini-cli";
- version = "0.1.7";
+ version = "0.1.12";
src = fetchFromGitHub {
owner = "google-gemini";
repo = "gemini-cli";
- tag = "v${finalAttrs.version}";
- hash = "sha256-DAenod/w9BydYdYsOnuLj7kCQRcTnZ81tf4MhLUug6c=";
+ rev = "cba272082d15a6b9fb4e21bc27ed1d56fa5b9a56";
+ # tag = "v${finalAttrs.version}";
+ sha256 = "DAenod/w9BydYdYsOnuLj7kCQRcTnZ81tf4MhLUug6c=";
};
npmDeps = fetchNpmDeps {
inherit (finalAttrs) src;
diff --git a/derivations/gemini/flake.lock b/derivations/gemini/flake.lock
new file mode 100644
index 0000000..05b1cf8
--- /dev/null
+++ b/derivations/gemini/flake.lock
@@ -0,0 +1,27 @@
+{
+ "nodes": {
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1752480373,
+ "narHash": "sha256-JHQbm+OcGp32wAsXTE/FLYGNpb+4GLi5oTvCxwSoBOA=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "62e0f05ede1da0d54515d4ea8ce9c733f12d9f08",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/derivations/gemini/flake.nix b/derivations/gemini/flake.nix
index 9dd913d..3a0a46f 100644
--- a/derivations/gemini/flake.nix
+++ b/derivations/gemini/flake.nix
@@ -14,7 +14,6 @@
in {
packages.${system}.default = pkgs.callPackage ./default.nix {
inherit (pkgs) lib buildNpmPackage fetchFromGitHub fetchNpmDeps gitUpdater;
- inherit nixpkgs;
};
};
}
diff --git a/flake.nix b/flake.nix
index 6f994ea..f0f8d37 100644
--- a/flake.nix
+++ b/flake.nix
@@ -84,6 +84,10 @@
url = "path:/home/y/nixconf/derivations/yek";
inputs.nixpkgs.follows = "nixpkgs";
};
+ gemini-cli = {
+ url = "path:/home/y/nixconf/derivations/gemini";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
############# non flakes ############
diff --git a/hosts/cloud/sortug/mail.nix b/hosts/cloud/sortug/mail.nix
index 68a960a..443e959 100644
--- a/hosts/cloud/sortug/mail.nix
+++ b/hosts/cloud/sortug/mail.nix
@@ -6,7 +6,7 @@
# services.dovecot2.sieve.extensions = ["fileinto"];
mailserver = {
enable = true;
- stateVersion = 1;
+ stateVersion = 3;
fqdn = "mail.sortug.com";
domains = ["sortug.com" "yago.onl"];
# workaround
diff --git a/hosts/editors.nix b/hosts/editors.nix
index 78d0fdd..2128d90 100644
--- a/hosts/editors.nix
+++ b/hosts/editors.nix
@@ -7,9 +7,10 @@
environment.variables.F = "hx";
environment.systemPackages = with pkgs; [
neovim
- #inputs.helix.packages.${pkgs.system}.helix
- nodePackages.prettier
+ # inputs.helix.packages.${pkgs.system}.helix
helix
+ # for json formatting on helix
+ nodePackages.prettier
vscode-langservers-extracted
nil
alejandra
diff --git a/hosts/local/master/hardware-configuration.nix b/hosts/local/master/hardware-configuration.nix
index 8439f01..a20ea6e 100644
--- a/hosts/local/master/hardware-configuration.nix
+++ b/hosts/local/master/hardware-configuration.nix
@@ -7,14 +7,12 @@
pkgs,
modulesPath,
...
-}: let
- rtl8188gu = config.boot.kernelPackages.callPackage ./rtl8188gu.nix {};
-in {
+}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
- boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
+ boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
@@ -30,18 +28,15 @@ in {
options = ["fmask=0077" "dmask=0077"];
};
+ # fileSystems."/home/y/sata" =
+ # { device = "/dev/disk/by-uuid/1f689125-e290-4904-9046-f67b51d05c6b";
+ # fsType = "ext4";
+ # };
+
swapDevices = [
{device = "/dev/disk/by-uuid/e34d7981-458b-462a-b551-007bce4f40f9";}
];
- # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
- # (the default) this is the recommended approach. When using systemd-networkd it's
- # still possible to use this option, but it's recommended to use it in conjunction
- # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
- networking.useDHCP = lib.mkDefault true;
- # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
- # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true;
-
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
diff --git a/hosts/local/master/hw.nix b/hosts/local/master/hw.nix
new file mode 100644
index 0000000..8439f01
--- /dev/null
+++ b/hosts/local/master/hw.nix
@@ -0,0 +1,47 @@
+# 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,
+ ...
+}: let
+ rtl8188gu = config.boot.kernelPackages.callPackage ./rtl8188gu.nix {};
+in {
+ 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 = [];
+
+ fileSystems."/" = {
+ device = "/dev/disk/by-uuid/3f1343f2-1ba3-4c57-b95e-bb808d3dffd3";
+ fsType = "ext4";
+ };
+
+ fileSystems."/boot" = {
+ device = "/dev/disk/by-uuid/C676-FD24";
+ fsType = "vfat";
+ options = ["fmask=0077" "dmask=0077"];
+ };
+
+ swapDevices = [
+ {device = "/dev/disk/by-uuid/e34d7981-458b-462a-b551-007bce4f40f9";}
+ ];
+
+ # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
+ # (the default) this is the recommended approach. When using systemd-networkd it's
+ # still possible to use this option, but it's recommended to use it in conjunction
+ # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
+ networking.useDHCP = lib.mkDefault true;
+ # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
+ # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true;
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+ hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}
diff --git a/hosts/pkgs.nix b/hosts/pkgs.nix
index 1fb5865..bf940f6 100644
--- a/hosts/pkgs.nix
+++ b/hosts/pkgs.nix
@@ -71,7 +71,7 @@
claude-code
codex
nushell
- # gemini-cli
+ # inputs.gemini-cli.packages.x86_64-linux.default
]
++ lib.optionals pkgs.stdenv.isLinux [
# linuxKernel.packages.linux_latest_libre.cpupower
@@ -93,8 +93,8 @@
appimage-run
# disk automount
udiskie
- nodejs
- bun
+ # nodejs
+ # bun
# /mac
]
++ lib.optionals pkgs.stdenv.isDarwin [
diff --git a/result b/result
new file mode 120000
index 0000000..7d154f4
--- /dev/null
+++ b/result
@@ -0,0 +1 @@
+/nix/store/8drkdhll600qa5ky3j98fchc97h9mj2h-nixos-system-spanmail-25.11.20250725.7fd36ee \ No newline at end of file