diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 0000000..c8c2126 --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,57 @@ +name: Docs + +on: + push: + branches: + - main + +jobs: + build: + name: Build + + permissions: + contents: read + + runs-on: ubuntu-latest + + steps: + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + extra-conf: | + extra-experimental-features = nix-command flakes + + - name: Set up cache + uses: DeterminateSystems/magic-nix-cache-action@main + + - name: Build docs + run: nix -L build github:${{ github.repository }}/${{ github.sha }}#docs + + - name: Prepare docs for upload + run: cp -r --dereference --no-preserve=mode,ownership result/ public/ + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: public/ + + deploy: + name: Deploy + + needs: build + + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + + steps: + - name: Deploy docs to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/base/common_hardware.nix b/base/common_hardware.nix index 5b6b64c..4f3378c 100644 --- a/base/common_hardware.nix +++ b/base/common_hardware.nix @@ -24,7 +24,8 @@ in plymouth = { enable = true; }; - kernelPackages = config.conf.kernel; + #kernelPackages = config.conf.kernel; + kernelPackages = pkgs.linuxPackages_latest; initrd = { verbose = false; availableKernelModules = [ diff --git a/docs/default.nix b/docs/default.nix new file mode 100644 index 0000000..cae6795 --- /dev/null +++ b/docs/default.nix @@ -0,0 +1,17 @@ +{ pkgs, build_systems, ... }: + +let + makeOptionsDoc = configuration: pkgs.nixosOptionsDoc { inherit (configuration) options lib; }; + example = makeOptionsDoc (build_systems [ "example" ] ../example/.)."example"; +in +pkgs.stdenvNoCC.mkDerivation { + name = "dashNix-book"; + src = ./.; + + patchPhase = '' + sed '/*Declared by:*/,/^$/d' <${example.optionsCommonMark} >> src/dashNix.md + ''; + buildPhase = '' + ${pkgs.mdbook}/bin/mdbook build --dest-dir $out + ''; +} diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/src/dashNix.md b/docs/src/dashNix.md new file mode 100755 index 0000000..9f581fd --- /dev/null +++ b/docs/src/dashNix.md @@ -0,0 +1 @@ +pingpang diff --git a/flake.nix b/flake.nix index c0b027a..c87e619 100644 --- a/flake.nix +++ b/flake.nix @@ -66,8 +66,12 @@ }; }; in - { + rec { dashNixLib = import ./lib { inherit inputs pkgs; }; + docs = import ./docs { + inherit inputs pkgs; + build_systems = dashNixLib.build_systems; + }; dashNixInputs = inputs; stablePkgs = stable; unstablePkgs = pkgs; diff --git a/modules/conf.nix b/modules/conf.nix index 65e7ded..3ed8442 100644 --- a/modules/conf.nix +++ b/modules/conf.nix @@ -93,14 +93,14 @@ }; }; - kernel = lib.mkOption { - default = pkgs.linuxPackages_latest; - example = pkgs.linuxPackages_xanmod_latest; - type = with lib.types; nullOr attrs; - description = '' - kernel to be used - ''; - }; + #kernel = lib.mkOption { + # default = pkgs.linuxPackages_latest; + # example = pkgs.linuxPackages_xanmod_latest; + # type = with lib.types; nullOr attrs; + # description = '' + # kernel to be used + # ''; + #}; hostname = lib.mkOption { default = "nixos"; @@ -203,9 +203,9 @@ config = { - conf.kernel = lib.mkIf ( - config.mods.gaming.enable && config.mods.gaming.kernel - ) pkgs.linuxPackages_xanmod_latest; + # conf.kernel = lib.mkIf ( + # config.mods.gaming.enable && config.mods.gaming.kernel + # ) pkgs.linuxPackages_xanmod_latest; } // (lib.optionalAttrs (options ? system.stateVersion) { system.stateVersion = config.conf.systemStateVersion; diff --git a/modules/programs/base_packages.nix b/modules/programs/base_packages.nix index 554d7ef..f0eb012 100644 --- a/modules/programs/base_packages.nix +++ b/modules/programs/base_packages.nix @@ -20,7 +20,7 @@ additional_packages = lib.mkOption { default = [ ]; example = [ pkgs.openssl ]; - type = with lib.types; listOf packages; + type = with lib.types; listOf package; description = '' Additional packages to install. Note that these are installed even if base packages is disabled, e.g. you can also use this as the only packages to install. diff --git a/modules/programs/git.nix b/modules/programs/git.nix index e1bf3c5..22688f0 100644 --- a/modules/programs/git.nix +++ b/modules/programs/git.nix @@ -22,12 +22,12 @@ ssh_config = lib.mkOption { default = '' Host github.com - ${if (config.sops.secrets ? hub.path) then "IdentityFile ${config.sops.secrets.hub.path}" else ""} + ${if (config ? sops.secrets ? hub.path) then "IdentityFile ${config.sops.secrets.hub.path}" else ""} Host gitlab.com - ${if (config.sops.secrets ? lab.path) then "IdentityFile ${config.sops.secrets.lab.path}" else ""} + ${if (config ? sops.secrets ? lab.path) then "IdentityFile ${config.sops.secrets.lab.path}" else ""} Host dashie.org ${ - if (config.sops.secrets ? dashie.path) then + if (config ? sops.secrets ? dashie.path) then "IdentityFile ${config.sops.secrets.dashie.path}" else "" diff --git a/result b/result new file mode 120000 index 0000000..a4e896e --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/hpbdpm0knf560f4igq5yc6c6nvap7s65-dashNix-book \ No newline at end of file