Compare commits
No commits in common. "06c0bc1b3f668c6d81f090deb9643540b6cb46d2" and "6218392785894c3c2e148d57a8377adba92abbb3" have entirely different histories.
06c0bc1b3f
...
6218392785
9 changed files with 212 additions and 77 deletions
53
README.md
53
README.md
|
@ -1,20 +1,40 @@
|
||||||
# nixos x13s
|
# nixos x13s
|
||||||
|
|
||||||
> [!CAUTION]
|
> [!CAUTION]
|
||||||
> This project is partially maintained.
|
> This project is unmaintained.
|
||||||
> It receives kernel updates, until mainline will provide a fully functional experience.
|
|
||||||
|
|
||||||
This repository aims to provide easy, shared, support for Lenovo X13s on Linux.
|
This repository aims to provide easy, shared, support for Lenovo X13s on Linux.
|
||||||
|
|
||||||
The support for this machine is constantly improving in mainline kernel and upstream packages. Eventually the goal is that this repository is no longer necessary.
|
The support for this machine is constantly improving in mainline kernel and upstream packages. Eventually the goal is that this repository is no longer necessary.
|
||||||
|
|
||||||
|
## Binary cache
|
||||||
|
|
||||||
|
A binary cache is provided through Cachix so you can avoid re-building the kernel.
|
||||||
|
|
||||||
|
https://app.cachix.org/cache/nixos-x13s
|
||||||
|
|
||||||
|
Ensure you are not overriding the nixpkgs input when consuming this flake, or you may not be able to take advantages of this cache.
|
||||||
|
|
||||||
|
NixOS configuration example:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
nix.settings = {
|
||||||
|
substituters = [
|
||||||
|
"https://nixos-x13s.cachix.org"
|
||||||
|
];
|
||||||
|
trusted-public-keys = [
|
||||||
|
"nixos-x13s.cachix.org-1:SzroHbidolBD3Sf6UusXp12YZ+a5ynWv0RtYF0btFos="
|
||||||
|
];
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
## Add with a flake
|
## Add with a flake
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
nixos-x13s.url = "git+https://codeberg.org/steveej/nixos-x13s";
|
nixos-x13s.url = "git+https://codeberg.org/adamcstephens/nixos-x13s";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
|
@ -26,7 +46,13 @@ The support for this machine is constantly improving in mainline kernel and upst
|
||||||
inputs.nixos-x13s.nixosModules.default
|
inputs.nixos-x13s.nixosModules.default
|
||||||
{
|
{
|
||||||
nixos-x13s.enable = true;
|
nixos-x13s.enable = true;
|
||||||
nixos-x13s.kernel = "jhovold"; # jhovold is default
|
nixos-x13s.kernel = "jhovold"; # jhovold is default, but mainline supported
|
||||||
|
|
||||||
|
# install multiple kernels! note this increases eval time for each specialization
|
||||||
|
specialisation = {
|
||||||
|
# note that activation of each specialization is required to copy the dtb to the EFI, and thus boot
|
||||||
|
mainline.configuration.nixos-x13s.kernel = "mainline";
|
||||||
|
};
|
||||||
|
|
||||||
# allow unfree firmware
|
# allow unfree firmware
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
@ -40,6 +66,25 @@ The support for this machine is constantly improving in mainline kernel and upst
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Add using not a flake
|
||||||
|
|
||||||
|
Clone the repository:
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://codeberg.org/adamcstephens/nixos-x13s /etc/nixos/nixos-x13s
|
||||||
|
```
|
||||||
|
|
||||||
|
Then reference the module in your `configuration.nix` and use the module as documented in the flake example above:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
imports =
|
||||||
|
[
|
||||||
|
./nixos-x13s/module.nix
|
||||||
|
];
|
||||||
|
nixos-x13s.enable = true;
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
## UEFI Update ISO
|
## UEFI Update ISO
|
||||||
|
|
||||||
This repository provides a package which can output the USB UEFI Update ISO. This will be updated as Lenovo releases new versions.
|
This repository provides a package which can output the USB UEFI Update ISO. This will be updated as Lenovo releases new versions.
|
||||||
|
|
38
flake.lock
generated
38
flake.lock
generated
|
@ -5,11 +5,11 @@
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1725234343,
|
"lastModified": 1719994518,
|
||||||
"narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=",
|
"narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "567b938d64d4b4112ee253b9274472dc3a346eb6",
|
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -18,30 +18,13 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"linux-jhovold": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1728631036,
|
|
||||||
"narHash": "sha256-1LnClVjY6WS+IR9eqPFA7gzXm0cio3mY23NXj9cKHHs=",
|
|
||||||
"owner": "jhovold",
|
|
||||||
"repo": "linux",
|
|
||||||
"rev": "6a97bc22fa36010400b91e6d5979741c391112c3",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "jhovold",
|
|
||||||
"ref": "wip/sc8280xp-6.12-rc2",
|
|
||||||
"repo": "linux",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1725432240,
|
"lastModified": 1722062969,
|
||||||
"narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=",
|
"narHash": "sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "ad416d066ca1222956472ab7d0555a6946746a80",
|
"rev": "b73c2221a46c13557b1b3be9c2070cc42cf01eb3",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -53,20 +36,19 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-lib": {
|
"nixpkgs-lib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1725233747,
|
"lastModified": 1719876945,
|
||||||
"narHash": "sha256-Ss8QWLXdr2JCBPcYChJhz4xJm+h/xjl4G0c0XlP6a74=",
|
"narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
|
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
|
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"linux-jhovold": "linux-jhovold",
|
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
16
flake.nix
16
flake.nix
|
@ -2,9 +2,6 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
|
|
||||||
linux-jhovold.url = "github:jhovold/linux/wip/sc8280xp-6.12-rc2";
|
|
||||||
linux-jhovold.flake = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
|
@ -24,7 +21,7 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
devShells = rec {
|
devShells = rec {
|
||||||
default = pkgs.mkShellNoCC { packages = ci.nativeBuildInputs; };
|
default = pkgs.mkShellNoCC { packages = [ pkgs.npins ] ++ ci.nativeBuildInputs; };
|
||||||
|
|
||||||
ci = pkgs.mkShellNoCC {
|
ci = pkgs.mkShellNoCC {
|
||||||
packages = [
|
packages = [
|
||||||
|
@ -39,16 +36,9 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
formatter = pkgs.nixfmt-rfc-style;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
flake.nixosModules.default = import ./module.nix {
|
flake.nixosModules.default = import ./module.nix { inherit dtbName; };
|
||||||
inherit dtbName;
|
|
||||||
|
|
||||||
# FIXME: don't hardcode this with the arch
|
|
||||||
x13sPackages = self.packages.aarch64-linux;
|
|
||||||
};
|
|
||||||
|
|
||||||
flake.nixosConfigurations = {
|
flake.nixosConfigurations = {
|
||||||
example = inputs.nixpkgs.lib.nixosSystem {
|
example = inputs.nixpkgs.lib.nixosSystem {
|
||||||
|
@ -59,7 +49,7 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
nixos-x13s.enable = true;
|
nixos-x13s.enable = true;
|
||||||
nixos-x13s.kernel = "jhovold"; # jhovold is default
|
nixos-x13s.kernel = "jhovold"; # jhovold is default, but mainline supported
|
||||||
|
|
||||||
# allow unfree firmware
|
# allow unfree firmware
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
35
module.nix
35
module.nix
|
@ -1,4 +1,4 @@
|
||||||
{ dtbName, x13sPackages }:
|
{ dtbName }:
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
@ -9,7 +9,12 @@
|
||||||
let
|
let
|
||||||
cfg = config.nixos-x13s;
|
cfg = config.nixos-x13s;
|
||||||
|
|
||||||
|
x13sPackages = import ./packages/default.nix { inherit lib pkgs; };
|
||||||
|
|
||||||
linuxPackages_x13s =
|
linuxPackages_x13s =
|
||||||
|
if cfg.kernel == "mainline" then
|
||||||
|
pkgs.linuxPackages_latest
|
||||||
|
else
|
||||||
pkgs.linuxPackagesFor (
|
pkgs.linuxPackagesFor (
|
||||||
if cfg.kernel == "jhovold" then x13sPackages.linux_jhovold else throw "Unsupported kernel"
|
if cfg.kernel == "jhovold" then x13sPackages.linux_jhovold else throw "Unsupported kernel"
|
||||||
);
|
);
|
||||||
|
@ -43,13 +48,21 @@ in
|
||||||
kernel = lib.mkOption {
|
kernel = lib.mkOption {
|
||||||
type = lib.types.enum [
|
type = lib.types.enum [
|
||||||
"jhovold"
|
"jhovold"
|
||||||
|
"mainline"
|
||||||
];
|
];
|
||||||
description = "Which patched kernel to use. jhovold is the latest RC or release with some x13s specific patches.";
|
description = "Which patched kernel to use. jhovold is the latest RC or release with some x13s specific patches, and mainline is nixos latest";
|
||||||
default = "jhovold";
|
default = "jhovold";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = false;
|
||||||
|
message = "adamcstephens/nixos-x13s is no longer maintained";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.efibootmgr ];
|
environment.systemPackages = [ pkgs.efibootmgr ];
|
||||||
|
|
||||||
hardware.enableAllFirmware = true;
|
hardware.enableAllFirmware = true;
|
||||||
|
@ -78,30 +91,30 @@ in
|
||||||
"clk_ignore_unused"
|
"clk_ignore_unused"
|
||||||
"pd_ignore_unused"
|
"pd_ignore_unused"
|
||||||
"arm64.nopauth"
|
"arm64.nopauth"
|
||||||
"regulator_ignore_unused" # allows for > 30 sec to load msm, at the potential cost of power
|
# "regulator_ignore_unused" # allows for > 30 sec to load msm, at the potential cost of power
|
||||||
];
|
];
|
||||||
|
|
||||||
initrd = {
|
initrd = {
|
||||||
kernelModules = [
|
kernelModules = [
|
||||||
"nvme"
|
"nvme"
|
||||||
"phy_qcom_qmp_pcie"
|
"phy-qcom-qmp-pcie"
|
||||||
"pcie_qcom"
|
"pcie-qcom"
|
||||||
|
|
||||||
"i2c_core"
|
"i2c-core"
|
||||||
"i2c_hid"
|
"i2c-hid"
|
||||||
"i2c_hid-of"
|
"i2c-hid-of"
|
||||||
"i2c_qcom-geni"
|
"i2c-qcom-geni"
|
||||||
|
|
||||||
"leds_qcom_lpg"
|
"leds_qcom_lpg"
|
||||||
"pwm_bl"
|
"pwm_bl"
|
||||||
"qrtr"
|
"qrtr"
|
||||||
"pmic_glink_altmode"
|
"pmic_glink_altmode"
|
||||||
"gpio_sbu_mux"
|
"gpio_sbu_mux"
|
||||||
"phy_qcom_qmp_combo"
|
"phy-qcom-qmp-combo"
|
||||||
"gpucc_sc8280xp"
|
"gpucc_sc8280xp"
|
||||||
"dispcc_sc8280xp"
|
"dispcc_sc8280xp"
|
||||||
"phy_qcom_edp"
|
"phy_qcom_edp"
|
||||||
"panel_edp"
|
"panel-edp"
|
||||||
"msm"
|
"msm"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
47
npins/default.nix
Normal file
47
npins/default.nix
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
# Generated by npins. Do not modify; will be overwritten regularly
|
||||||
|
let
|
||||||
|
data = builtins.fromJSON (builtins.readFile ./sources.json);
|
||||||
|
version = data.version;
|
||||||
|
|
||||||
|
mkSource = spec:
|
||||||
|
assert spec ? type; let
|
||||||
|
path =
|
||||||
|
if spec.type == "Git" then mkGitSource spec
|
||||||
|
else if spec.type == "GitRelease" then mkGitSource spec
|
||||||
|
else if spec.type == "PyPi" then mkPyPiSource spec
|
||||||
|
else if spec.type == "Channel" then mkChannelSource spec
|
||||||
|
else builtins.throw "Unknown source type ${spec.type}";
|
||||||
|
in
|
||||||
|
spec // { outPath = path; };
|
||||||
|
|
||||||
|
mkGitSource = { repository, revision, url ? null, hash, ... }:
|
||||||
|
assert repository ? type;
|
||||||
|
# At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository
|
||||||
|
# In the latter case, there we will always be an url to the tarball
|
||||||
|
if url != null then
|
||||||
|
(builtins.fetchTarball {
|
||||||
|
inherit url;
|
||||||
|
sha256 = hash; # FIXME: check nix version & use SRI hashes
|
||||||
|
})
|
||||||
|
else assert repository.type == "Git"; builtins.fetchGit {
|
||||||
|
url = repository.url;
|
||||||
|
rev = revision;
|
||||||
|
# hash = hash;
|
||||||
|
};
|
||||||
|
|
||||||
|
mkPyPiSource = { url, hash, ... }:
|
||||||
|
builtins.fetchurl {
|
||||||
|
inherit url;
|
||||||
|
sha256 = hash;
|
||||||
|
};
|
||||||
|
|
||||||
|
mkChannelSource = { url, hash, ... }:
|
||||||
|
builtins.fetchTarball {
|
||||||
|
inherit url;
|
||||||
|
sha256 = hash;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
if version == 3 then
|
||||||
|
builtins.mapAttrs (_: mkSource) data.pins
|
||||||
|
else
|
||||||
|
throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`"
|
17
npins/sources.json
Normal file
17
npins/sources.json
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"pins": {
|
||||||
|
"linux-jhovold": {
|
||||||
|
"type": "Git",
|
||||||
|
"repository": {
|
||||||
|
"type": "GitHub",
|
||||||
|
"owner": "jhovold",
|
||||||
|
"repo": "linux"
|
||||||
|
},
|
||||||
|
"branch": "wip/sc8280xp-6.11-rc1",
|
||||||
|
"revision": "9c6b81022b9c277d65c68e25f4cfd52f33ef8f28",
|
||||||
|
"url": "https://github.com/jhovold/linux/archive/9c6b81022b9c277d65c68e25f4cfd52f33ef8f28.tar.gz",
|
||||||
|
"hash": "13c6r67iy8y750f8zpals4l941lshxx3w3ar1ss9dizsqjsghdsr"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"version": 3
|
||||||
|
}
|
|
@ -1,10 +1,6 @@
|
||||||
{
|
{ lib, pkgs, ... }:
|
||||||
inputs,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
|
sources = import ../npins;
|
||||||
|
|
||||||
linux_x13s_pkg =
|
linux_x13s_pkg =
|
||||||
{ version, buildLinux, ... }@args:
|
{ version, buildLinux, ... }@args:
|
||||||
|
@ -13,20 +9,15 @@ let
|
||||||
// {
|
// {
|
||||||
modDirVersion = version;
|
modDirVersion = version;
|
||||||
|
|
||||||
structuredExtraConfig = with lib.kernel; {
|
kernelPatches = (args.kernelPatches or [ ]) ++ [ ];
|
||||||
MODULE_COMPRESS = yes;
|
|
||||||
MODULE_COMPRESS_ALL = yes;
|
|
||||||
MODULE_COMPRESS_XZ = yes;
|
|
||||||
};
|
|
||||||
|
|
||||||
extraMeta.branch = lib.versions.majorMinor version;
|
extraMeta.branch = lib.versions.majorMinor version;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
linux_jhovold = pkgs.callPackage linux_x13s_pkg {
|
linux_jhovold = pkgs.callPackage linux_x13s_pkg {
|
||||||
src = inputs.linux-jhovold;
|
src = sources.linux-jhovold;
|
||||||
version = "6.12.0-rc2";
|
version = "6.11.0-rc1";
|
||||||
defconfig = "johan_defconfig";
|
defconfig = "johan_defconfig";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
{
|
{ lib, withSystem, ... }:
|
||||||
inputs,
|
|
||||||
lib,
|
|
||||||
withSystem,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
{
|
||||||
perSystem =
|
perSystem =
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
@ -15,6 +10,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
flake.packages.aarch64-linux = withSystem "aarch64-linux" (
|
flake.packages.aarch64-linux = withSystem "aarch64-linux" (
|
||||||
{ pkgs, ... }: import ./default.nix { inherit inputs lib pkgs; }
|
{ pkgs, ... }: import ./default.nix { inherit lib pkgs; }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
55
update.py
Executable file
55
update.py
Executable file
|
@ -0,0 +1,55 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
from github import Github
|
||||||
|
import sys
|
||||||
|
import re
|
||||||
|
from packaging.version import Version
|
||||||
|
from subprocess import run
|
||||||
|
|
||||||
|
latest_version: str = "0"
|
||||||
|
latest_branch: str = ""
|
||||||
|
previous_version: str = ""
|
||||||
|
|
||||||
|
with Github() as gh:
|
||||||
|
for branch in gh.get_user("jhovold").get_repo("linux").get_branches():
|
||||||
|
v = re.match("wip/sc8280xp-((v?6.[0-9]+)(-rc[0-9]+)?)", branch.name)
|
||||||
|
if v != None and Version(v.group(1)) > Version(latest_version):
|
||||||
|
# add .0 to version
|
||||||
|
latest_version = f"{v.group(2)}.0{v.group(3) or ''}"
|
||||||
|
latest_branch = v.group(0)
|
||||||
|
|
||||||
|
print("branch: " + latest_branch)
|
||||||
|
print("latest: " + latest_version)
|
||||||
|
|
||||||
|
with open("packages/default.nix", "r") as f:
|
||||||
|
lines = f.readlines()
|
||||||
|
|
||||||
|
for line in lines:
|
||||||
|
v = re.match(r'^\s*version = "(6[.0-9-rc]+)";.*$', line)
|
||||||
|
if v != None:
|
||||||
|
previous_version = v.group(1)
|
||||||
|
|
||||||
|
print("previous: " + previous_version)
|
||||||
|
|
||||||
|
if previous_version == latest_version:
|
||||||
|
print("No update found, exiting.")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
with open("packages/default.nix", "w") as f:
|
||||||
|
for line in lines:
|
||||||
|
f.write(
|
||||||
|
re.sub(
|
||||||
|
r'^(\s*version = ")6[.0-9-rc]+(";.*$)',
|
||||||
|
rf"\g<1>{latest_version}\2",
|
||||||
|
line,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
run(
|
||||||
|
f"npins add --name linux-jhovold github --branch {latest_branch} jhovold linux".split(
|
||||||
|
" "
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
run("git add npins/ packages/default.nix".split(" "))
|
||||||
|
run(["git", "commit", "-m", f"jhovold: {previous_version} -> {latest_version}"])
|
Loading…
Add table
Add a link
Reference in a new issue