dotnix/flake.nix

105 lines
2.7 KiB
Nix

{
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";
ragenix.url = "github:yaxitech/ragenix";
ragenix.inputs.nixpkgs.follows = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
nur.url = "github:nix-community/nur";
jolheiser-nur.url = "git+https://git.jojodev.com/jolheiser/nur";
};
nixConfig = {warn-dirty = false;};
outputs = {
self,
nixpkgs,
home-manager,
ragenix,
jolheiser-nur,
...
} @ inputs: let
overlays = final: prev: {
nur = import inputs.nur {
nurpkgs = prev;
pkgs = prev;
repoOverrides = {
jolheiser = import jolheiser-nur {pkgs = prev;};
};
};
};
commonConfig = {username}: ({
config,
pkgs,
...
}: {
config = {
nixpkgs.overlays = [overlays];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.${username}.imports = [./apps];
extraSpecialArgs = {
flakePath = "/home/${username}/.config/nixpkgs";
};
};
age.secrets = {
ssh-config = {
file = ./secrets/shared/ssh-config.age;
owner = "jolheiser";
};
ssh-config-work = {
file = ./secrets/shared/ssh-config-work.age;
owner = "jolheiser";
};
"nushell.nu" = {
file = ./secrets/shared/nushell.nu.age;
owner = "jolheiser";
};
};
};
});
in
{
nixosConfigurations = {
"chai" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
home-manager.nixosModules.home-manager
ragenix.nixosModules.default
./machines/common
./machines/chai
(commonConfig {username = "jolheiser";})
({pkgs, ...}: {
home-manager.users.jolheiser.programs.git.package = pkgs.gitSVN;
})
];
};
"matcha" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
home-manager.nixosModules.home-manager
ragenix.nixosModules.default
./machines/common
./machines/matcha
(commonConfig {username = "jolheiser";})
];
};
};
}
// inputs.flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
just
ragenix.packages.${system}.ragenix
];
};
});
}