summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CLAUDE.md10
-rw-r--r--hosts/laptop/configuration.nix2
-rw-r--r--modules/common.nix1
-rw-r--r--modules/home/christian.nix137
-rw-r--r--modules/home/xmobar/xmobarrc27
5 files changed, 98 insertions, 79 deletions
diff --git a/CLAUDE.md b/CLAUDE.md
index 08ef55a..713c793 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -8,6 +8,13 @@ This is a NixOS flake-based configuration managing three machines: desktop, lapt
## Common Commands
+### Verify Changes (use this first)
+```bash
+dry-rebuild # Alias for: nix build ~/.config/nixos#nixosConfigurations.$(hostname).config.system.build.toplevel --no-link
+```
+
+**Always run `dry-rebuild` after making changes** to catch evaluation and build errors without needing sudo or activating the system. Claude Code cannot run `sudo`, so `dry-rebuild` is the required verification step.
+
### Rebuild System
```bash
rebuild # Alias for: sudo nixos-rebuild switch --flake ~/.config/nixos
@@ -164,5 +171,6 @@ in
3. **User-level modules** contain pure home-manager configuration
4. **Hardware configuration files** are auto-generated - do not manually edit
5. **Use unstable overlay** when you need bleeding-edge versions of specific packages
-6. **Test changes** with `nixos-rebuild switch` before committing
+6. **Verify changes** with `dry-rebuild` before committing
7. **Format code** with nixfmt before committing
+8. **Commit messages** should be a single short sentence — no body, no bullet points, no co-author line
diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix
index 62f573d..a95c60d 100644
--- a/hosts/laptop/configuration.nix
+++ b/hosts/laptop/configuration.nix
@@ -46,5 +46,7 @@
};
};
+ home-manager.users.christian.custom.xmobarBattery = true;
+
system.stateVersion = "25.11";
}
diff --git a/modules/common.nix b/modules/common.nix
index 3534c69..843a622 100644
--- a/modules/common.nix
+++ b/modules/common.nix
@@ -73,6 +73,7 @@
programs.bash.shellAliases = {
rebuild = "sudo nixos-rebuild switch --flake ~/.config/nixos";
+ dry-rebuild = "nix build ~/.config/nixos#nixosConfigurations.$(hostname).config.system.build.toplevel --no-link";
};
virtualisation.docker.enable = true;
diff --git a/modules/home/christian.nix b/modules/home/christian.nix
index a5af420..b3e6b77 100644
--- a/modules/home/christian.nix
+++ b/modules/home/christian.nix
@@ -2,72 +2,107 @@
config,
pkgs,
inputs,
+ lib,
...
}:
{
imports = [ ./nvim ];
- home.stateVersion = "25.11";
+ options.custom.xmobarBattery = lib.mkEnableOption "xmobar battery widget";
- home.packages = with pkgs; [
- (dmenu.override {
- conf = ./dmenu/config.h;
- })
- nixfmt
- ];
+ config = {
+ home.stateVersion = "25.11";
- programs.alacritty = {
- enable = true;
- settings = {
- font.size = 8;
+ home.packages = with pkgs; [
+ (dmenu.override {
+ conf = ./dmenu/config.h;
+ })
+ nixfmt
+ ];
+
+ programs.alacritty = {
+ enable = true;
+ settings = {
+ font.size = 8;
+ };
};
- };
- programs.bash.enable = true;
+ programs.bash.enable = true;
- programs.git = {
- enable = true;
- settings.user.name = "Christian";
- settings.user.email = "[email protected]";
- settings.init.defaultBranch = "main";
- };
+ programs.git = {
+ enable = true;
+ settings.user.name = "Christian";
+ settings.user.email = "[email protected]";
+ settings.init.defaultBranch = "main";
+ };
- programs.direnv = {
- enable = true;
- enableBashIntegration = true;
- nix-direnv.enable = true;
- silent = true;
- };
+ programs.direnv = {
+ enable = true;
+ enableBashIntegration = true;
+ nix-direnv.enable = true;
+ silent = true;
+ };
- programs.firefox = {
- enable = true;
- policies = {
- OverrideFirstRunPage = "";
- DisableFirefoxAccounts = true;
- FirefoxHome = {
- SponsoredTopSites = false;
- Stories = false;
+ programs.firefox = {
+ enable = true;
+ policies = {
+ OverrideFirstRunPage = "";
+ DisableFirefoxAccounts = true;
+ FirefoxHome = {
+ SponsoredTopSites = false;
+ Stories = false;
+ };
};
- };
- profiles.christian = {
- name = "Christian";
- isDefault = true;
- settings = {
- "browser.aboutConfig.showWarning" = false;
- "extensions.autoDisableScopes" = 0;
- "browser.theme.content-theme" = 0;
- "browser.theme.toolbar-theme" = 0;
+ profiles.christian = {
+ name = "Christian";
+ isDefault = true;
+ settings = {
+ "browser.aboutConfig.showWarning" = false;
+ "extensions.autoDisableScopes" = 0;
+ "browser.theme.content-theme" = 0;
+ "browser.theme.toolbar-theme" = 0;
+ };
+ extensions.packages = with inputs.nur.legacyPackages.x86_64-linux.repos.rycee.firefox-addons; [
+ ublock-origin
+ ];
};
- extensions.packages = with inputs.nur.legacyPackages.x86_64-linux.repos.rycee.firefox-addons; [
- ublock-origin
- ];
};
- };
- programs.xmobar = {
- enable = true;
- extraConfig = builtins.readFile ./xmobar/xmobarrc;
- };
+ programs.xmobar = {
+ enable = true;
+ extraConfig = ''
+ -- vim: set ft=haskell:
+ Config
+ { font = "Monospace"
+ , borderColor = "#d0d0d0"
+ , border = FullB
+ , borderWidth = 1
+ , bgColor = "#222"
+ , fgColor = "grey"
+ , position = TopH 30
+ , commands =
+ [ Run Cpu ["-t", "cpu: <fc=#4eb4fa><bar> <total>%</fc>"] 10
+ , Run Network "wlan0" ["-S", "True", "-t", "wlan: <fc=#4eb4fa><rx></fc>/<fc=#4eb4fa><tx></fc>"] 10
+ , Run Memory ["-t","mem: <fc=#4eb4fa><usedbar> <usedratio>%</fc>"] 10
+ , Run Date "date: <fc=#4eb4fa>%a %d %b %Y %I:%M:%S %p </fc>" "date" 10
+ ${lib.optionalString config.custom.xmobarBattery ''
+ , Run Battery
+ ["-t", "bat: <leftbar> <left> <watts>",
+ "-L", "10", "-H", "80", "-S", "True",
+ "-l", "red", "-n", "#4eb4fa", "-h", "green",
+ "--",
+ "-L", "-15", "-H", "-5",
+ "-l", "red", "-m", "#4eb4fa", "-h", "green"]
+ 600
+ ''}
+ ]
+ , sepChar = "%"
+ , alignSep = "}{"
+ , template = " ${lib.optionalString config.custom.xmobarBattery "%battery% | "}%cpu% | %memory% | %wlan0% }{%date% "
+ }
+ '';
+ };
- programs.home-manager.enable = true;
+ programs.home-manager.enable = true;
+ };
}
diff --git a/modules/home/xmobar/xmobarrc b/modules/home/xmobar/xmobarrc
deleted file mode 100644
index 39f78c6..0000000
--- a/modules/home/xmobar/xmobarrc
+++ /dev/null
@@ -1,27 +0,0 @@
--- vim: set ft=haskell:
-Config
- { font = "Monospace"
- , borderColor = "#d0d0d0"
- , border = FullB
- , borderWidth = 1
- , bgColor = "#222"
- , fgColor = "grey"
- , position = TopH 30
- , commands =
- [ Run Cpu ["-t", "cpu: <fc=#4eb4fa><bar> <total>%</fc>"] 10
- , Run Network "wlan0" ["-S", "True", "-t", "wlan: <fc=#4eb4fa><rx></fc>/<fc=#4eb4fa><tx></fc>"] 10
- , Run Memory ["-t","mem: <fc=#4eb4fa><usedbar> <usedratio>%</fc>"] 10
- , Run Date "date: <fc=#4eb4fa>%a %d %b %Y %I:%M:%S %p </fc>" "date" 10
- , Run Battery
- ["-t", "bat: <leftbar> <left> <watts>",
- "-L", "10", "-H", "80", "-S", "True",
- "-l", "red", "-n", "#4eb4fa", "-h", "green",
- "--",
- "-L", "-15", "-H", "-5",
- "-l", "red", "-m", "#4eb4fa", "-h", "green"]
- 600
- ]
- , sepChar = "%"
- , alignSep = "}{"
- , template = " %battery% | %cpu% | %memory% | %wlan0% }{%date% "
-}