From 72273b90284f2c43136aafd5c2db0c9edccb75db Mon Sep 17 00:00:00 2001 From: Michael Schneider <94642227+m1-s@users.noreply.github.com> Date: Thu, 22 Feb 2024 22:52:30 +0700 Subject: [PATCH 1/2] bump home-manager and nixpkgs to 23.11 (#71) --- example/flake.nix | 4 ++-- flake.lock | 16 ++++++++-------- flake.nix | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/example/flake.nix b/example/flake.nix index 159e67f9..6be26169 100644 --- a/example/flake.nix +++ b/example/flake.nix @@ -2,9 +2,9 @@ description = "Plasma Manager Example"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; - home-manager.url = "github:nix-community/home-manager/release-22.05"; + home-manager.url = "github:nix-community/home-manager/release-23.11"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; plasma-manager.url = "github:pjones/plasma-manager"; diff --git a/flake.lock b/flake.lock index 09768945..af915a56 100644 --- a/flake.lock +++ b/flake.lock @@ -7,32 +7,32 @@ ] }, "locked": { - "lastModified": 1667907331, - "narHash": "sha256-bHkAwkYlBjkupPUFcQjimNS8gxWSWjOTevEuwdnp5m0=", + "lastModified": 1706981411, + "narHash": "sha256-cLbLPTL1CDmETVh4p0nQtvoF+FSEjsnJTFpTxhXywhQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "6639e3a837fc5deb6f99554072789724997bc8e5", + "rev": "652fda4ca6dafeb090943422c34ae9145787af37", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-22.05", + "ref": "release-23.11", "repo": "home-manager", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1685573264, - "narHash": "sha256-Zffu01pONhs/pqH07cjlF10NnMDLok8ix5Uk4rhOnZQ=", + "lastModified": 1708294118, + "narHash": "sha256-evZzmLW7qoHXf76VCepvun1esZDxHfVRFUJtumD7L2M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "380be19fbd2d9079f677978361792cb25e8a3635", + "rev": "e0da498ad77ac8909a980f07eff060862417ccf7", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-22.05", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index f9e3057c..39bffdee 100644 --- a/flake.nix +++ b/flake.nix @@ -2,9 +2,9 @@ description = "Manage KDE Plasma with Home Manager"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; - home-manager.url = "github:nix-community/home-manager/release-22.05"; + home-manager.url = "github:nix-community/home-manager/release-23.11"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; }; From 02a9761ac6b692eba60a73c1196d205d24300de7 Mon Sep 17 00:00:00 2001 From: Michael Schneider <94642227+m1-s@users.noreply.github.com> Date: Fri, 23 Feb 2024 20:07:24 +0700 Subject: [PATCH 2/2] add github CI (#70) --- .github/workflows/ci.yml | 17 +++++++++++++++++ .gitignore | 4 +++- example/home.nix | 2 +- script/write_config.py | 4 ++-- 4 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..7212f3c7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,17 @@ +name: "Check" +on: + pull_request: +# cancel previous runs when pushing new changes +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true +jobs: + checks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v22 + with: + extra_nix_config: "system-features = kvm nixos-test" + - run: nix flake check -L --keep-going + - run: nix flake check -L --keep-going ./example diff --git a/.gitignore b/.gitignore index 0309149a..7c9dbce9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -/example/result +result-* +result +.direnv diff --git a/example/home.nix b/example/home.nix index cbeeb4c9..2f28e07a 100644 --- a/example/home.nix +++ b/example/home.nix @@ -1,4 +1,4 @@ -{ ... }: +{ pkgs, ... }: { programs.plasma = { enable = true; diff --git a/script/write_config.py b/script/write_config.py index 00af7062..b4dbb225 100644 --- a/script/write_config.py +++ b/script/write_config.py @@ -3,7 +3,7 @@ import os import re import sys -from typing import Dict +from typing import Dict, Optional class KConfParser: @@ -89,7 +89,7 @@ def save(self): f.write(f"{self.key_value_to_line(key, value)}\n") @staticmethod - def get_key_value(line: str) -> tuple[str, str | None]: + def get_key_value(line: str) -> tuple[str, Optional[str]]: line_splitted = line.split("=", 1) key = line_splitted[0].strip() value = line_splitted[1].strip() if len(line_splitted) > 1 else None