118 lines
3.3 KiB
Nix
Executable file
118 lines
3.3 KiB
Nix
Executable file
{
|
|
description = "Home Manager && NixOS configuration";
|
|
inputs = {
|
|
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
pre-commit-hooks = {
|
|
url = "github:cachix/pre-commit-hooks.nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
sops-nix = {
|
|
url = "github:Mic92/sops-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
nix-index-database = {
|
|
url = "github:nix-community/nix-index-database";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
treefmt-nix = {
|
|
url = "github:numtide/treefmt-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager/master";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
# nvim = {
|
|
# url = "github:iofq/nvim.nix";
|
|
# };
|
|
nvim = {
|
|
url = "path:/home/e/dev/nvim.nix";
|
|
};
|
|
deploy-rs = {
|
|
url = "github:serokell/deploy-rs";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
nh = {
|
|
url = "github:nix-community/nh";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
jj = {
|
|
url = "github:jj-vcs/jj";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
|
|
determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/*";
|
|
};
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
systems,
|
|
...
|
|
}@inputs:
|
|
let
|
|
attrs = {
|
|
username = "e";
|
|
};
|
|
system = "x86_64-linux";
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
config.allowUnfree = true;
|
|
overlays = [
|
|
inputs.neovim-nightly-overlay.overlays.default
|
|
inputs.nvim.overlays.default
|
|
inputs.nh.overlays.default
|
|
(old: new: {
|
|
jujutsu = inputs.jj.packages.${system}.jujutsu;
|
|
})
|
|
];
|
|
};
|
|
eachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
|
|
treefmtEval = eachSystem (pkgs: inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
|
|
in
|
|
{
|
|
nixosConfigurations = import ./nixos {
|
|
inherit
|
|
inputs
|
|
pkgs
|
|
attrs
|
|
system
|
|
;
|
|
};
|
|
homeConfigurations = import ./home-manager { inherit inputs pkgs attrs; };
|
|
checks = {
|
|
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
|
|
src = inputs.self;
|
|
hooks = {
|
|
treefmt.enable = true;
|
|
treefmt.package = treefmtEval.${system}.config.build.wrapper;
|
|
};
|
|
};
|
|
};
|
|
deploy.nodes = {
|
|
consensus = {
|
|
hostname = "consensus";
|
|
sshUser = "e";
|
|
remoteBuild = true;
|
|
profiles.system = {
|
|
user = "root";
|
|
path = inputs.deploy-rs.lib.${system}.activate.nixos self.nixosConfigurations.consensus;
|
|
};
|
|
};
|
|
};
|
|
formatter = eachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
|
|
devShells.${system}.default = pkgs.mkShell {
|
|
inherit (self.checks.pre-commit-check) shellHook;
|
|
buildInputs = [
|
|
pkgs.home-manager
|
|
pkgs.git
|
|
pkgs.ssh-to-age
|
|
pkgs.sops
|
|
pkgs.age
|
|
pkgs.deploy-rs
|
|
treefmtEval.${system}.config.build.wrapper
|
|
];
|
|
};
|
|
};
|
|
}
|