mirror of
https://github.com/zadam/trilium.git
synced 2025-10-27 16:26:31 +01:00
chore(dx/nix): fix flake partially
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user