feat: add a home-manager example configuration
All checks were successful
/ check-fmt (push) Successful in 3s
/ build-package (audiomenu) (push) Successful in 1s
/ build-package (docs) (push) Successful in 1s
/ build-package (docs-home-markdown) (push) Successful in 1s
/ build-package (docs-nixos-markdown) (push) Successful in 1s
/ build-package (docs-nvim-markdown) (push) Successful in 1s
/ build-package (jpassmenu) (push) Successful in 1s
/ build-package (nvim) (push) Successful in 1s
/ build-package (nvim-headless) (push) Successful in 1s
/ build-package (nvim-no-lsps) (push) Successful in 1s
/ build-package (nvim-no-ts) (push) Successful in 1s
/ build-package (nvim-small) (push) Successful in 1s
/ build-package (search) (push) Successful in 1s
/ check-nvim (nvim) (push) Successful in 6s
/ check-nvim (nvim-headless) (push) Successful in 3s
/ check-nvim (nvim-no-lsps) (push) Successful in 5s
/ check-nvim (nvim-no-ts) (push) Successful in 6s
/ check-nvim (nvim-small) (push) Successful in 5s
/ build-vm (push) Successful in 2s
/ build-hm (push) Successful in 14s
/ report-size (push) Successful in 4s
All checks were successful
/ check-fmt (push) Successful in 3s
/ build-package (audiomenu) (push) Successful in 1s
/ build-package (docs) (push) Successful in 1s
/ build-package (docs-home-markdown) (push) Successful in 1s
/ build-package (docs-nixos-markdown) (push) Successful in 1s
/ build-package (docs-nvim-markdown) (push) Successful in 1s
/ build-package (jpassmenu) (push) Successful in 1s
/ build-package (nvim) (push) Successful in 1s
/ build-package (nvim-headless) (push) Successful in 1s
/ build-package (nvim-no-lsps) (push) Successful in 1s
/ build-package (nvim-no-ts) (push) Successful in 1s
/ build-package (nvim-small) (push) Successful in 1s
/ build-package (search) (push) Successful in 1s
/ check-nvim (nvim) (push) Successful in 6s
/ check-nvim (nvim-headless) (push) Successful in 3s
/ check-nvim (nvim-no-lsps) (push) Successful in 5s
/ check-nvim (nvim-no-ts) (push) Successful in 6s
/ check-nvim (nvim-small) (push) Successful in 5s
/ build-vm (push) Successful in 2s
/ build-hm (push) Successful in 14s
/ report-size (push) Successful in 4s
This adds a home-manager example configuration to ensure the home-manager standalone module works properly.
This commit is contained in:
parent
a6ab19d528
commit
d4afb26bd1
5 changed files with 116 additions and 19 deletions
|
@ -66,10 +66,22 @@ jobs:
|
|||
- name: Build VM configuration
|
||||
run: |
|
||||
nix build --print-build-logs '.#nixosConfigurations.vm.config.system.build.toplevel'
|
||||
build-hm:
|
||||
runs-on: nixos
|
||||
needs:
|
||||
- build-package
|
||||
- check-nvim
|
||||
steps:
|
||||
- uses: "https://git.salame.cl/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" # v4
|
||||
- run: nix --version
|
||||
- name: Build Home Manager configuration
|
||||
run: |
|
||||
nix build --print-build-logs '.#homeConfigurations.example.activationPackage'
|
||||
report-size:
|
||||
runs-on: nixos
|
||||
needs:
|
||||
- build-vm
|
||||
- build-hm
|
||||
steps:
|
||||
- uses: "https://git.salame.cl/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" # v4
|
||||
- run: nix --version
|
||||
|
|
70
example-hm/home.nix
Normal file
70
example-hm/home.nix
Normal file
|
@ -0,0 +1,70 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home = {
|
||||
homeDirectory = "/home/jdoe";
|
||||
stateVersion = "25.05";
|
||||
username = "jdoe";
|
||||
};
|
||||
|
||||
jhome = {
|
||||
enable = true;
|
||||
dev = {
|
||||
enable = true;
|
||||
neovimAsManPager = true;
|
||||
rust.enable = true;
|
||||
};
|
||||
gui.enable = false;
|
||||
hostName = "example";
|
||||
user = {
|
||||
enable = true;
|
||||
defaultIdentity = {
|
||||
email = "jdoe@example.org";
|
||||
name = "John Doe";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
# Switch to fish if bash is started interactively
|
||||
bash.initExtra = ''
|
||||
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
|
||||
then
|
||||
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
|
||||
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
|
||||
fi
|
||||
'';
|
||||
|
||||
# Enable zellij (tmux like terminal session manager)
|
||||
zellij.enable = lib.mkForce true;
|
||||
};
|
||||
|
||||
nix = {
|
||||
package = pkgs.lix;
|
||||
gc = {
|
||||
automatic = true;
|
||||
frequency = "weekly";
|
||||
options = "--delete-older-than 30d";
|
||||
# run between 0 and 45min after boot if run was missed
|
||||
randomizedDelaySec = "45min";
|
||||
};
|
||||
settings = {
|
||||
# Add my personal binary cache to the mix (only for personal computers)
|
||||
extra-substituters = [ "https://cache.salame.cl" ];
|
||||
extra-trusted-public-keys = [ "cache.salame.cl:D+pBaoutwxja7qKGpju+CmM1LRbVmf2gqEQ/9c7qHrw=" ];
|
||||
auto-optimise-store = true;
|
||||
};
|
||||
};
|
||||
|
||||
stylix = {
|
||||
image = config.jhome.gui.sway.background;
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml";
|
||||
};
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
./devshells.nix
|
||||
./docs.nix
|
||||
./example-vm.nix
|
||||
./example-configs.nix
|
||||
./nixos-modules.nix
|
||||
./home-modules.nix
|
||||
./nixvim-modules.nix
|
||||
|
|
33
flake-modules/example-configs.nix
Normal file
33
flake-modules/example-configs.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{ inputs, lib, ... }:
|
||||
{
|
||||
flake = {
|
||||
# Example vm configuration
|
||||
nixosConfigurations.vm = lib.nixosSystem {
|
||||
modules = [
|
||||
inputs.self.nixosModules.default
|
||||
../example-vm # import vm configuration
|
||||
{
|
||||
nixpkgs = {
|
||||
overlays = builtins.attrValues inputs.self.overlays;
|
||||
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "steam-unwrapped" ];
|
||||
};
|
||||
# pin nixpkgs to the one used by the system
|
||||
nix.registry.nixpkgs.flake = inputs.nixpkgs;
|
||||
}
|
||||
];
|
||||
};
|
||||
homeConfigurations.example = inputs.home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
|
||||
modules = [
|
||||
inputs.self.homeModules.standalone
|
||||
../example-hm/home.nix # import home-manager configuration
|
||||
{
|
||||
nixpkgs.overlays = [
|
||||
inputs.self.overlays.unstable
|
||||
inputs.lix-module.overlays.default
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
{ inputs, lib, ... }:
|
||||
{
|
||||
# Example vm configuration
|
||||
flake.nixosConfigurations.vm = lib.nixosSystem {
|
||||
modules = [
|
||||
inputs.self.nixosModules.default
|
||||
../example-vm # import vm configuration
|
||||
{
|
||||
nixpkgs = {
|
||||
overlays = builtins.attrValues inputs.self.overlays;
|
||||
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "steam-unwrapped" ];
|
||||
};
|
||||
# pin nixpkgs to the one used by the system
|
||||
nix.registry.nixpkgs.flake = inputs.nixpkgs;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue