diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7212f3c --- /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 0309149..7c9dbce 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -/example/result +result-* +result +.direnv diff --git a/example/home.nix b/example/home.nix index cbeeb4c..2f28e07 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 00af706..b4dbb22 100644 --- a/script/write_config.py +++ b/script/write_config.py @@ -3,7 +3,7 @@ import json import os import re import sys -from typing import Dict +from typing import Dict, Optional class KConfParser: @@ -89,7 +89,7 @@ class KConfParser: 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