mirror of
https://github.com/srid/nixos-config.git
synced 2025-12-26 23:14:57 +08:00
91 lines
2.8 KiB
Nix
91 lines
2.8 KiB
Nix
{
|
|
description = "Srid's NixOS configuration";
|
|
|
|
inputs = {
|
|
# Principle inputs
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
darwin.url = "github:lnl7/nix-darwin/master";
|
|
darwin.inputs.nixpkgs.follows = "nixpkgs";
|
|
home-manager.url = "github:nix-community/home-manager";
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
|
agenix.url = "github:ryantm/agenix";
|
|
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
|
|
|
# CI server
|
|
hci.url = "github:hercules-ci/hercules-ci-agent";
|
|
nix-serve-ng.url = "github:aristanetworks/nix-serve-ng";
|
|
|
|
# Software inputs
|
|
nixos-shell.url = "github:Mic92/nixos-shell";
|
|
nixos-vscode-server.url = "github:msteen/nixos-vscode-server";
|
|
nixos-vscode-server.flake = false;
|
|
comma.url = "github:nix-community/comma";
|
|
comma.inputs.nixpkgs.follows = "nixpkgs";
|
|
emanote.url = "github:srid/emanote";
|
|
nixpkgs-match.url = "github:srid/nixpkgs-match";
|
|
|
|
# Emacs
|
|
emacs-overlay.url = "github:nix-community/emacs-overlay";
|
|
|
|
# Vim & its plugins (not in nixpkgs)
|
|
zk-nvim.url = "github:mickael-menu/zk-nvim";
|
|
zk-nvim.flake = false;
|
|
coc-rust-analyzer.url = "github:fannheyward/coc-rust-analyzer";
|
|
coc-rust-analyzer.flake = false;
|
|
};
|
|
|
|
outputs = inputs@{ self, home-manager, nixpkgs, darwin, ... }:
|
|
inputs.flake-parts.lib.mkFlake { inherit (inputs) self; } {
|
|
systems = [ "x86_64-linux" "aarch64-darwin" ];
|
|
imports = [
|
|
./lib.nix
|
|
./users
|
|
./home
|
|
./nixos
|
|
./nix-darwin
|
|
];
|
|
|
|
flake = {
|
|
flakeModule = ./lib.nix;
|
|
# Configurations for Linux (NixOS) systems
|
|
nixosConfigurations = {
|
|
pce = self.lib.mkLinuxSystem {
|
|
imports = [
|
|
self.nixosModules.default # Defined in nixos/default.nix
|
|
./systems/hetzner/ax101.nix
|
|
./nixos/server/harden.nix
|
|
./nixos/docker.nix
|
|
# ./nixos/hercules.nix
|
|
# I host a Nix cache
|
|
# (import ./nixos/cache-server.nix {
|
|
# keyName = "cache-priv-key";
|
|
# domain = "cache.srid.ca";
|
|
# })
|
|
];
|
|
};
|
|
};
|
|
|
|
# Configurations for my (only) macOS machine (using nix-darwin)
|
|
darwinConfigurations = {
|
|
default = self.lib.mkMacosSystem {
|
|
imports = [
|
|
self.darwinModules.default # Defined in nix-darwin/default.nix
|
|
./nixos/hercules.nix
|
|
./systems/darwin.nix
|
|
];
|
|
};
|
|
};
|
|
};
|
|
|
|
perSystem = { pkgs, config, inputs', ... }: {
|
|
devShells.default = pkgs.mkShell {
|
|
buildInputs = [
|
|
pkgs.nixpkgs-fmt
|
|
inputs'.agenix.packages.agenix
|
|
];
|
|
};
|
|
formatter = pkgs.nixpkgs-fmt;
|
|
};
|
|
};
|
|
}
|