dotnix/flake.nix

103 lines
2.7 KiB
Nix
Raw Normal View History

2023-06-28 20:48:01 +00:00
{
description = "jolheiser's nixos config";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
agenix.url = "github:ryantm/agenix";
agenix.inputs = {
nixpkgs.follows = "nixpkgs";
darwin.follows = "";
};
flake-utils.url = "github:numtide/flake-utils";
2023-06-28 20:48:01 +00:00
nur.url = "github:nix-community/nur";
jolheiser-nur.url = "git+https://git.jojodev.com/jolheiser/nur";
2023-06-28 20:48:01 +00:00
};
outputs = {
self,
nixpkgs,
home-manager,
agenix,
jolheiser-nur,
...
} @ inputs: let
overlays = final: prev: {
nur = import inputs.nur {
nurpkgs = prev;
pkgs = prev;
repoOverrides = {
jolheiser = import jolheiser-nur {pkgs = prev;};
2023-06-28 20:48:01 +00:00
};
};
};
commonConfig = {
config,
pkgs,
...
}: let
userSecret = path: {
file = path;
owner = username;
};
in {
config = {
nixpkgs.overlays = [overlays];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.${username}.imports = [./apps];
extraSpecialArgs = {
flakePath = "/home/${username}/.config/nixpkgs";
};
2023-06-28 20:48:01 +00:00
};
age.secrets = {
ssh-config = userSecret ./secrets/shared/ssh-config.age;
ssh-config-work = userSecret ./secrets/shared/ssh-config-work.age;
spotify-pw = userSecret ./secrets/shared/spotify-pw.age;
irc-pw = userSecret ./secrets/shared/irc-pw.age;
};
2023-06-28 20:48:01 +00:00
};
};
username = "jolheiser";
in
{
nixosConfigurations = {
"chai" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
home-manager.nixosModules.home-manager
agenix.nixosModules.default
./machines/common
./machines/chai
commonConfig
({pkgs, ...}: {
home-manager.users.${username}.programs.git.package = pkgs.gitSVN;
})
];
};
"matcha" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
home-manager.nixosModules.home-manager
agenix.nixosModules.default
./machines/common
./machines/matcha
commonConfig
];
};
};
}
// inputs.flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
nativeBuildInputs = [
agenix.packages.${system}.agenix
];
};
});
2023-06-28 20:48:01 +00:00
}