2023-01-11 20:22:35 +00:00
|
|
|
{ pkgs, lib, config, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
imports = [
|
2023-01-21 20:08:05 +00:00
|
|
|
./git.nix
|
2024-10-26 00:39:35 +01:00
|
|
|
./neovim.nix
|
2023-01-11 20:22:35 +00:00
|
|
|
./tmux/default.nix
|
|
|
|
];
|
|
|
|
|
2024-04-27 12:45:03 +01:00
|
|
|
options.custom.home.defaults = lib.mkEnableOption "home";
|
|
|
|
|
|
|
|
config = lib.mkIf config.custom.home.defaults {
|
home-manager: pass through nixos stateVersion if >24.05
home-manager currently has a pinned stateVersion on all hosts, even though many
of the hosts were initialised after that point. Create a condition such that
any hosts initialised after 24.05 (the latest currently host) will use that
version in home-manager instead of pinning to 22.11.
Any future users can pass the stateVersion through without the `if`.
Test plan:
```
# system.stateVersion = "23.11";
$ nix eval '.#nixosConfigurations."boron.cx.ts.hillion.co.uk".config.home-manager.users.root.home.stateVersion'
"22.11"
```
```
# system.stateVersion = "24.05";
$ nix eval '.#nixosConfigurations."phoenix.st.ts.hillion.co.uk".config.home-manager.users.root.home.stateVersion'
"22.11"
```
```
# system.stateVersion = "24.11"; // no-commit change
$ nix eval '.#nixosConfigurations."phoenix.st.ts.hillion.co.uk".config.home-manager.users.root.home.stateVersion'
nix eval '.#nixosConfigurations."phoenix.st.ts.hillion.co.uk".config.home-manager.users.root.home.stateVersion'
error:
...
(stack trace truncated; use '--show-trace' to show the full trace)
error: A definition for option `home-manager.users.root.home.stateVersion' is not of type `one of "18.09", "19.03", "19.09", "20.03", "20.09", "21.03", "21.05", "21.11", "22.05", "22.11", "23.05", "23.11", "24.05"'. Definition values:
- In `/nix/store/8dhsknmlnv571bg100j9v9yqq1nnh346-source/modules/home/default.nix': "24.11"
```
2024-10-26 19:12:52 +01:00
|
|
|
home-manager =
|
|
|
|
let
|
|
|
|
stateVersion = if (builtins.compareVersions config.system.stateVersion "24.05") > 0 then config.system.stateVersion else "22.11";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
users.root.home = {
|
|
|
|
inherit stateVersion;
|
2023-05-11 21:12:57 +01:00
|
|
|
|
home-manager: pass through nixos stateVersion if >24.05
home-manager currently has a pinned stateVersion on all hosts, even though many
of the hosts were initialised after that point. Create a condition such that
any hosts initialised after 24.05 (the latest currently host) will use that
version in home-manager instead of pinning to 22.11.
Any future users can pass the stateVersion through without the `if`.
Test plan:
```
# system.stateVersion = "23.11";
$ nix eval '.#nixosConfigurations."boron.cx.ts.hillion.co.uk".config.home-manager.users.root.home.stateVersion'
"22.11"
```
```
# system.stateVersion = "24.05";
$ nix eval '.#nixosConfigurations."phoenix.st.ts.hillion.co.uk".config.home-manager.users.root.home.stateVersion'
"22.11"
```
```
# system.stateVersion = "24.11"; // no-commit change
$ nix eval '.#nixosConfigurations."phoenix.st.ts.hillion.co.uk".config.home-manager.users.root.home.stateVersion'
nix eval '.#nixosConfigurations."phoenix.st.ts.hillion.co.uk".config.home-manager.users.root.home.stateVersion'
error:
...
(stack trace truncated; use '--show-trace' to show the full trace)
error: A definition for option `home-manager.users.root.home.stateVersion' is not of type `one of "18.09", "19.03", "19.09", "20.03", "20.09", "21.03", "21.05", "21.11", "22.05", "22.11", "23.05", "23.11", "24.05"'. Definition values:
- In `/nix/store/8dhsknmlnv571bg100j9v9yqq1nnh346-source/modules/home/default.nix': "24.11"
```
2024-10-26 19:12:52 +01:00
|
|
|
## Set an empty ZSH config and defer to the global one
|
|
|
|
file.".zshrc".text = "";
|
|
|
|
};
|
2023-05-11 21:12:57 +01:00
|
|
|
|
2024-10-31 21:59:07 +00:00
|
|
|
users."${config.custom.user}" = {
|
|
|
|
home = {
|
|
|
|
inherit stateVersion;
|
|
|
|
};
|
2023-05-11 21:12:57 +01:00
|
|
|
|
2024-10-31 21:59:07 +00:00
|
|
|
services = {
|
|
|
|
ssh-agent.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
programs = {
|
2024-10-31 22:38:16 +00:00
|
|
|
zoxide = {
|
|
|
|
enable = true;
|
|
|
|
options = [ "--cmd cd" ];
|
|
|
|
};
|
2024-10-31 21:59:07 +00:00
|
|
|
zsh.enable = true;
|
|
|
|
};
|
home-manager: pass through nixos stateVersion if >24.05
home-manager currently has a pinned stateVersion on all hosts, even though many
of the hosts were initialised after that point. Create a condition such that
any hosts initialised after 24.05 (the latest currently host) will use that
version in home-manager instead of pinning to 22.11.
Any future users can pass the stateVersion through without the `if`.
Test plan:
```
# system.stateVersion = "23.11";
$ nix eval '.#nixosConfigurations."boron.cx.ts.hillion.co.uk".config.home-manager.users.root.home.stateVersion'
"22.11"
```
```
# system.stateVersion = "24.05";
$ nix eval '.#nixosConfigurations."phoenix.st.ts.hillion.co.uk".config.home-manager.users.root.home.stateVersion'
"22.11"
```
```
# system.stateVersion = "24.11"; // no-commit change
$ nix eval '.#nixosConfigurations."phoenix.st.ts.hillion.co.uk".config.home-manager.users.root.home.stateVersion'
nix eval '.#nixosConfigurations."phoenix.st.ts.hillion.co.uk".config.home-manager.users.root.home.stateVersion'
error:
...
(stack trace truncated; use '--show-trace' to show the full trace)
error: A definition for option `home-manager.users.root.home.stateVersion' is not of type `one of "18.09", "19.03", "19.09", "20.03", "20.09", "21.03", "21.05", "21.11", "22.05", "22.11", "23.05", "23.11", "24.05"'. Definition values:
- In `/nix/store/8dhsknmlnv571bg100j9v9yqq1nnh346-source/modules/home/default.nix': "24.11"
```
2024-10-26 19:12:52 +01:00
|
|
|
};
|
2023-05-11 21:12:57 +01:00
|
|
|
};
|
2024-04-27 12:45:03 +01:00
|
|
|
|
|
|
|
# Delegation
|
|
|
|
custom.home.git.enable = true;
|
2024-10-26 00:39:35 +01:00
|
|
|
custom.home.neovim.enable = true;
|
2024-04-27 12:45:03 +01:00
|
|
|
custom.home.tmux.enable = true;
|
2023-05-11 21:12:57 +01:00
|
|
|
};
|
2023-01-11 20:22:35 +00:00
|
|
|
}
|