dotnix/flake.nix

233 lines
6.5 KiB
Nix

{
description = "jolheiser's nixos config";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
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";
jolheiser-nur = {
url = "git+https://git.jolheiser.com/nur.git";
inputs.nixpkgs.follows = "nixpkgs";
};
helix = {
url = "git+https://git.jolheiser.com/helix.drv.git";
inputs.nixpkgs.follows = "nixpkgs";
};
website = {
url = "git+https://git.jolheiser.com/jolheiser.com.git";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
templ.follows = "templ";
};
};
resume = {
url = "git+https://git.jolheiser.com/resume.git";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
git-age = {
url = "git+https://git.jolheiser.com/git-age.git";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
gist = {
url = "git+https://git.jolheiser.com/gist.git";
inputs.nixpkgs.follows = "nixpkgs";
};
tmpl = {
url = "git+https://git.jolheiser.com/tmpl.git";
inputs.nixpkgs.follows = "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";
};
ugit = {
url = "git+https://git.jolheiser.com/ugit.git";
inputs.nixpkgs.follows = "nixpkgs";
};
# Other flakes
golink = {
url = "github:tailscale/golink";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
tclip = {
url = "github:tailscale-dev/tclip";
inputs = {
nixpkgs.follows = "nixpkgs";
utils.follows = "flake-utils";
};
};
templ = {
url = "github:a-h/templ";
inputs.nixpkgs.follows = "nixpkgs";
};
# WSL
wsl = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};
outputs = {
nixpkgs,
home-manager,
nixos-hardware,
agenix,
wsl,
...
} @ inputs: let
overlays = [
(_: prev: {
nur = import inputs.nur {
nurpkgs = prev;
pkgs = prev;
};
jolheiser = {
nur = inputs.jolheiser-nur.packages.${prev.system};
helix = inputs.helix.packages.${prev.system}.default;
website = inputs.website.packages.${prev.system}.default;
resume = inputs.resume.packages.${prev.system}.default;
git-age = inputs.git-age.packages.${prev.system}.default;
gist = inputs.gist.packages.${prev.system}.default;
tmpl = inputs.tmpl.packages.${prev.system}.default;
gomodinit = inputs.gomodinit.packages.${prev.system}.default;
cfg = inputs.cfg.packages.${prev.system}.default;
};
tclip = inputs.tclip.packages.${prev.system}.tclip;
templ = inputs.templ.packages.${prev.system}.templ;
})
inputs.golink.overlay
];
pkgs = import inputs.nixpkgs {
inherit overlays system;
config.allowUnfree = true;
};
commonConfig = {config, ...}: {
config = {
nixpkgs.overlays = overlays;
# TODO Remove when apps are updated
nixpkgs.config.permittedInsecurePackages = [
"electron-25.9.0"
];
};
};
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/shared/ssh-config.age;
spotify = {
file = ./secrets/shared/spotify.age;
path = "/home/${username}/.cache/spotify-player/credentials.json";
};
irc-pw.file = ./secrets/shared/irc-pw.age;
gist-pw.file = ./secrets/shared/gist-pw.age;
git-send-email.file = ./secrets/shared/git-send-email.age;
cachix = {
file = ./secrets/shared/cachix.age;
path = "/home/${username}/.config/cachix/cachix.dhall";
};
};
};
}
./apps/gui
];
in {
inherit homeManagerModules;
homeConfigurations = {
"jolheiser" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = homeManagerModules;
};
};
nixosConfigurations = {
"matcha" = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./machines/matcha
commonConfig
];
};
"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
];
};
};
colmena = {
meta = {
nixpkgs = import nixpkgs {
inherit overlays system;
};
};
dragonwell = {
imports = [
inputs.agenix.nixosModules.default
inputs.golink.nixosModules.default
inputs.ugit.nixosModules.default
./machines/dragonwell
];
};
};
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
pkgs.colmena
];
};
};
}