dotnix/flake.nix

163 lines
4.7 KiB
Nix

{
description = "jolheiser's nixos config";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
jolheiser.url = "git+https://git.jolheiser.com/nixpkgs.git";
flake-utils.url = "github:numtide/flake-utils"; # Only expressed here to use for followers
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs = {
nixpkgs.follows = "nixpkgs";
darwin.follows = "";
home-manager.follows = "";
};
};
nixos-hardware.url = "github:nixos/nixos-hardware/master";
nur.url = "github:nix-community/NUR";
helix = {
url = "git+https://git.jolheiser.com/helix.drv.git";
inputs.nixpkgs.follows = "jolheiser/nixpkgs";
};
gomodinit = {
url = "git+https://git.jolheiser.com/gomodinit.git";
inputs.nixpkgs.follows = "nixpkgs";
};
cfg = {
url = "git+https://git.jolheiser.com/cfg.git";
inputs.nixpkgs.follows = "nixpkgs";
};
spectre = {
url = "git+https://git.jolheiser.com/go-spectre.git";
inputs.nixpkgs.follows = "nixpkgs";
};
templ = {
url = "github:a-h/templ";
inputs.nixpkgs.follows = "nixpkgs";
};
ghostty.url = "git+ssh://git@github.com/ghostty-org/ghostty";
tclip = {
url = "github:tailscale-dev/tclip";
inputs = {
utils.follows = "flake-utils";
};
};
};
outputs =
{
nixpkgs,
home-manager,
nixos-hardware,
agenix,
...
}@inputs:
let
overlays = [
(_: prev: {
nur = import inputs.nur {
nurpkgs = prev;
pkgs = prev;
};
jolheiser = {
helix = inputs.helix.packages.${prev.system}.default;
gomodinit = inputs.gomodinit.packages.${prev.system}.default;
cfg = inputs.cfg.packages.${prev.system}.default;
spectre = inputs.spectre.packages.${prev.system}.default;
};
tclip = inputs.tclip.packages.${prev.system}.tclip;
templ = inputs.templ.packages.${prev.system}.templ;
ghostty = inputs.ghostty.packages.${prev.system}.ghostty;
})
];
pkgs = import inputs.nixpkgs {
inherit overlays system;
config.allowUnfree = true;
};
commonConfig =
{ config, ... }:
{
config = {
nixpkgs.overlays = overlays;
};
};
username = "jolheiser";
system = "x86_64-linux";
homeManagerModules = [
agenix.homeManagerModules.age
{
home = {
inherit username;
homeDirectory = "/home/${username}";
};
age = {
secretsDir = "/home/${username}/.agenix/agenix";
secretsMountPoint = "/home/${username}/.agenix/agenix.d";
identityPaths = [ "/home/${username}/.ssh/nix" ];
secrets = {
ssh-config.file = ./secrets/ssh-config.age;
spotify = {
file = ./secrets/spotify.age;
path = "/home/${username}/.cache/spotify-player/credentials.json";
};
irc-pw.file = ./secrets/irc-pw.age;
spectre-pw.file = ./secrets/spectre-pw.age;
git-send-email.file = ./secrets/git-send-email.age;
cachix = {
file = ./secrets/cachix.age;
path = "/home/${username}/.config/cachix/cachix.dhall";
};
llm = {
file = ./secrets/llm.age;
path = "/home/${username}/.config/io.datasette.llm/keys.json";
};
};
};
}
./apps/gui
];
in
{
inherit homeManagerModules;
homeConfigurations = {
"jolheiser" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = homeManagerModules ++ [ ./apps/de ];
};
};
nixosConfigurations = {
"genmaicha" = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
nixos-hardware.nixosModules.framework-13-7040-amd
./machines/genmaicha
commonConfig
];
};
"sencha" = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./machines/sencha
commonConfig
];
};
};
nixConfig = {
extra-substitutors = [ "https://jolheiser.cachix.org" ];
extra-trusted-public-keys = [
"jolheiser.cachix.org-1:fiKkfTuHFqDK5ZOVxcqb4InUkKsrTvtMLISid7XvuVg="
];
};
devShells.${system}.default = pkgs.mkShell {
nativeBuildInputs = [
agenix.packages.${system}.agenix
];
};
};
}