New modules/ai/diwan.nix: pulls in the diwan flake's package, requires ai.pi and ai.herdr (diwan's real runtime dependencies, not optional extras), and exposes notesDir (DIWAN_NOTES_DIR, required) / cadence (systemd OnCalendar, default hourly) / user (default the host's primary user) as options, wiring a systemd.timer + oneshot systemd.service that runs 'diwan tick'. diwan.url is a temporary path: input (see the flake.nix TODO) -- switch to a real git remote before deploying to any host that isn't this one. Verified via nix eval against an extended thingvellir config: pi/herdr get force-enabled, cadence flows through to OnCalendar, notesDir flows through to the service environment and WorkingDirectory, ExecStart resolves to the real built diwan package.
100 lines
3.2 KiB
Nix
100 lines
3.2 KiB
Nix
{
|
|
description = "System configuration for all machines in samfélag";
|
|
|
|
inputs = {
|
|
|
|
# - Nixpkgs ----------------------------------
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
|
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
|
|
|
# - Home Manager -----------------------------
|
|
home-manager.url = "github:nix-community/home-manager/release-26.05";
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
# - Agenix -----------------------------------
|
|
agenix.url = "github:ryantm/agenix";
|
|
agenix.inputs.nixpkgs.follows = "nixpkgs";
|
|
# optionally choose not to download darwin deps (saves some resources on Linux)
|
|
# agenix.inputs.darwin.follows = "";
|
|
|
|
# - NUR --------------------------------------
|
|
nur.url = "github:nix-community/NUR";
|
|
|
|
# - Overlays ---------------------------------
|
|
emacs-overlay.url = "github:nix-community/emacs-overlay";
|
|
|
|
# - Themeing ---------------------------------
|
|
nix-colors.url = "github:misterio77/nix-colors";
|
|
|
|
# - Hyprland ---------------------------------
|
|
# hyprland.url = "github:hyprwm/Hyprland";
|
|
# hyprland-plugins = {
|
|
# url = "github:hyprwm/hyprland-plugins";
|
|
# inputs.hyprland.follows = "hyprland";
|
|
# };
|
|
# hy3 = {
|
|
# url = "github:outfoxxed/hy3";
|
|
# inputs.hyprland.follows = "hyprland";
|
|
# };
|
|
hyprcursor-rose-pine.url = "github:ndom91/rose-pine-hyprcursor";
|
|
|
|
# - More stuff -------------------------------
|
|
zen-browser.url = "github:youwen5/zen-browser-flake";
|
|
|
|
# - Herdr -------------------------------------
|
|
herdr.url = "github:herdrdev/herdr";
|
|
|
|
# - Diwan -------------------------------------
|
|
# TODO: switch to a real git remote (e.g. git.samfelag.xyz) once diwan
|
|
# is pushed there -- a local path: input only resolves on whatever
|
|
# machine evaluates this flake, which breaks on hosts (like thingvellir)
|
|
# that clone and build samfelag themselves.
|
|
diwan.url = "path:/home/marc/projects/diwan";
|
|
diwan.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
outputs = inputs @ { self, nixpkgs, home-manager, ... }:
|
|
let
|
|
system = "x86_64-linux";
|
|
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
config.allowUnfree = true;
|
|
overlays = import ./overlays { inherit inputs; };
|
|
};
|
|
|
|
lib = nixpkgs.lib.extend
|
|
(self: super: { my = import ./lib { inherit pkgs inputs; lib = self; }; });
|
|
|
|
mkHost = hostPath: lib.nixosSystem {
|
|
inherit system;
|
|
inherit pkgs;
|
|
specialArgs = { inherit lib inputs system; };
|
|
modules = [
|
|
hostPath
|
|
{
|
|
imports =
|
|
[
|
|
inputs.home-manager.nixosModules.home-manager
|
|
inputs.nix-colors.homeManagerModule
|
|
# Agenix
|
|
inputs.agenix.nixosModules.default
|
|
{
|
|
environment.systemPackages = [
|
|
inputs.agenix.packages.${system}.default
|
|
pkgs.age
|
|
];
|
|
}
|
|
]
|
|
# All my personal modules
|
|
++ (lib.my.mapModulesRec' (toString ./modules) import);
|
|
}
|
|
];
|
|
};
|
|
|
|
in {
|
|
nixosConfigurations = lib.my.mapModules ./hosts mkHost;
|
|
};
|
|
}
|