chore(dx/nix): fix flake partially

This commit is contained in:
Elian Doran
2025-09-04 12:12:23 +03:00
parent 62a0a44049
commit df1b87e3ac
2 changed files with 25 additions and 19 deletions

View File

@@ -1,11 +1,17 @@
import { execSync } from "child_process";
import { readFileSync } from "fs";
import { existsSync, readFileSync } from "fs";
import { platform } from "os";
export function isNixOS() {
if (platform() !== "linux") return false;
const osReleaseFile = readFileSync("/etc/os-release", "utf-8");
return osReleaseFile.includes("ID=nixos");
const osReleasePath = "/etc/os-release";
if (existsSync(osReleasePath)) {
const osReleaseFile = readFileSync(osReleasePath, "utf-8");
return osReleaseFile.includes("ID=nixos");
} else {
return !!process.env.NIX_STORE;
}
}
function resetPath() {