diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f3789cb..ef320c5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,6 +23,18 @@ jobs: # Make sure that the templates at least build after initialized # TODO: Ideally, we want to let `omnix` run these tests # https://github.com/juspay/omnix/issues/282 + - name: home-manager test + run: | + CONF=${{ runner.temp }}/home-manager && mkdir $CONF + om init .#home -o $CONF \ + --non-interactive \ + --params '{"username": "srid", "git-name": "Srid", "git-email": "srid@srid.ca", "neovim": true}' + set -x + nix build ${CONF}#homeConfigurations.srid.activationPackage + ls -l ./result/home-path/bin/git + ls -l ./result/home-path/bin/nvim + ls -l ./result/home-files/.config/git/config + - name: NixOS test if: matrix.system == 'x86_64-linux' run: | @@ -44,8 +56,3 @@ jobs: set -x nix build ${CONF}#darwinConfigurations.example.config.system.build.toplevel type -f ./result/etc/profiles/per-user/srid/bin/git - - # TODO: Use `om init` like above - - name: activate-test - if: matrix.system == 'x86_64-linux' - run: nix run .#test-home-manager-config diff --git a/modules/flake-parts/test.nix b/modules/flake-parts/test.nix deleted file mode 100644 index fab1892..0000000 --- a/modules/flake-parts/test.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - perSystem = { pkgs, ... }: { - # Run activation test - # FIXME: This is failing on darwin; https://github.com/nix-community/home-manager/issues/4413 - apps.test-home-manager-config = { - meta.description = "Test home configuration activation by running for dummy user and home"; - program = pkgs.writeShellApplication { - name = "test-home-activation"; - runtimeInputs = with pkgs; [ - git - findutils - gnugrep - ]; - # FIXME: This should use `{{ runner.temp }}` from ci.yaml - text = '' - set -x - # Override the home directory to a temp location - echo '{ home.homeDirectory = "/tmp/runner"; }' > modules/home/test.nix - WORKDIR=$(pwd) - git add modules/home/test.nix - trap 'git -C $WORKDIR rm -f modules/home/test.nix' EXIT - - # Activate on a temp location - rm -rf /tmp/runner - USER=runner HOME=/tmp/runner \ - nix run .#activate 'runner@' - - # List the intresting contents of the activated home - find -L /tmp/runner/ | \ - grep -v \.cache | grep -v /share/ | grep -v /lib/ | grep -v /libexec/ | grep -v /.local/state - - # Run some tests - cd /tmp/runner - test -f .nix-profile/bin/git - ''; - }; - }; - }; -}