Compare commits

..

18 Commits

Author SHA1 Message Date
c4510abf88 refactor: simplify apps.colmena 2026-02-24 15:00:45 +01:00
0c4cdd2d1e feat: add golang module to work host 2026-02-24 14:47:27 +01:00
c1418e1402 chore: update lockfile 2026-02-24 14:47:27 +01:00
ab59c50520 fix: add wrapper util for home manager modules 2026-02-24 14:47:27 +01:00
624a56e948 fix: remove pnpm bash config 2026-02-24 14:47:27 +01:00
fb269c0265 fix: update 'work' host modules 2026-02-24 14:47:27 +01:00
2a07ecef61 feat: add 'nodejs' module (and use on 'work' host) 2026-02-24 14:47:27 +01:00
aa830fc795 feat: set up 'opencode' on work host 2026-02-24 14:47:27 +01:00
227a4fe53d feat: add 'vscode' module to work host 2026-02-24 14:47:27 +01:00
99dfe10ebf fix: add pdf support to pandoc module 2026-02-24 14:47:27 +01:00
c002741419 fix: remove default packages 2026-02-23 19:35:24 +01:00
448b3e5ef0 feat: set up 'tlp' for laptop mode on 'astyanax' 2026-02-23 18:15:19 +01:00
fafadf4034 feat: add notifier plugin to opencode 2026-02-23 18:11:29 +01:00
a5845fb847 fix :resolve 'andromache' syntax error 2026-02-23 18:11:24 +01:00
757d5e5c81 feat: set up 'storage' module 2026-02-22 16:43:15 +01:00
7b13880be2 fix: resolve nix build warnings 2026-02-22 16:40:20 +01:00
b895e85953 chore: disable syncthing module 2026-02-22 16:22:55 +01:00
ee3b95d986 fix: remove 'nix.settings' from 'hecuba' host 2026-02-22 16:20:52 +01:00
25 changed files with 189 additions and 110 deletions

View File

@@ -17,7 +17,7 @@ in
inputs.colmena.lib.makeHive { inputs.colmena.lib.makeHive {
meta = { meta = {
nixpkgs = import inputs.nixpkgs { nixpkgs = import inputs.nixpkgs {
system = "x86_64-linux"; localSystem = "x86_64-linux";
}; };
nodeNixpkgs = builtins.mapAttrs (_: v: v.pkgs) self.nixosConfigurations; nodeNixpkgs = builtins.mapAttrs (_: v: v.pkgs) self.nixosConfigurations;

View File

@@ -103,13 +103,6 @@ if [[ -z "${SSH_CONNECTION}" ]]; then
fi fi
# }}} # }}}
# pnpm
export PNPM_HOME="/home/h/.local/share/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end
# Codi # Codi
# Usage: codi [filetype] [filename] # Usage: codi [filetype] [filename]

30
flake.lock generated
View File

@@ -121,11 +121,11 @@
}, },
"locked": { "locked": {
"dir": "pkgs/firefox-addons", "dir": "pkgs/firefox-addons",
"lastModified": 1771669320, "lastModified": 1771732978,
"narHash": "sha256-LqmgIBpjpMQKkHKCSGJkluMVFFoBdkUhJnu+Cq+jgGc=", "narHash": "sha256-o7gZh/eXFkEEmzwlBdIbgCJhmdlqQhOhVjudqgsIefg=",
"owner": "rycee", "owner": "rycee",
"repo": "nur-expressions", "repo": "nur-expressions",
"rev": "496abb3aef244b896bf7cdd65e071cf624f16338", "rev": "18226106e18bc40cce99d436ee741a946f1888f6",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@@ -284,11 +284,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1770726378, "lastModified": 1771857445,
"narHash": "sha256-kck+vIbGOaM/dHea7aTBxdFYpeUl/jHOy5W3eyRvVx8=", "narHash": "sha256-NCrhxU9wq5+4jQG1fvRbyTnH8GSbH6LovreVoH2fOL4=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "5eaaedde414f6eb1aea8b8525c466dc37bba95ae", "rev": "3d7a52f678227930ab089f5d9b384f2d50f7d534",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -344,11 +344,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1771683283, "lastModified": 1771851181,
"narHash": "sha256-WxAEkAbo8dP7qiyPM6VN4ZGAxfuBVlNBNPkrqkrXVEc=", "narHash": "sha256-gFgE6mGUftwseV3DUENMb0k0EiHd739lZexPo5O/sdQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "c6ed3eab64d23520bcbb858aa53fe2b533725d4a", "rev": "9a4b494b1aa1b93d8edf167f46dc8e0c0011280c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -667,11 +667,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1771524872, "lastModified": 1771735105,
"narHash": "sha256-eksVUcUsfS9mQx4D9DrYu88u9w70bAf+n6KmTDuIGEE=", "narHash": "sha256-MJuVJeszZEziquykEHh/hmgIHYxUcuoG/1aowpLiSeU=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "e85540ffe97322dc1fea14dd11cdc2f59d540ac7", "rev": "d7755d820f5fa8acf7f223309c33e25d4f92e74f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -717,11 +717,11 @@
"tinted-zed": "tinted-zed" "tinted-zed": "tinted-zed"
}, },
"locked": { "locked": {
"lastModified": 1771626923, "lastModified": 1771787992,
"narHash": "sha256-Mn6oeKrY+Sw6kH0jK+hp5QQH4MTcqwBRQL/ScZDNcz8=", "narHash": "sha256-Vg4bGwwenNYI8p3nJTl9FRyeIyrjATeZrZr+GyUSDrw=",
"owner": "danth", "owner": "danth",
"repo": "stylix", "repo": "stylix",
"rev": "b09847414b50c65788936199918272377f70fb91", "rev": "30054cca073b49b42a71289edec858f535b27fe9",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -77,8 +77,10 @@
(lib.genAttrs hostDirNames ( (lib.genAttrs hostDirNames (
host: host:
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
system = import ./hosts/${host}/system.nix; modules = [
modules = [ ./hosts/${host} ]; ./hosts/${host}
{ nixpkgs.hostPlatform = import ./hosts/${host}/system.nix; }
];
specialArgs = { specialArgs = {
inherit inputs outputs dotsPath; inherit inputs outputs dotsPath;
}; };
@@ -86,14 +88,12 @@
)) ))
// { // {
sd-image-orange-pi-aarch64 = nixpkgs.lib.nixosSystem { sd-image-orange-pi-aarch64 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ modules = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
./images/sd-image-orange-pi-aarch64.nix ./images/sd-image-orange-pi-aarch64.nix
{ {
nixpkgs.crossSystem = { nixpkgs.buildPlatform = "x86_64-linux";
system = "aarch64-linux"; nixpkgs.hostPlatform = "aarch64-linux";
};
} }
]; ];
specialArgs = { specialArgs = {
@@ -101,14 +101,12 @@
}; };
}; };
sd-image-raspberry-pi-aarch64 = nixpkgs.lib.nixosSystem { sd-image-raspberry-pi-aarch64 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ modules = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
./images/sd-image-raspberry-pi-aarch64.nix ./images/sd-image-raspberry-pi-aarch64.nix
{ {
nixpkgs.crossSystem = { nixpkgs.buildPlatform = "x86_64-linux";
system = "aarch64-linux"; nixpkgs.hostPlatform = "aarch64-linux";
};
} }
]; ];
specialArgs = { specialArgs = {
@@ -131,7 +129,8 @@
}; };
apps.${system}.colmena = inputs.colmena.apps.${system}.default; apps.${system}.colmena = inputs.colmena.apps.${system}.default;
colmenaHive = import ./deploy/colmena.nix {
colmena = import ./deploy/colmena.nix {
inherit inherit
self self
inputs inputs
@@ -142,9 +141,11 @@
formatter.${system} = gitHooks.formatter; formatter.${system} = gitHooks.formatter;
devShells.${system} = gitHooks.devShells; devShells.${system} = gitHooks.devShells;
images.sd-image-orange-pi-aarch64 = legacyPackages.${system} = {
sd-image-orange-pi-aarch64 =
self.nixosConfigurations.sd-image-orange-pi-aarch64.config.system.build.sdImage; self.nixosConfigurations.sd-image-orange-pi-aarch64.config.system.build.sdImage;
images.sd-image-raspberry-pi-aarch64 = sd-image-raspberry-pi-aarch64 =
self.nixosConfigurations.sd-image-raspberry-pi-aarch64.config.system.build.sdImage; self.nixosConfigurations.sd-image-raspberry-pi-aarch64.config.system.build.sdImage;
}; };
};
} }

View File

@@ -10,7 +10,10 @@ let
pre-commit-check = git-hooks.lib.${system}.run { pre-commit-check = git-hooks.lib.${system}.run {
inherit src; inherit src;
hooks = { hooks = {
nixfmt.enable = true; nixfmt = {
enable = true;
package = pkgs.nixfmt;
};
statix.enable = true; statix.enable = true;
deadnix.enable = true; deadnix.enable = true;
}; };

View File

@@ -8,13 +8,10 @@ with pkgs;
fzf fzf
htop htop
jq jq
nixfmt-rfc-style
nmap nmap
nodejs_24
nvimpager nvimpager
parallel parallel
pass pass
pnpm
ripgrep ripgrep
silver-searcher silver-searcher
sops sops

View File

@@ -13,14 +13,15 @@ in
inputs.sops-nix.homeManagerModules.sops inputs.sops-nix.homeManagerModules.sops
../../modules ../../modules
../../modules/stylix.nix ../../modules/stylix.nix
../../modules/lib.nix
../../modules/ai-tools.nix ../../modules/ai-tools.nix
../../modules/cloud ../../modules/cloud
../../modules/comms ../../modules/comms
../../modules/desktop/niri
../../modules/dconf.nix ../../modules/dconf.nix
../../modules/direnv ../../modules/direnv
../../modules/docker ../../modules/docker
../../modules/git ../../modules/git
../../modules/go
../../modules/k8s ../../modules/k8s
../../modules/k8s/k9s.nix ../../modules/k8s/k9s.nix
../../modules/keepassxc.nix ../../modules/keepassxc.nix
@@ -30,8 +31,11 @@ in
../../modules/browser ../../modules/browser
../../modules/shell ../../modules/shell
../../modules/music ../../modules/music
../../modules/nodejs.nix
../../modules/taskwarrior.nix ../../modules/taskwarrior.nix
../../modules/bruno.nix ../../modules/bruno.nix
../../modules/pandoc.nix
../../modules/vscode.nix
]; ];
sops = { sops = {
@@ -44,15 +48,30 @@ in
taskwarrior_sync_encryption_secret = { }; taskwarrior_sync_encryption_secret = { };
anki_sync_user = { }; anki_sync_user = { };
anki_sync_key = { }; anki_sync_key = { };
opencode_api_key = { };
}; };
templates."taskrc.d/sync" = { templates = {
"taskrc.d/sync" = {
content = '' content = ''
sync.server.url=${config.sops.placeholder.taskwarrior_sync_server_url} sync.server.url=${config.sops.placeholder.taskwarrior_sync_server_url}
sync.server.client_id=${config.sops.placeholder.taskwarrior_sync_server_client_id} sync.server.client_id=${config.sops.placeholder.taskwarrior_sync_server_client_id}
sync.encryption_secret=${config.sops.placeholder.taskwarrior_sync_encryption_secret} sync.encryption_secret=${config.sops.placeholder.taskwarrior_sync_encryption_secret}
''; '';
}; };
"opencode/auth.json" = {
path = "${config.home.homeDirectory}/.local/share/opencode/auth.json";
content = ''
{
"zai-coding-plan": {
"type": "api",
"key": "${config.sops.placeholder.opencode_api_key}"
}
}
'';
};
};
}; };
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
@@ -73,7 +92,10 @@ in
cloud.azure.enable = true; cloud.azure.enable = true;
comms.signal.enable = true; comms.signal.enable = true;
comms.teams.enable = true; comms.teams.enable = true;
ai-tools.claude-code.enable = true; ai-tools = {
claude-code.enable = true;
opencode.enable = true;
};
github.enable = true; github.enable = true;
gitlab.enable = true; gitlab.enable = true;
pandoc.enable = true; pandoc.enable = true;

View File

@@ -82,6 +82,7 @@ in
"~/.config/sops/age/keys.txt" = "deny"; "~/.config/sops/age/keys.txt" = "deny";
}; };
}; };
plugin = [ "@mohak34/opencode-notifier@latest" ];
}; };
}) })
]; ];

View File

@@ -26,7 +26,7 @@ in
}; };
extensions = { extensions = {
force = true; force = true;
packages = with inputs.firefox-addons.packages.${pkgs.system}; [ packages = with inputs.firefox-addons.packages.${pkgs.stdenv.hostPlatform.system}; [
duckduckgo-privacy-essentials duckduckgo-privacy-essentials
firefox-color firefox-color
istilldontcareaboutcookies istilldontcareaboutcookies

View File

@@ -1,19 +1,7 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let
needsNixGL = config.lib ? nixGL;
bruno =
if needsNixGL then
pkgs.bruno.overrideAttrs (old: {
postInstall = (old.postInstall or "") + ''
wrapProgram $out/bin/bruno --add-flags "--no-sandbox"
'';
})
else
pkgs.bruno;
in
{ {
config = { config = {
home.packages = [ (config.nixgl.wrap bruno) ]; home.packages = [ (config.nixgl.wrap (config.wrapApp pkgs.bruno "--no-sandbox")) ];
}; };
} }

View File

@@ -4,8 +4,9 @@
pkgs, pkgs,
... ...
}: }:
{ {
config = lib.mkIf config.comms.signal.enable { config = lib.mkIf config.comms.signal.enable {
home.packages = [ (config.nixgl.wrap pkgs.signal-desktop) ]; home.packages = [ (config.nixgl.wrap (config.wrapApp pkgs.signal-desktop "--no-sandbox")) ];
}; };
} }

View File

@@ -7,6 +7,6 @@
{ {
config = lib.mkIf config.comms.teams.enable { config = lib.mkIf config.comms.teams.enable {
home.packages = [ (config.nixgl.wrap pkgs.teams-for-linux) ]; home.packages = [ (config.nixgl.wrap (config.wrapApp pkgs.teams-for-linux "--no-sandbox")) ];
}; };
} }

View File

@@ -6,4 +6,19 @@
default = if config.lib ? nixGL then config.lib.nixGL.wrap else lib.id; default = if config.lib ? nixGL then config.lib.nixGL.wrap else lib.id;
readOnly = true; readOnly = true;
}; };
options.wrapApp = lib.mkOption {
type = lib.types.raw;
default =
pkg: flags:
if config.lib ? nixGL then
pkg.overrideAttrs (old: {
postInstall = (old.postInstall or "") + ''
wrapProgram $out/bin/${pkg.meta.mainProgram} --add-flags "${flags}"
'';
})
else
pkg;
readOnly = true;
};
} }

View File

@@ -0,0 +1,18 @@
{
config,
lib,
pkgs,
...
}:
{
options.go = {
enable = lib.mkEnableOption "go language";
};
config = lib.mkIf config.go.enable {
home.packages = with pkgs; [
go
gopls
];
};
}

26
home/modules/nodejs.nix Normal file
View File

@@ -0,0 +1,26 @@
{
config,
lib,
pkgs,
...
}:
{
options.nodejs = {
enable = lib.mkEnableOption "nodejs (and related packages)";
package = lib.mkOption {
type = lib.types.package;
default = pkgs.nodejs_24;
};
};
config = lib.mkIf config.nodejs.enable {
home.packages = with pkgs; [
config.nodejs.package
pnpm
yarn
biome
tsx
];
};
}

View File

@@ -3,7 +3,7 @@
{ {
config = { config = {
home.packages = [ home.packages = [
inputs.nvim.packages.${pkgs.system}.nvim inputs.nvim.packages.${pkgs.stdenv.hostPlatform.system}.nvim
]; ];
}; };
} }

View File

@@ -1,20 +1,19 @@
{ {
lib,
config, config,
lib,
pkgs, pkgs,
... ...
}: }:
let
cfg = config.pandoc;
in
{ {
options.pandoc.enable = lib.mkEnableOption "pandoc with crossref"; options.pandoc = {
enable = lib.mkEnableOption "pandoc";
};
config = lib.mkIf cfg.enable { config = lib.mkIf config.pandoc.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
pandoc
haskellPackages.pandoc-crossref haskellPackages.pandoc-crossref
pandoc
texliveSmall
]; ];
}; };
} }

7
home/modules/vscode.nix Normal file
View File

@@ -0,0 +1,7 @@
{ config, pkgs, ... }:
{
config = {
home.packages = [ (config.nixgl.wrap (config.wrapApp pkgs.vscode "--disable-gpu-sandbox")) ];
};
}

View File

@@ -5,6 +5,7 @@
pkgs, pkgs,
... ...
}: }:
let let
username = "h"; username = "h";
hostName = "andromache"; hostName = "andromache";
@@ -35,6 +36,7 @@ in
../../modules/localization ../../modules/localization
../../modules/fonts ../../modules/fonts
../../modules/ssh/hardened-openssh.nix ../../modules/ssh/hardened-openssh.nix
../../modules/storage
../../modules/stylix ../../modules/stylix
(import ../../modules/secrets { inherit lib inputs config; }) (import ../../modules/secrets { inherit lib inputs config; })
../../modules/docker ../../modules/docker
@@ -86,7 +88,7 @@ in
boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
environment.systemPackages = [ environment.systemPackages = [
inputs.colmena.packages.${pkgs.system}.colmena inputs.colmena.packages.${pkgs.stdenv.hostPlatform.system}.colmena
]; ];
services = { services = {
@@ -99,8 +101,7 @@ in
enable = true; enable = true;
harden = true; harden = true;
}; };
};
my.syncthing.enable = true;
networking = { networking = {
# TODO: generate unique hostId on actual host with: head -c 8 /etc/machine-id # TODO: generate unique hostId on actual host with: head -c 8 /etc/machine-id

View File

@@ -35,10 +35,10 @@ in
../../modules/localization ../../modules/localization
../../modules/fonts ../../modules/fonts
../../modules/ssh/hardened-openssh.nix ../../modules/ssh/hardened-openssh.nix
../../modules/storage
../../modules/stylix ../../modules/stylix
(import ../../modules/secrets { inherit lib inputs config; }) (import ../../modules/secrets { inherit lib inputs config; })
../../modules/docker ../../modules/docker
../../modules/syncthing
../../modules/nfc ../../modules/nfc
]; ];
@@ -81,7 +81,7 @@ in
}; };
environment.systemPackages = [ environment.systemPackages = [
inputs.colmena.packages.${pkgs.system}.colmena inputs.colmena.packages.${pkgs.stdenv.hostPlatform.system}.colmena
(pkgs.writeShellApplication { (pkgs.writeShellApplication {
name = "wol-andromache"; name = "wol-andromache";
runtimeInputs = [ pkgs.wakeonlan ]; runtimeInputs = [ pkgs.wakeonlan ];
@@ -108,7 +108,20 @@ in
enable = true; enable = true;
package = pkgs.plocate; package = pkgs.plocate;
}; };
}; tlp = {
enable = true;
settings = {
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
my.syncthing.enable = true; CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 20;
};
};
};
} }

View File

@@ -83,15 +83,4 @@ in
enable = true; enable = true;
harden = true; harden = true;
}; };
nix.settings = {
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"astyanax:JY2qJkZUFSax47R3c1nq53AZ8GnLfNqz6mSnJ60cLZ4="
"andromache:XM4VLrEw63RB/3v/56OxzH/Yw+kKXKMBLKCb7UGAXzo="
];
auto-optimise-store = true;
keep-derivations = false;
keep-outputs = false;
};
} }

View File

@@ -25,6 +25,7 @@ in
../../modules/x ../../modules/x
../../modules/fonts ../../modules/fonts
../../modules/ssh/hardened-openssh.nix ../../modules/ssh/hardened-openssh.nix
../../modules/storage
(import ../../modules/secrets { (import ../../modules/secrets {
inherit lib inputs config; inherit lib inputs config;
}) })

View File

@@ -31,7 +31,7 @@ in
hardware.enableRedistributableFirmware = true; hardware.enableRedistributableFirmware = true;
hardware.pulseaudio.enable = true; services.pulseaudio.enable = true;
networking.wireless.enable = true; networking.wireless.enable = true;

View File

@@ -22,22 +22,6 @@ in
config = { config = {
system.stateVersion = "25.05"; system.stateVersion = "25.05";
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nixpkgs.config.allowUnfreePredicate =
pkg: builtins.elem (lib.getName pkg) config.nixpkgs.allowedUnfree;
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs outputs dotsPath;
};
};
nix = { nix = {
optimise = { optimise = {
automatic = true; automatic = true;
@@ -48,6 +32,10 @@ in
dates = "weekly"; dates = "weekly";
options = "--delete-older-than 30d"; options = "--delete-older-than 30d";
}; };
settings.experimental-features = [
"nix-command"
"flakes"
];
}; };
system.autoUpgrade = { system.autoUpgrade = {
@@ -62,5 +50,18 @@ in
randomizedDelaySec = "45min"; randomizedDelaySec = "45min";
allowReboot = false; allowReboot = false;
}; };
nixpkgs.config.allowUnfreePredicate =
pkg: builtins.elem (lib.getName pkg) config.nixpkgs.allowedUnfree;
environment.defaultPackages = lib.mkForce [ ];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs outputs dotsPath;
};
};
}; };
} }

View File

@@ -0,0 +1,3 @@
{
services.udisks2.enable = true;
}