cachy kernel naming
This commit is contained in:
@@ -20,38 +20,39 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
sops = {
|
sops = {
|
||||||
age.keyFile = "/home/admin/.config/sops/age/keys.txt";
|
# enable = true;
|
||||||
defaultSopsFile = "/etc/nixos/secrets/secrets.yaml";
|
# age.keyFile = "/home/admin/.config/sops/age/keys.txt";
|
||||||
validateSopsFiles = false;
|
# defaultSopsFile = "/etc/nixos/secrets/secrets.yaml";
|
||||||
secrets = {
|
# validateSopsFiles = false;
|
||||||
"ssh-keys-public/jallen-nas" = {
|
# secrets = {
|
||||||
path = "/home/admin/.ssh/id_ed25519.pub";
|
# "ssh-keys-public/jallen-nas" = {
|
||||||
mode = "0644";
|
# path = "/home/admin/.ssh/id_ed25519.pub";
|
||||||
};
|
# mode = "0644";
|
||||||
"ssh-keys-private/jallen-nas" = {
|
# };
|
||||||
path = "/home/admin/.ssh/id_ed25519";
|
# "ssh-keys-private/jallen-nas" = {
|
||||||
mode = "0600";
|
# path = "/home/admin/.ssh/id_ed25519";
|
||||||
};
|
# mode = "0600";
|
||||||
"ssh-keys-public/desktop-nixos" = {
|
# };
|
||||||
path = "/home/admin/.ssh/authorized_keys";
|
# "ssh-keys-public/desktop-nixos" = {
|
||||||
mode = "0600";
|
# path = "/home/admin/.ssh/authorized_keys";
|
||||||
};
|
# mode = "0600";
|
||||||
|
# };
|
||||||
|
|
||||||
"ssh-keys-public/desktop-nixos-root" = {
|
# "ssh-keys-public/desktop-nixos-root" = {
|
||||||
path = "/home/admin/.ssh/authorized_keys2";
|
# path = "/home/admin/.ssh/authorized_keys2";
|
||||||
mode = "0600";
|
# mode = "0600";
|
||||||
};
|
# };
|
||||||
|
|
||||||
"ssh-keys-public/desktop-windows" = {
|
# "ssh-keys-public/desktop-windows" = {
|
||||||
path = "/home/admin/.ssh/authorized_keys3";
|
# path = "/home/admin/.ssh/authorized_keys3";
|
||||||
mode = "0600";
|
# mode = "0600";
|
||||||
};
|
# };
|
||||||
|
|
||||||
"ssh-keys-public/macbook-macos" = {
|
# "ssh-keys-public/macbook-macos" = {
|
||||||
path = "/home/admin/.ssh/authorized_keys4";
|
# path = "/home/admin/.ssh/authorized_keys4";
|
||||||
mode = "0600";
|
# mode = "0600";
|
||||||
};
|
# };
|
||||||
};
|
# };
|
||||||
};
|
};
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
|
|||||||
@@ -35,9 +35,9 @@
|
|||||||
# Pass inputs so external modules can access them
|
# Pass inputs so external modules can access them
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
inherit inputs namespace;
|
inherit inputs namespace;
|
||||||
overlays = with inputs; [
|
# overlays = with inputs; [
|
||||||
nix-vscode-extensions.overlays.default
|
# nix-vscode-extensions.overlays.default
|
||||||
];
|
# ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Make ALL external HM modules available globally
|
# Make ALL external HM modules available globally
|
||||||
|
|||||||
@@ -17,7 +17,10 @@ let
|
|||||||
import feedparser
|
import feedparser
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
token = os.get_env("GITHUB_TOKEN")
|
token = None
|
||||||
|
|
||||||
|
with open('${config.sops.secrets."github-token".path}', 'r') as token_file:
|
||||||
|
token = token_file.readline()
|
||||||
|
|
||||||
auth = Auth.Token(token)
|
auth = Auth.Token(token)
|
||||||
|
|
||||||
@@ -27,9 +30,9 @@ let
|
|||||||
result = None
|
result = None
|
||||||
prefetch = None
|
prefetch = None
|
||||||
ghub = Github(auth=auth)
|
ghub = Github(auth=auth)
|
||||||
print(" getting repo " + owner + "/" + repo)
|
print(' getting repo ' + owner + '/' + repo)
|
||||||
repo = ghub.get_repo(owner + "/" + repo)
|
repo = ghub.get_repo(owner + '/' + repo)
|
||||||
if "-b" in version:
|
if '-b' in version:
|
||||||
release = repo.get_releases()[0]
|
release = repo.get_releases()[0]
|
||||||
latest_version = release.name
|
latest_version = release.name
|
||||||
else:
|
else:
|
||||||
@@ -47,48 +50,48 @@ let
|
|||||||
|
|
||||||
if latest_version is not None:
|
if latest_version is not None:
|
||||||
|
|
||||||
if latest_version.replace("v","") != version.replace("v",""):
|
if latest_version.replace('v',''\'') != version.replace('v',''\''):
|
||||||
print(" update found")
|
print(' update found')
|
||||||
print(" Current version: " + version)
|
print(' Current version: ' + version)
|
||||||
print(" Latest version: " + latest_version)
|
print(' Latest version: ' + latest_version)
|
||||||
result = subprocess.check_output(["nix-prefetch-git", "--quiet", repo.clone_url, "--rev", latest_version])
|
result = subprocess.check_output(['nix-prefetch-git', '--quiet', repo.clone_url, '--rev', latest_version])
|
||||||
prefetch = json.loads(result)
|
prefetch = json.loads(result)
|
||||||
print(" New hash: " + prefetch.get("hash"))
|
print(' New hash: ' + prefetch.get('hash'))
|
||||||
else:
|
else:
|
||||||
print(" no update")
|
print(' no update')
|
||||||
ghub.close()
|
ghub.close()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
def check_codeberg(owner, repo, version):
|
def check_codeberg(owner, repo, version):
|
||||||
feed = feedparser.parse("https://codeberg.org/{0}/{1}/releases.rss".format(owner, repo))
|
feed = feedparser.parse('https://codeberg.org/{0}/{1}/releases.rss'.format(owner, repo))
|
||||||
if feed.status == 200:
|
if feed.status == 200:
|
||||||
entry = feed.entries[0]
|
entry = feed.entries[0]
|
||||||
if entry.title.replace("v","") != version.replace("v",""):
|
if entry.title.replace('v',''\'') != version.replace('v',''\''):
|
||||||
print(" update found")
|
print(' update found')
|
||||||
print(" Current version: " + version)
|
print(' Current version: ' + version)
|
||||||
print(" Latest version: " + entry.title)
|
print(' Latest version: ' + entry.title)
|
||||||
sha256 = subprocess.check_output(["nix-prefetch-url", url.replace("''\${version}", entry.title.replace("v", ""))])
|
sha256 = subprocess.check_output(['nix-prefetch-url', url.replace(''\'''\${version}', entry.title.replace('v', ''\''))])
|
||||||
prefetch = subprocess.check_output(["nix", "hash", "convert", "--hash-algo", "sha256", str(sha256.decode("utf-8").strip())])
|
prefetch = subprocess.check_output(['nix', 'hash', 'convert', '--hash-algo', 'sha256', str(sha256.decode('utf-8').strip())])
|
||||||
print(" New hash: " + prefetch.decode("utf-8").strip())
|
print(' New hash: ' + prefetch.decode('utf-8').strip())
|
||||||
else:
|
else:
|
||||||
print(" no update")
|
print(' no update')
|
||||||
|
|
||||||
def check_open_vsx(publisher, name, version):
|
def check_open_vsx(publisher, name, version):
|
||||||
open_vsx = requests.get("https://open-vsx.org/api/" + publisher + "/" + name)
|
open_vsx = requests.get('https://open-vsx.org/api/' + publisher + '/' + name)
|
||||||
if open_vsx.status_code == 200:
|
if open_vsx.status_code == 200:
|
||||||
extension = open_vsx.json()
|
extension = open_vsx.json()
|
||||||
latest_version = extension.get("version")
|
latest_version = extension.get('version')
|
||||||
url = extension.get("files").get("download")
|
url = extension.get('files').get('download')
|
||||||
if latest_version.replace("v","") != version.replace("v",""):
|
if latest_version.replace('v',''\'') != version.replace('v',''\''):
|
||||||
print(" update found")
|
print(' update found')
|
||||||
print(" Current version: " + version)
|
print(' Current version: ' + version)
|
||||||
print(" Latest version: " + latest_version)
|
print(' Latest version: ' + latest_version)
|
||||||
sha256 = subprocess.check_output(["nix-prefetch-url", url])
|
sha256 = subprocess.check_output(['nix-prefetch-url', url])
|
||||||
prefetch = subprocess.check_output(["nix", "hash", "convert", "--hash-algo", "sha256", str(sha256.decode("utf-8").strip())])
|
prefetch = subprocess.check_output(['nix', 'hash', 'convert', '--hash-algo', 'sha256', str(sha256.decode('utf-8').strip())])
|
||||||
print(" New hash: " + prefetch.decode("utf-8").strip())
|
print(' New hash: ' + prefetch.decode('utf-8').strip())
|
||||||
else:
|
else:
|
||||||
print(" no update")
|
print(' no update')
|
||||||
|
|
||||||
def parse_nix(package_spec):
|
def parse_nix(package_spec):
|
||||||
version = None
|
version = None
|
||||||
@@ -100,168 +103,167 @@ let
|
|||||||
name = None
|
name = None
|
||||||
publisher = None
|
publisher = None
|
||||||
for line in package_spec.readlines():
|
for line in package_spec.readlines():
|
||||||
if "owner = "" in line and owner is None:
|
if 'owner = "' in line and owner is None:
|
||||||
owner = line.split(" = ")[-1].replace(""", "").replace(";\n", "")
|
owner = line.split(' = ')[-1].replace('"', ''\'').replace(';\n', ''\'')
|
||||||
if "repo = "" in line and repo is None:
|
if 'repo = "' in line and repo is None:
|
||||||
repo = line.split(" = ")[-1].replace(""", "").replace(";\n", "")
|
repo = line.split(' = ')[-1].replace('"', ''\'').replace(';\n', ''\'')
|
||||||
if "version = "" in line and version is None:
|
if 'version = "' in line and version is None:
|
||||||
version = line.split(" = ")[-1].replace(""", "").replace(";\n", "")
|
version = line.split(' = ')[-1].replace('"', ''\'').replace(';\n', ''\'')
|
||||||
if "rev = "" in line and "''\${version}" not in line:
|
if 'rev = "' in line and ''\'''\${version}' not in line:
|
||||||
version = line.split(" = ")[-1].replace(""", "").replace(";\n", "")
|
version = line.split(' = ')[-1].replace('"', ''\'').replace(';\n', ''\'')
|
||||||
if "url = "" in line and url is None:
|
if 'url = "' in line and url is None:
|
||||||
url = line.split(" = ")[-1].replace(""", "").replace(";\n", "")
|
url = line.split(' = ')[-1].replace('"', ''\'').replace(';\n', ''\'')
|
||||||
if "sha256 = "" in line or " hash = "" in line and current_hash is None:
|
if 'sha256 = "' in line or ' hash = "' in line and current_hash is None:
|
||||||
current_hash = line.split(" = ")[-1].replace(""", "").replace(";\n", "")
|
current_hash = line.split(' = ')[-1].replace('"', ''\'').replace(';\n', ''\'')
|
||||||
if "pname = "" in line and pname is None:
|
if 'pname = "' in line and pname is None:
|
||||||
pname = line.split(" = ")[-1].replace(""", "").replace(";\n", "")
|
pname = line.split(' = ')[-1].replace('"', ''\'').replace(';\n', ''\'')
|
||||||
if " name = "" in line and name is None:
|
if ' name = "' in line and name is None:
|
||||||
name = line.split(" = ")[-1].replace(""", "").replace(";\n", "")
|
name = line.split(' = ')[-1].replace('"', ''\'').replace(';\n', ''\'')
|
||||||
if "publisher = "" in line and publisher is None:
|
if 'publisher = "' in line and publisher is None:
|
||||||
publisher = line.split(" = ")[-1].replace(""", "").replace(";\n", "")
|
publisher = line.split(' = ')[-1].replace('"', ''\'').replace(';\n', ''\'')
|
||||||
|
|
||||||
if url is None and repo is not None:
|
if url is None and repo is not None:
|
||||||
if "pname" in repo:
|
if 'pname' in repo:
|
||||||
repo = repo.replace("''\${pname}", pname)
|
repo = repo.replace(''\'''\${pname}', pname)
|
||||||
url = "https://github.com/{0}/{1}/releases/tag/{2}".format(owner, repo, version)
|
url = 'https://github.com/{0}/{1}/releases/tag/{2}'.format(owner, repo, version)
|
||||||
|
|
||||||
if url is not None and repo is None and "github" in url:
|
if url is not None and repo is None and 'github' in url:
|
||||||
owner = url.split("github.com/")[-1].split("/")[0]
|
owner = url.split('github.com/')[-1].split('/')[0]
|
||||||
repo = url.split("github.com/")[-1].split("/")[1]
|
repo = url.split('github.com/')[-1].split('/')[1]
|
||||||
|
|
||||||
if url is not None and repo is None and "codeberg" in url:
|
if url is not None and repo is None and 'codeberg' in url:
|
||||||
owner = url.split("codeberg.org/")[-1].split("/")[0]
|
owner = url.split('codeberg.org/')[-1].split('/')[0]
|
||||||
repo = url.split("codeberg.org/")[-1].split("/")[1]
|
repo = url.split('codeberg.org/')[-1].split('/')[1]
|
||||||
|
|
||||||
if url is not None and version is None:
|
if url is not None and version is None:
|
||||||
version = url.split("/")[-1].replace(".tar.gz", "")
|
version = url.split('/')[-1].replace('.tar.gz', ''\'')
|
||||||
|
|
||||||
if url is not None and publisher is not None:
|
if url is not None and publisher is not None:
|
||||||
url = url.replace("''\${publisher}", publisher).replace("''\${name}", name)
|
url = url.replace(''\'''\${publisher}', publisher).replace(''\'''\${name}', name)
|
||||||
|
|
||||||
return url, current_hash, owner, repo, pname, name, publisher, version
|
return url, current_hash, owner, repo, pname, name, publisher, version
|
||||||
|
|
||||||
def parse_json(json_versions, flavor=""):
|
def parse_json(json_versions, flavor=''\''):
|
||||||
versions = json.load(json_versions)
|
versions = json.load(json_versions)
|
||||||
linux_versions = versions.get("linux")
|
linux_versions = versions.get('linux')
|
||||||
config_versions = versions.get("config")
|
config_versions = versions.get('config')
|
||||||
patch_versions = versions.get("patches")
|
patch_versions = versions.get('patches')
|
||||||
zfs_versions = versions.get("zfs")
|
zfs_versions = versions.get('zfs')
|
||||||
|
|
||||||
check_kernel(linux_versions, flavor)
|
check_kernel(linux_versions, flavor)
|
||||||
check_cachy_config(config_versions, flavor)
|
check_cachy_config(config_versions, flavor)
|
||||||
check_patch_versions(patch_versions, flavor)
|
check_patch_versions(patch_versions, flavor)
|
||||||
check_zfs_versions(zfs_versions, flavor)
|
check_zfs_versions(zfs_versions, flavor)
|
||||||
|
|
||||||
def check_kernel(linux_versions, flavor=""):
|
def check_kernel(linux_versions, flavor=''\''):
|
||||||
srcinfo = requests.get("https://raw.githubusercontent.com/CachyOS/linux-cachyos/master/linux-cachyos" + flavor + "/.SRCINFO")
|
srcinfo = requests.get('https://raw.githubusercontent.com/CachyOS/linux-cachyos/master/linux-cachyos' + flavor + '/.SRCINFO')
|
||||||
for line in srcinfo.text.split("\n"):
|
for line in srcinfo.text.split('\n'):
|
||||||
if "pkgver = " in line:
|
if 'pkgver = ' in line:
|
||||||
kernel_version = line.split("=")[-1].strip()
|
kernel_version = line.split('=')[-1].strip()
|
||||||
if kernel_version[-2:] == ".0":
|
if kernel_version[-2:] == '.0':
|
||||||
kernel_version = kernel_version[:-2]
|
kernel_version = kernel_version[:-2]
|
||||||
if flavor in ["", "-lts", "-server", "-gcc", "-hardened"]:
|
if flavor in [''\'', '-lts', '-server', '-gcc', '-hardened']:
|
||||||
release_src = "https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-" + kernel_version + ".tar.xz"
|
release_src = 'https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-' + kernel_version + '.tar.xz'
|
||||||
if flavor == "-rc":
|
if flavor == '-rc':
|
||||||
release_src = "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/snapshot/linux-" + kernel_version.replace(".rc", "-rc") + ".tar.gz"
|
release_src = 'https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/snapshot/linux-' + kernel_version.replace('.rc', '-rc') + '.tar.gz'
|
||||||
sha256 = subprocess.check_output(["nix-prefetch-url", release_src])
|
sha256 = subprocess.check_output(['nix-prefetch-url', release_src])
|
||||||
prefetch = subprocess.check_output(["nix", "hash", "convert", "--hash-algo", "sha256", str(sha256.decode("utf-8").strip())])
|
prefetch = subprocess.check_output(['nix', 'hash', 'convert', '--hash-algo', 'sha256', str(sha256.decode('utf-8').strip())])
|
||||||
current_version = linux_versions.get("version")
|
current_version = linux_versions.get('version')
|
||||||
current_hash = linux_versions.get("hash")
|
current_hash = linux_versions.get('hash')
|
||||||
latest_hash = prefetch.decode("utf-8").strip()
|
latest_hash = prefetch.decode('utf-8').strip()
|
||||||
print(" Checking linux versions...")
|
print(' Checking linux versions...')
|
||||||
if current_hash != latest_hash:
|
if current_hash != latest_hash:
|
||||||
print(" Current rev: " + current_version)
|
print(' Current rev: ' + current_version)
|
||||||
print(" Current hash: " + current_hash)
|
print(' Current hash: ' + current_hash)
|
||||||
print(" New rev: " + kernel_version)
|
print(' New rev: ' + kernel_version)
|
||||||
print(" New hash: " + latest_hash)
|
print(' New hash: ' + latest_hash)
|
||||||
else:
|
else:
|
||||||
print(" no update")
|
print(' no update')
|
||||||
|
|
||||||
def check_cachy_config(config_versions, flavor=""):
|
def check_cachy_config(config_versions, flavor=''\''):
|
||||||
result = subprocess.check_output(["nix-prefetch-git", "--quiet", "https://github.com/CachyOS/linux-cachyos.git"])
|
result = subprocess.check_output(['nix-prefetch-git', '--quiet', 'https://github.com/CachyOS/linux-cachyos.git'])
|
||||||
prefetch = json.loads(result)
|
prefetch = json.loads(result)
|
||||||
current_version = config_versions.get("rev")
|
current_version = config_versions.get('rev')
|
||||||
latest_version = prefetch.get("rev")
|
latest_version = prefetch.get('rev')
|
||||||
print(" Checking config versions...")
|
print(' Checking config versions...')
|
||||||
if current_version != latest_version:
|
if current_version != latest_version:
|
||||||
print(" Current rev: " + current_version)
|
print(' Current rev: ' + current_version)
|
||||||
print(" New rev: " + latest_version)
|
print(' New rev: ' + latest_version)
|
||||||
print(" New hash: " + prefetch.get("hash"))
|
print(' New hash: ' + prefetch.get('hash'))
|
||||||
else:
|
else:
|
||||||
print(" no update")
|
print(' no update')
|
||||||
|
|
||||||
def check_patch_versions(patch_versions, flavor=""):
|
def check_patch_versions(patch_versions, flavor=''\''):
|
||||||
result = subprocess.check_output(["nix-prefetch-git", "--quiet", "https://github.com/CachyOS/kernel-patches.git"])
|
result = subprocess.check_output(['nix-prefetch-git', '--quiet', 'https://github.com/CachyOS/kernel-patches.git'])
|
||||||
prefetch = json.loads(result)
|
prefetch = json.loads(result)
|
||||||
current_version = patch_versions.get("rev")
|
current_version = patch_versions.get('rev')
|
||||||
latest_version = prefetch.get("rev")
|
latest_version = prefetch.get('rev')
|
||||||
print(" Checking patch versions...")
|
print(' Checking patch versions...')
|
||||||
if current_version != latest_version:
|
if current_version != latest_version:
|
||||||
print(" Current rev: " + current_version)
|
print(' Current rev: ' + current_version)
|
||||||
print(" New rev: " + latest_version)
|
print(' New rev: ' + latest_version)
|
||||||
print(" New hash: " + prefetch.get("hash"))
|
print(' New hash: ' + prefetch.get('hash'))
|
||||||
else:
|
else:
|
||||||
print(" no update")
|
print(' no update')
|
||||||
|
|
||||||
def kconfig_to_nix(flavor=""):
|
def kconfig_to_nix(flavor=''\''):
|
||||||
kconfig_result = subprocess.check_output(["nix", "build", ".#nixosConfigurations.jallen-nas.pkgs.linuxPackages_cachyos" + flavor + ".kernel.kconfigToNix", "--no-link", "--print-out-paths"])
|
kconfig_result = subprocess.check_output(['nix', 'build', '.#nixosConfigurations.jallen-nas.pkgs.linuxPackages_cachyos' + flavor + '.kernel.kconfigToNix', '--no-link', '--print-out-paths'])
|
||||||
config_file = kconfig_result.decode("utf-8").strip()
|
config_file = kconfig_result.decode('utf-8').strip()
|
||||||
if flavor == "":
|
if flavor == ''\'':
|
||||||
cachy_flavor = "-gcc"
|
cachy_flavor = '-gcc'
|
||||||
result = subprocess.check_output(["cat", config_file])
|
result = subprocess.check_output(['cat', config_file])
|
||||||
with open("/etc/nixos/packages/linux-cachyos/config-nix/cachyos" + cachy_flavor + ".x86_64-linux.nix", "w") as config:
|
with open('/etc/nixos/packages/linux-cachyos/config-nix/cachyos' + cachy_flavor + '.x86_64-linux.nix', 'w') as config:
|
||||||
config.write(result.decode("utf-8").strip())
|
config.write(result.decode('utf-8').strip())
|
||||||
|
|
||||||
def check_zfs_versions(zfs_versions, flavor=""):
|
def check_zfs_versions(zfs_versions, flavor=''\''):
|
||||||
result = requests.get("https://raw.githubusercontent.com/CachyOS/linux-cachyos/master/linux-cachyos" + flavor + "/PKGBUILD")
|
result = requests.get('https://raw.githubusercontent.com/CachyOS/linux-cachyos/master/linux-cachyos' + flavor + '/PKGBUILD')
|
||||||
for line in result.text.split("\n"):
|
for line in result.text.split('\n'):
|
||||||
if "git+https://github.com/cachyos/zfs.git#commit=" in line:
|
if 'git+https://github.com/cachyos/zfs.git#commit=' in line:
|
||||||
zfs_rev = line.split("zfs.git#commit=")[-1].replace("")", "")
|
zfs_rev = line.split('zfs.git#commit=')[-1].replace('")', ''\'')
|
||||||
result = subprocess.check_output(["nix-prefetch-git", "--quiet", "https://github.com/CachyOS/zfs.git", "--rev", zfs_rev])
|
result = subprocess.check_output(['nix-prefetch-git', '--quiet', 'https://github.com/CachyOS/zfs.git', '--rev', zfs_rev])
|
||||||
prefetch = json.loads(result)
|
prefetch = json.loads(result)
|
||||||
current_version = zfs_versions.get("rev")
|
current_version = zfs_versions.get('rev')
|
||||||
latest_version = prefetch.get("rev")
|
latest_version = prefetch.get('rev')
|
||||||
print(" Checking zfs versions...")
|
print(' Checking zfs versions...')
|
||||||
if current_version != latest_version:
|
if current_version != latest_version:
|
||||||
print(" Current rev: " + current_version)
|
print(' Current rev: ' + current_version)
|
||||||
print(" New rev: " + latest_version)
|
print(' New rev: ' + latest_version)
|
||||||
print(" New hash: " + prefetch.get("hash"))
|
print(' New hash: ' + prefetch.get('hash'))
|
||||||
else:
|
else:
|
||||||
print(" no update")
|
print(' no update')
|
||||||
|
|
||||||
for (root,dirs,files) in os.walk("/etc/nixos/packages",topdown=True):
|
for (root,dirs,files) in os.walk('/etc/nixos/packages',topdown=True):
|
||||||
if "default.nix" in files and "versions.json" not in files:
|
if 'default.nix' in files and 'versions.json' not in files:
|
||||||
continue
|
print(root.split('/')[-1])
|
||||||
print(root.split("/")[-1])
|
with open(root + '/default.nix', 'r') as package_spec:
|
||||||
with open(root + "/default.nix", "r") as package_spec:
|
|
||||||
url, current_hash, owner, repo, pname, name, publisher, version = parse_nix(package_spec)
|
url, current_hash, owner, repo, pname, name, publisher, version = parse_nix(package_spec)
|
||||||
|
|
||||||
if owner is not None and repo is not None and "codeberg" in url:
|
if owner is not None and repo is not None and 'codeberg' in url:
|
||||||
check_codeberg(owner, repo, version)
|
check_codeberg(owner, repo, version)
|
||||||
|
|
||||||
elif owner is not None and repo is not None and "github" in url:
|
elif owner is not None and repo is not None and 'github' in url:
|
||||||
check_github(owner, repo, version)
|
check_github(owner, repo, version)
|
||||||
|
|
||||||
elif publisher is not None and "open-vsx" in url:
|
elif publisher is not None and 'open-vsx' in url:
|
||||||
check_open_vsx(publisher, name, version)
|
check_open_vsx(publisher, name, version)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if url is not None:
|
if url is not None:
|
||||||
print(url)
|
print(url)
|
||||||
|
|
||||||
if "default.nix" in files and "versions.json" in files:
|
if 'default.nix' in files and 'versions.json' in files:
|
||||||
with open(root + "/versions.json", "r") as json_versions:
|
with open(root + '/versions.json', 'r') as json_versions:
|
||||||
print("Checking Linux CachyOS")
|
print('Checking Linux CachyOS')
|
||||||
parse_json(json_versions)
|
parse_json(json_versions)
|
||||||
with open(root + "/versions-rc.json", "r") as json_versions:
|
with open(root + '/versions-rc.json', 'r') as json_versions:
|
||||||
print("Checking Linux CachyOS RC")
|
print('Checking Linux CachyOS RC')
|
||||||
parse_json(json_versions, "-rc")
|
parse_json(json_versions, '-rc')
|
||||||
with open(root + "/versions-lts.json", "r") as json_versions:
|
with open(root + '/versions-lts.json', 'r') as json_versions:
|
||||||
print("Checking Linux CachyOS LTS")
|
print('Checking Linux CachyOS LTS')
|
||||||
parse_json(json_versions, "-lts")
|
parse_json(json_versions, '-lts')
|
||||||
with open(root + "/versions-hardened.json", "r") as json_versions:
|
with open(root + '/versions-hardened.json', 'r') as json_versions:
|
||||||
print("Checking Linux CachyOS Hardened")
|
print('Checking Linux CachyOS Hardened')
|
||||||
parse_json(json_versions, "-hardened")
|
parse_json(json_versions, '-hardened')
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ in
|
|||||||
{
|
{
|
||||||
imports = [ ./options.nix ];
|
imports = [ ./options.nix ];
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = {
|
||||||
sops = {
|
sops = {
|
||||||
age.keyFile = "/home/${config.${namespace}.user.name}/.config/sops/age/keys.txt";
|
age.keyFile = "/home/${config.${namespace}.user.name}/.config/sops/age/keys.txt";
|
||||||
defaultSopsFile = "/etc/nixos/secrets/secrets.yaml";
|
defaultSopsFile = "/etc/nixos/secrets/secrets.yaml";
|
||||||
@@ -25,7 +25,7 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.zsh.initExtra = ''
|
programs.zsh.initContent = ''
|
||||||
if [ -f ${config.sops.templates.".env".path} ]; then
|
if [ -f ${config.sops.templates.".env".path} ]; then
|
||||||
export $(grep -v '^#' ${config.sops.templates.".env".path} | xargs)
|
export $(grep -v '^#' ${config.sops.templates.".env".path} | xargs)
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -53,9 +53,9 @@ in
|
|||||||
# Pass inputs so external modules can access them
|
# Pass inputs so external modules can access them
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
inherit inputs namespace hasDestopEnvironment;
|
inherit inputs namespace hasDestopEnvironment;
|
||||||
overlays = with inputs; [
|
# overlays = with inputs; [
|
||||||
nix-vscode-extensions.overlays.default
|
# nix-vscode-extensions.overlays.default
|
||||||
];
|
# ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Make ALL external HM modules available globally
|
# Make ALL external HM modules available globally
|
||||||
|
|||||||
@@ -8,28 +8,34 @@
|
|||||||
programs.ccache = {
|
programs.ccache = {
|
||||||
enable = true;
|
enable = true;
|
||||||
packageNames = [
|
packageNames = [
|
||||||
# "ffmpeg"
|
"cachyos-lto"
|
||||||
# "ffmpeg-full"
|
"cachyos-lto-x86_64-unknown-linux-gnu-6.18.0"
|
||||||
# "ffmpeg-headless-rpi"
|
"cachyos-lto-x86_64-unknown-linux-gnu"
|
||||||
# "gjs"
|
"cachyos-lto-znver4"
|
||||||
# "gst-plugins-bad"
|
"cachyos-server-lto"
|
||||||
# "gtk4"
|
"cachyos-server-lto-znver4"
|
||||||
# "jemalloc"
|
"ffmpeg"
|
||||||
# "libcamera-rpi"
|
"ffmpeg-full"
|
||||||
# "libraspberrypi"
|
"ffmpeg-headless-rpi"
|
||||||
# "libsecret"
|
"gjs"
|
||||||
# "linux"
|
"gst-plugins-bad"
|
||||||
# "opencv"
|
"gtk4"
|
||||||
# "pipewire"
|
"jemalloc"
|
||||||
# "qemu"
|
"libcamera-rpi"
|
||||||
# # qemu.pname
|
"libraspberrypi"
|
||||||
# "raspberrypi-utils"
|
"libsecret"
|
||||||
# "sdl"
|
"linux"
|
||||||
# "sdl2"
|
"opencv"
|
||||||
# "torch"
|
"pipewire"
|
||||||
# "uv"
|
"qemu"
|
||||||
# "webkitgtk"
|
# qemu.pname
|
||||||
# # "yubioath-flutter"
|
"raspberrypi-utils"
|
||||||
|
"sdl"
|
||||||
|
"sdl2"
|
||||||
|
"torch"
|
||||||
|
"uv"
|
||||||
|
"webkitgtk"
|
||||||
|
# "yubioath-flutter"
|
||||||
];
|
];
|
||||||
cacheDir = "/var/cache/ccache"; # default location
|
cacheDir = "/var/cache/ccache"; # default location
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ let
|
|||||||
|
|
||||||
ltoKernelAttrs = {
|
ltoKernelAttrs = {
|
||||||
taste = "linux-cachyos";
|
taste = "linux-cachyos";
|
||||||
|
pname = "cachyos-lto";
|
||||||
configPath = ./config-nix/cachyos-lto.x86_64-linux.nix;
|
configPath = ./config-nix/cachyos-lto.x86_64-linux.nix;
|
||||||
|
|
||||||
# Pass the unified arguments (including the resolved 'self') to llvm-pkgs
|
# Pass the unified arguments (including the resolved 'self') to llvm-pkgs
|
||||||
@@ -63,6 +64,7 @@ let
|
|||||||
|
|
||||||
serverLtoKernelAttrs = {
|
serverLtoKernelAttrs = {
|
||||||
taste = "linux-cachyos-server";
|
taste = "linux-cachyos-server";
|
||||||
|
pname = "cachyos-server-lto";
|
||||||
configPath = ./config-nix/cachyos-server-lto.x86_64-linux.nix;
|
configPath = ./config-nix/cachyos-server-lto.x86_64-linux.nix;
|
||||||
basicCachy = false;
|
basicCachy = false;
|
||||||
cpuSched = "eevdf";
|
cpuSched = "eevdf";
|
||||||
@@ -143,6 +145,7 @@ let
|
|||||||
|
|
||||||
gccKernel = mkCachyKernel {
|
gccKernel = mkCachyKernel {
|
||||||
taste = "linux-cachyos";
|
taste = "linux-cachyos";
|
||||||
|
pname = "cachyos-gcc";
|
||||||
configPath = ./config-nix/cachyos-gcc.x86_64-linux.nix;
|
configPath = ./config-nix/cachyos-gcc.x86_64-linux.nix;
|
||||||
# since all flavors use the same versions.json, we just need the updateScript in one of them
|
# since all flavors use the same versions.json, we just need the updateScript in one of them
|
||||||
withUpdateScript = "stable";
|
withUpdateScript = "stable";
|
||||||
@@ -160,6 +163,7 @@ in
|
|||||||
|
|
||||||
cachyos-lts = mkCachyKernel {
|
cachyos-lts = mkCachyKernel {
|
||||||
taste = "linux-cachyos-lts";
|
taste = "linux-cachyos-lts";
|
||||||
|
pname = "cachyos-lts";
|
||||||
configPath = ./config-nix/cachyos-lts.x86_64-linux.nix;
|
configPath = ./config-nix/cachyos-lts.x86_64-linux.nix;
|
||||||
|
|
||||||
versions = ltsVersions;
|
versions = ltsVersions;
|
||||||
@@ -173,6 +177,7 @@ in
|
|||||||
|
|
||||||
cachyos-rc = mkCachyKernel {
|
cachyos-rc = mkCachyKernel {
|
||||||
taste = "linux-cachyos-rc";
|
taste = "linux-cachyos-rc";
|
||||||
|
pname = "cachyos-rc";
|
||||||
configPath = ./config-nix/cachyos-rc.x86_64-linux.nix;
|
configPath = ./config-nix/cachyos-rc.x86_64-linux.nix;
|
||||||
|
|
||||||
versions = rcVersions;
|
versions = rcVersions;
|
||||||
@@ -188,6 +193,7 @@ in
|
|||||||
cachyos-lto-znver4 = mkCachyKernel (
|
cachyos-lto-znver4 = mkCachyKernel (
|
||||||
ltoKernelAttrs
|
ltoKernelAttrs
|
||||||
// {
|
// {
|
||||||
|
pname = "cachyos-lto-znver4";
|
||||||
configPath = ./config-nix/cachyos-znver4.x86_64-linux.nix;
|
configPath = ./config-nix/cachyos-znver4.x86_64-linux.nix;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -196,6 +202,7 @@ in
|
|||||||
|
|
||||||
cachyos-server = mkCachyKernel {
|
cachyos-server = mkCachyKernel {
|
||||||
taste = "linux-cachyos-server";
|
taste = "linux-cachyos-server";
|
||||||
|
pname = "cachyos-server";
|
||||||
configPath = ./config-nix/cachyos-server.x86_64-linux.nix;
|
configPath = ./config-nix/cachyos-server.x86_64-linux.nix;
|
||||||
basicCachy = false;
|
basicCachy = false;
|
||||||
cpuSched = "eevdf";
|
cpuSched = "eevdf";
|
||||||
@@ -215,11 +222,13 @@ in
|
|||||||
serverLtoKernelAttrs
|
serverLtoKernelAttrs
|
||||||
// {
|
// {
|
||||||
configPath = ./config-nix/cachyos-znver4.x86_64-linux.nix;
|
configPath = ./config-nix/cachyos-znver4.x86_64-linux.nix;
|
||||||
|
pname = "cachyos-server-lto-znver4";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
cachyos-hardened = mkCachyKernel {
|
cachyos-hardened = mkCachyKernel {
|
||||||
taste = "linux-cachyos-hardened";
|
taste = "linux-cachyos-hardened";
|
||||||
|
pname = "cachyos-hardened";
|
||||||
configPath = ./config-nix/cachyos-hardened.x86_64-linux.nix;
|
configPath = ./config-nix/cachyos-hardened.x86_64-linux.nix;
|
||||||
cpuSched = "hardened";
|
cpuSched = "hardened";
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
kernelPatches ? [ ],
|
kernelPatches ? [ ],
|
||||||
features ? null,
|
features ? null,
|
||||||
randstructSeed ? "",
|
randstructSeed ? "",
|
||||||
|
pname ? "unknown",
|
||||||
# For tests
|
# For tests
|
||||||
kernelPackages,
|
kernelPackages,
|
||||||
flakes,
|
flakes,
|
||||||
@@ -25,6 +26,7 @@ let
|
|||||||
in
|
in
|
||||||
(linuxManualConfig {
|
(linuxManualConfig {
|
||||||
inherit
|
inherit
|
||||||
|
pname
|
||||||
stdenv
|
stdenv
|
||||||
version
|
version
|
||||||
features
|
features
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
description ? "Linux EEVDF-BORE scheduler Kernel by CachyOS with other patches and improvements",
|
description ? "Linux EEVDF-BORE scheduler Kernel by CachyOS with other patches and improvements",
|
||||||
# For flakes
|
# For flakes
|
||||||
inputs ? { },
|
inputs ? { },
|
||||||
|
pname ? "unknown",
|
||||||
# Explicitly accept nixpkgs, falling back to inputs or the system path
|
# Explicitly accept nixpkgs, falling back to inputs or the system path
|
||||||
nixpkgs ? inputs.nixpkgs or pkgs.path,
|
nixpkgs ? inputs.nixpkgs or pkgs.path,
|
||||||
}:
|
}:
|
||||||
@@ -104,8 +105,32 @@ let
|
|||||||
};
|
};
|
||||||
linuxConfigTransfomed = import configPath;
|
linuxConfigTransfomed = import configPath;
|
||||||
|
|
||||||
|
# normalizeKernelName = pname: drv:
|
||||||
|
# drv.overrideAttrs (old: let
|
||||||
|
# ver = old.version or (lib.getVersion old.name or "unknown");
|
||||||
|
# in {
|
||||||
|
# __intentionallyOverridingVersion = true;
|
||||||
|
# pname = (if useLTO != "none" then "${pname}-lto" else pname);
|
||||||
|
# version = ver;
|
||||||
|
# name = "${pname}-${ver}";
|
||||||
|
# });
|
||||||
|
|
||||||
|
# versionSuffix = "+C${shorter versions.config.rev}+P${shorter versions.patches.rev}";
|
||||||
|
|
||||||
|
# kernel =
|
||||||
|
# normalizeKernelName (cachyConfig.taste or "linux")
|
||||||
|
# (callPackage ./kernel.nix {
|
||||||
|
# inherit cachyConfig stdenv kconfigToNix;
|
||||||
|
# kernelPatches = [ ];
|
||||||
|
# configfile = preparedConfigfile;
|
||||||
|
# config = linuxConfigTransfomed;
|
||||||
|
# flakes = inputs.flakes or null;
|
||||||
|
# final = inputs.final or null;
|
||||||
|
# kernelPackages = packagesWithRightPlatforms;
|
||||||
|
# });
|
||||||
|
|
||||||
kernel = callPackage ./kernel.nix {
|
kernel = callPackage ./kernel.nix {
|
||||||
inherit cachyConfig stdenv kconfigToNix;
|
inherit cachyConfig pname stdenv kconfigToNix;
|
||||||
kernelPatches = [ ];
|
kernelPatches = [ ];
|
||||||
configfile = preparedConfigfile;
|
configfile = preparedConfigfile;
|
||||||
config = linuxConfigTransfomed;
|
config = linuxConfigTransfomed;
|
||||||
|
|||||||
Reference in New Issue
Block a user