Skip to content

Commit 815c60d

Browse files
committed
feat(home-manager): enable news display and CLI
- Set news.display to show - Add home-manager package for CLI access to news - Persist news state and generations under impermanence - Add homeConfigurations output for standalone news CLI - Create symlink so CLI can find the flake config
1 parent b63ba67 commit 815c60d

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

flake.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,21 @@
129129
extraModules = [./system/amd ./system/btrfs];
130130
};
131131

132+
# Minimal home-manager standalone configuration for `home-manager news` CLI only
133+
# Actual home-manager is managed via NixOS module (see nixosConfigurations above)
134+
homeConfigurations.farlion = home-manager.lib.homeManagerConfiguration {
135+
pkgs = nixpkgs.legacyPackages.x86_64-linux;
136+
modules = [
137+
{
138+
home = {
139+
username = "farlion";
140+
homeDirectory = "/home/farlion";
141+
stateVersion = "24.11";
142+
};
143+
}
144+
];
145+
};
146+
132147
# Expose profiling helper as a package and an app
133148
# Call with `nix run .#nh-eval-profile -- <HOST>`
134149
packages.x86_64-linux.nh-eval-profile = let

home/default.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ in {
157157
target = "nixos-config";
158158
};
159159

160+
# Symlink flake for `home-manager news` CLI to find homeConfigurations
161+
file.".config/home-manager/flake.nix" = {
162+
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/code/nixos-config/flake.nix";
163+
};
164+
160165
packages = with pkgs; [
161166
alejandra # Nix Formatter
162167
ast-grep # Pure Magic
@@ -181,6 +186,7 @@ in {
181186
google-chrome
182187
gucharmap # Unicode Character Map
183188
hardinfo2 # Hardware/System Info
189+
home-manager # CLI for managing home-manager, needed for `home-manager news`
184190
httpie
185191
iftop # Net top tool, see also nethogs
186192
imagemagick

home/impermanence/default.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
".cache/nix"
88
".config/helm" # Helm repositories
99
".config/nix" # cachix repositories and such
10+
".local/share/home-manager" # home-manager news read state
1011
".local/share/nix" # Nix Repl History
12+
".local/state/home-manager" # home-manager generations and GC roots
1113
];
1214
};
1315
}

0 commit comments

Comments
 (0)