diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index ace1c5cc..6c09e253 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -34,6 +34,17 @@ jobs: with: persist-credentials: false + # TODO: Lock this Action to a release tag once commit [1] ("fix: relocate + # TMPDIR to /mnt to improve Nix installer compatibility") is part of a + # release, resolving [2] ("does not work with cachix install nix action"). + # + # [1]: https://github.com/wimpysworld/nothing-but-nix/pull/25 + # [2]: https://github.com/wimpysworld/nothing-but-nix/issues/24 + - uses: wimpysworld/nothing-but-nix@10c936d9e46521bf923f75458e0cbd4fa309300d # yamllint disable-line rule:line-length + if: runner.os == 'Linux' + with: + hatchet-protocol: holster + - uses: cachix/install-nix-action@v31 - uses: cachix/cachix-action@v16 diff --git a/modules/bat/testbeds/bat.nix b/modules/bat/testbeds/bat.nix index 79f5446f..b7b0f17f 100644 --- a/modules/bat/testbeds/bat.nix +++ b/modules/bat/testbeds/bat.nix @@ -4,17 +4,7 @@ let in { environment = { - loginShellInit = "${lib.getExe package} example.md"; + loginShellInit = "${lib.getExe package} flake-parts/flake.nix"; systemPackages = [ package ]; }; - home-manager.sharedModules = [ - { - home.file."example.md" = { - source = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/sharkdp/bat/refs/heads/master/tests/syntax-tests/source/Markdown/example.md"; - hash = "sha256-VYYwgRFY1c2DPY7yGM8oF3zG4rtEpBWyqfPwmGZIkcA="; - }; - }; - } - ]; } diff --git a/modules/emacs/testbeds/emacs.nix b/modules/emacs/testbeds/emacs.nix index 22433683..6693970c 100644 --- a/modules/emacs/testbeds/emacs.nix +++ b/modules/emacs/testbeds/emacs.nix @@ -1,17 +1,11 @@ { lib, pkgs, ... }: -let - package = pkgs.emacs; -in { - stylix.testbed.ui.application = { - name = "emacs"; - inherit package; - }; + stylix.testbed.ui.command.text = "emacs flake-parts/flake.nix"; home-manager.sharedModules = lib.singleton { programs.emacs = { enable = true; - inherit package; + package = pkgs.emacs; }; }; } diff --git a/modules/gedit/testbeds/gedit.nix b/modules/gedit/testbeds/gedit.nix index 34979d48..3d988d60 100644 --- a/modules/gedit/testbeds/gedit.nix +++ b/modules/gedit/testbeds/gedit.nix @@ -1,12 +1,5 @@ { pkgs, ... }: -let - package = pkgs.gedit; -in { - stylix.testbed.ui.application = { - name = "org.gnome.gedit"; - inherit package; - }; - - environment.systemPackages = [ package ]; + stylix.testbed.ui.command.text = "gedit flake-parts/flake.nix"; + environment.systemPackages = [ pkgs.gedit ]; } diff --git a/modules/gnome-text-editor/testbeds/gnome-text-editor.nix b/modules/gnome-text-editor/testbeds/gnome-text-editor.nix index 7950740e..2022e2b2 100644 --- a/modules/gnome-text-editor/testbeds/gnome-text-editor.nix +++ b/modules/gnome-text-editor/testbeds/gnome-text-editor.nix @@ -1,12 +1,5 @@ { pkgs, ... }: -let - package = pkgs.gnome-text-editor; -in { - stylix.testbed.ui.application = { - name = "org.gnome.TextEditor"; - inherit package; - }; - - environment.systemPackages = [ package ]; + stylix.testbed.ui.command.text = "gnome-text-editor flake-parts/flake.nix"; + environment.systemPackages = [ pkgs.gnome-text-editor ]; } diff --git a/modules/micro/testbeds/micro.nix b/modules/micro/testbeds/micro.nix index 7f5ad445..5a722290 100644 --- a/modules/micro/testbeds/micro.nix +++ b/modules/micro/testbeds/micro.nix @@ -1,17 +1,11 @@ { lib, pkgs, ... }: { stylix.testbed.ui.command = { - text = "${lib.getExe pkgs.micro} example.md"; + text = "${lib.getExe pkgs.micro} flake-parts/flake.nix"; useTerminal = true; }; home-manager.sharedModules = lib.singleton { programs.micro.enable = true; - home.file."example.md" = { - source = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/sharkdp/bat/e2aa4bc33cca785cab8bdadffc58a4a30b245854/tests/syntax-tests/source/Markdown/example.md"; - hash = "sha256-VYYwgRFY1c2DPY7yGM8oF3zG4rtEpBWyqfPwmGZIkcA="; - }; - }; }; } diff --git a/modules/neovim/testbeds/neovide.nix b/modules/neovim/testbeds/neovide.nix index aee8acfd..bbbabc6b 100644 --- a/modules/neovim/testbeds/neovide.nix +++ b/modules/neovim/testbeds/neovide.nix @@ -1,18 +1,12 @@ { lib, pkgs, ... }: -let - package = pkgs.neovide; -in { - stylix.testbed.ui.application = { - name = "neovide"; - inherit package; - }; + stylix.testbed.ui.command.text = "neovide flake-parts/flake.nix"; home-manager.sharedModules = lib.singleton { programs = { neovide = { enable = true; - inherit package; + package = pkgs.neovide; }; neovim.enable = true; }; diff --git a/modules/neovim/testbeds/neovim.nix b/modules/neovim/testbeds/neovim.nix index cd741d5f..823f1db7 100644 --- a/modules/neovim/testbeds/neovim.nix +++ b/modules/neovim/testbeds/neovim.nix @@ -1,17 +1,11 @@ -{ lib, pkgs, ... }: +{ lib, ... }: { stylix.testbed.ui.command = { - text = "nvim example.md"; + text = "nvim flake-parts/flake.nix"; useTerminal = true; }; home-manager.sharedModules = lib.singleton { programs.neovim.enable = true; - home.file."example.md" = { - source = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/sharkdp/bat/e2aa4bc33cca785cab8bdadffc58a4a30b245854/tests/syntax-tests/source/Markdown/example.md"; - hash = "sha256-VYYwgRFY1c2DPY7yGM8oF3zG4rtEpBWyqfPwmGZIkcA="; - }; - }; }; } diff --git a/modules/neovim/testbeds/nixvim.nix b/modules/neovim/testbeds/nixvim.nix index 9294bb02..adc2364a 100644 --- a/modules/neovim/testbeds/nixvim.nix +++ b/modules/neovim/testbeds/nixvim.nix @@ -1,18 +1,8 @@ -{ lib, pkgs, ... }: { stylix.testbed.ui.command = { - text = "nvim example.md"; + text = "nvim flake-parts/flake.nix"; useTerminal = true; }; programs.nixvim.enable = true; - - home-manager.sharedModules = lib.singleton { - home.file."example.md" = { - source = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/sharkdp/bat/refs/heads/master/tests/syntax-tests/source/Markdown/example.md"; - hash = "sha256-VYYwgRFY1c2DPY7yGM8oF3zG4rtEpBWyqfPwmGZIkcA="; - }; - }; - }; } diff --git a/modules/neovim/testbeds/nvf.nix b/modules/neovim/testbeds/nvf.nix index 5e6b6efc..9bfd5e74 100644 --- a/modules/neovim/testbeds/nvf.nix +++ b/modules/neovim/testbeds/nvf.nix @@ -1,18 +1,8 @@ -{ lib, pkgs, ... }: { stylix.testbed.ui.command = { - text = "nvim example.md"; + text = "nvim flake-parts/flake.nix"; useTerminal = true; }; programs.nvf.enable = true; - - home-manager.sharedModules = lib.singleton { - home.file."example.md" = { - source = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/sharkdp/bat/refs/heads/master/tests/syntax-tests/source/Markdown/example.md"; - hash = "sha256-VYYwgRFY1c2DPY7yGM8oF3zG4rtEpBWyqfPwmGZIkcA="; - }; - }; - }; } diff --git a/modules/neovim/testbeds/vim.nix b/modules/neovim/testbeds/vim.nix index 745b218b..3bc44930 100644 --- a/modules/neovim/testbeds/vim.nix +++ b/modules/neovim/testbeds/vim.nix @@ -1,17 +1,11 @@ { lib, pkgs, ... }: { stylix.testbed.ui.command = { - text = "${lib.getExe pkgs.vim} example.md"; + text = "${lib.getExe pkgs.vim} flake-parts/flake.nix"; useTerminal = true; }; home-manager.sharedModules = lib.singleton { programs.vim.enable = true; - home.file."example.md" = { - source = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/sharkdp/bat/e2aa4bc33cca785cab8bdadffc58a4a30b245854/tests/syntax-tests/source/Markdown/example.md"; - hash = "sha256-VYYwgRFY1c2DPY7yGM8oF3zG4rtEpBWyqfPwmGZIkcA="; - }; - }; }; } diff --git a/modules/vscode/testbeds/vscode.nix b/modules/vscode/testbeds/vscode.nix index 6ba6593e..06308854 100644 --- a/modules/vscode/testbeds/vscode.nix +++ b/modules/vscode/testbeds/vscode.nix @@ -1,18 +1,13 @@ { lib, pkgs, ... }: -# We are using VSCodium because VSCode is an unfree package -let - package = pkgs.vscodium; -in { - stylix.testbed.ui.application = { - name = "codium"; - inherit package; - }; + stylix.testbed.ui.command.text = "codium flake-parts/flake.nix"; home-manager.sharedModules = lib.singleton { programs.vscode = { enable = true; - inherit package; + + # We are using VSCodium because VSCode is an unfree package + package = pkgs.vscodium; }; }; } diff --git a/modules/zed/testbeds/zed.nix b/modules/zed/testbeds/zed.nix index 37ee282c..6a31fd14 100644 --- a/modules/zed/testbeds/zed.nix +++ b/modules/zed/testbeds/zed.nix @@ -1,16 +1,10 @@ { lib, pkgs, ... }: { stylix.testbed.ui.command = { - text = "${lib.getExe pkgs.zed-editor} example.md"; + text = "${lib.getExe pkgs.zed-editor} flake-parts/flake.nix"; }; home-manager.sharedModules = lib.singleton { programs.zed-editor.enable = true; - home.file."example.md" = { - source = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/sharkdp/bat/e2aa4bc33cca785cab8bdadffc58a4a30b245854/tests/syntax-tests/source/Rust/output.rs"; - hash = "sha256-vpUndD6H1oJfYVDai4LpVpsW6SSGbK466t3IKENZ1ow="; - }; - }; }; } diff --git a/stylix/testbed/default.nix b/stylix/testbed/default.nix index da52f7b6..9053dde2 100644 --- a/stylix/testbed/default.nix +++ b/stylix/testbed/default.nix @@ -14,6 +14,7 @@ let modules = [ + (lib.modules.importApply ./modules/flake-parts.nix inputs) ./modules/common.nix ./modules/enable.nix ./modules/application.nix diff --git a/stylix/testbed/modules/flake-parts.nix b/stylix/testbed/modules/flake-parts.nix new file mode 100644 index 00000000..b821eaca --- /dev/null +++ b/stylix/testbed/modules/flake-parts.nix @@ -0,0 +1,7 @@ +inputs: +{ lib, ... }: +{ + home-manager.sharedModules = lib.singleton { + home.file.flake-parts.source = inputs.flake-parts; + }; +}